| Summary: | ant.home is not set | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | thierry lach <thierry.lach> | ||||
| Component: | Ant | Assignee: | Darin Wright <darin.eclipse> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | danrubel, Darin_Swanson, dlr, knut.wannheden | ||||
| Version: | 2.1 | ||||||
| Target Milestone: | 3.0 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 2000 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
thierry lach
Do you have a test case that is failing? In Eclipse 2.1, ant.home is set if it has been set in the ant preference page. (see InternalAntRunner.processAntHome(boolean)) It is not set to the Ant plugin directory currently but we have bug 37058 to consider the work to make this happen. See http://issues.whichever.com/scarab/issues/id/SCB765 for some background. Created attachment 4889 [details]
test case
example build.xml showing the problem.
I've attached a build file that contains a distillation of the problem. I realize that in this context setting ant.home in the script to "." would be meaningless unless "." were set up correctly as a true ant home. This script, however, runs as expected when executed as "ant" from a command line but fails with the following message when run within eclipse. [available] BUILD FAILED: file:c:/webroot/source/scarab.omfix/build/build.xml:19: C:\webroot\source\scarab.omfix\build\lib not found. If you'd like to try this out yourself, you can checkout Scarab using the following CVSROOT (password: guest): $ cvs -d :pserver:guest@cvs.tigris.org:/cvs login Logging in to :pserver:guest@cvs.tigris.org:2401/cvs CVS password: The link at Comment #2 is requesting a password? Nevermind...I should have read more before complaining :-) *** Bug 37058 has been marked as a duplicate of this bug. *** This will require a reorganization of the org.apache.ant project to include a lib directory. Darin, would you mind sketching out why the lib directory is required, and how it should look? Apache Ant expects ant.home to be the root dir of the Ant install. It then looks for a lib directory to find all of the libraries it requires / uses by default. So you would need to set the ANT_HOME to ..\org.apache.ant and the org.apache.ant project would need to have a lib directory that contained the ant.jar and the optional.jar (which currently reside at the top level). The plugin.xml would need to be updated for the runtime library entries. I suggest one of two options - IMO the first would be preferable as long as it doesn't violate any guidelines for packaging eclipse plugins. 1. Place ant.jar and optional.jar into the lib directory. This would create an ANT_HOME very similar to that which comes with the stand-alone ant. This would require the plugin.xml to reference the jars in the lib directory to avoid duplicate jars. 2. Create an empty lib directory. This at least would satisfy any build scripts which are making assumptions about the ANT_HOME directory structure. I'm not as concerned about the presence or absence of a lib directory as I am the absence of the ant.home variable. Of more importance might be the absence of the ant.home/etc directory and the xsl files contained within. The example that I attached earlier referencing the ant.home/lib directory, while taken from a "real-world" case, is probably not as reasonable as a case for providing the etc directory. If you intend to reorganize the plugin layout anyway, I suggest that you also add the bin directory. The bin directory is actually used by Ant's <exec> task if the vmlauncher attribute is set to "false". In that case <exec> will use a platform specific script (e.g. antRun.bat) to execute the external command. I intend to release this immediately after the M3 build for inclusion in M4. This will include the lib and bin directories. Added the bin directory and the 3 wrapper scripts. Created the lib directory and moved ant.jar and optional.jar Changes to .classpath, .cvsignore, about.html, build.properties Updated our buildfiles that had path references to /org.apache.ant/ant.jar Updated the ant core tests. As well as changes to AntCorePreferences. Please verify Darinw. Also changes to AntClasspathTab, AntClasspathBlock, and AntClasspathPage. As well changes to org.eclipse.ant.core and org.eclipse.ant.ui build.properties Verified. |