<< Back to previous view |
[QB-2317] Ant plugin configuration should not specify the path to the Ant executable; instead, it should specify ANT_HOME
|
|
Status: | Resolved |
Project: | QuickBuild |
Component/s: | None |
Affects Version/s: | 5.1.40 |
Fix Version/s: | 6.0.6, 6.0.9 |
Type: | Bug | Priority: | Major |
Reporter: | Daniel Yankowsky | Assigned To: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Remaining Estimate: | Unknown | Time Spent: | Unknown |
Original Estimate: | Unknown |
Description |
The ant plugin configuration page allows the user to specify the path to ant.bat. There are a few problems with this:
1. Ant might be in a different directory on every machine 2. A particular build might want to use a different version of Ant 3. The launch script is named differently on different platforms (ant.bat on Windows, ant on Linix) 4. The default ant launch scripts looks for the ANT_HOME environment variable, and actually launches ant from that path if the variable is set. So if you run ant.bat from an ant 1.8.x directory, but your ANT_HOME points at a 1.9.x directory, it will run Ant 1.9.x. We've worked around the first two by setting the ant plugin configuration to `${vars.getValue("AntPath")}`, and then defined a variable in the root configuration that points to a reasonable default for most of our build machines. Individual builds can override the variable if they want to use a different version of ant, or if they want to use ant from a different location (i.e. from source control). The third point is a hassle, but can be worked around in the same way as the first two. If we are building on Linux, we just make sure that the AntPath variable does not include an extension. The fourth is more difficult. The Linix launch script basically says "if ANT_HOME is not set, then consult /etc/ant.conf", and the preinstalled ant.conf on that particular box sets ANT_HOME to /usr/share/ant. So on our Linux box, the only way for us to run a custom version of Ant is to set the ANT_HOME environment variable of EVERY Ant build step. If we ever forget to do this, it will instead use the preinstalled Ant. Instead, it would be good if the global Ant plugin configuration allowed me to set the ANT_HOME variable (which is the like the current value without the last two segments: rather than C:\ant\bin\ant.bat, it would be C:\ant). Also, the ant builder plugin could take the build agent OS into account, and run the appropriate ant launch script. So on windows, it would run ANT_HOME\bin\ant.bat, and on Linix, it could run ANT_HOME\bin\ant. Finally, when the builder actually runs the launch script, it could pre-set the ANT_HOME environment variable, thus ensuring that the correct version of Ant is run. |