Bug 28809

Summary: ANT_HOME not set on first run of Ant tool
Product: [Eclipse Project] Platform Reporter: Ian Jefferies <eclipse_bugzilla>
Component: AntAssignee: Jared Burns <jared_burns>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: core, ui
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Test case build file to demonstrate the bug none

Description Ian Jefferies CLA 2002-12-22 17:33:56 EST
I'm running an external version of Ant (1.5) from my "E:\ant" directory. Eclipse
is set to use this exernal version, and the config Preferences/Ant/Runtime have
been configured to set ANT_HOME to "E:\ant" (the checkbox is ticked).

Ant sets/expects the "ant.home" property to be set to Ant's location. Using this
test build file: 


<?xml version="1.0"?>

<project name="ant_home" default="ant_home_test" basedir=".">
	<target name="ant_home_test">
		<echo message="ant.home=${ant.home}"/>
	</target>
</project>


The first build using Ant fails to set the ant.home property correctly,
producing the following output: 

Buildfile: E:\eclipse\workspace\HelloEJB\ant_home_test.xml

ant_home_test:
        [echo] ant.home=${ant.home}
BUILD SUCCESSFUL


The second and following builds do set the ant.home property correctly,
producting the expected output:


Buildfile: E:\eclipse\workspace\HelloEJB\ant_home_test.xml

ant_home_test:
        [echo] ant.home=E:\ant
BUILD SUCCESSFUL


Workaround: discard the first Ant build.

Eclipse 2.1 M4 on Windows 2000.

Apologies if I've missed anything important, this is my first bug submission to
Bugzilla.
Comment 1 Ian Jefferies CLA 2002-12-22 17:37:06 EST
Created attachment 2867 [details]
Test case build file to demonstrate the bug
Comment 2 Darin Swanson CLA 2002-12-31 17:28:31 EST
A few bugs here:
not setting the system property early enough
not clearing the system property if the user had unset ant_home
launch specific settings were not honored.

Fixed in AntCorePreferences and InternalAntRunner, AntRunner and AntUtil.
Please verify (Jared).
Comment 3 Ian Jefferies CLA 2003-01-01 13:41:36 EST
I was about to report some additional information to help in the bug hunt. I
moved my external Ant installation to another dir, and found the old E:\ant
appearing instead of the null-like value of ${ant.home}, suggesting a history
problem.

Sounds like you caught it, many thanks.
Comment 4 Jared Burns CLA 2003-01-08 18:21:24 EST
Verified.