Browse Source

bugzilla bug 42263: ${ant.version} not set in <subant>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@538995 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
d6ec4ccf3c
4 changed files with 38 additions and 3 deletions
  1. +3
    -0
      WHATSNEW
  2. +6
    -0
      src/main/org/apache/tools/ant/Project.java
  3. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Ant.java
  4. +26
    -0
      src/tests/antunit/taskdefs/subant-test.xml

+ 3
- 0
WHATSNEW View File

@@ -81,6 +81,9 @@ Fixed bugs:
* Regression: concat fixlastline="true" should not have applied to
nested text, but did in Ant 1.7.0. Bugzilla 42369.

* Regression: ant.version was not passed down in <subant>.
This worked in Ant1.6.5, but not in 1.7.0. Bugzilla bug 42263

Other changes:
--------------
* <script> now has basic support for JavaFX scripts


+ 6
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -309,6 +309,12 @@ public class Project implements ResourceFactory {
setAntLib();
}

/**
* Set a property to the location of ant.jar.
* Use the locator to find the location of the Project.class, and
* if this is not null, set the property {@link MagicNames#ANT_LIB}
* to the result
*/
private void setAntLib() {
File antlib = org.apache.tools.ant.launch.Locator.getClassSource(
Project.class);


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -199,9 +199,9 @@ public class Ant extends Task {
getProject().copyUserProperties(newProject);

if (!inheritAll) {
// set Java built-in properties separately,
// b/c we won't inherit them.
newProject.setSystemProperties();
// set Ant's built-in properties separately,
// because they are not being inherited.
newProject.initProperties();

} else {
// set all properties from calling project


+ 26
- 0
src/tests/antunit/taskdefs/subant-test.xml View File

@@ -0,0 +1,26 @@
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">

<description >
Test that subant properly sets various properties
</description>
<import file="../antunit-base.xml" />

<target name="tearDown">
<delete file="binaryAppendDest" />
<delete file="encodeStringDest" />
</target>


<target name="assertProperties">
<au:assertPropertySet name="ant.version" />
<au:assertPropertySet name="java.home" />
<au:assertPropertySet name="java.class.path" />
</target>

<target name="testAntVersion">
<subant inheritall="false" target="assertProperties">
<fileset file="${ant.file}" />
</subant>
</target>

</project>

Loading…
Cancel
Save