Bug 28809 - ANT_HOME not set on first run of Ant tool
Summary: ANT_HOME not set on first run of Ant tool
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Jared Burns CLA
QA Contact:
URL:
Whiteboard:
Keywords: core, ui
Depends on:
Blocks:
 
Reported: 2002-12-22 17:33 EST by Ian Jefferies CLA
Modified: 2003-01-08 18:21 EST (History)
0 users

See Also:


Attachments
Test case build file to demonstrate the bug (186 bytes, text/xml)
2002-12-22 17:37 EST, Ian Jefferies CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.