ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r538995 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/Project.java src/main/org/apache/tools/ant/taskdefs/Ant.java src/tests/antunit/taskdefs/subant-test.xml
Date Thu, 17 May 2007 16:16:17 GMT
Author: stevel
Date: Thu May 17 09:16:16 2007
New Revision: 538995

URL: http://svn.apache.org/viewvc?view=rev&rev=538995
Log:
bugzilla bug 42263: ${ant.version} not set in <subant>

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/Project.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=538995&r1=538994&r2=538995
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu May 17 09:16:16 2007
@@ -81,6 +81,9 @@
 * 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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Project.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?view=diff&rev=538995&r1=538994&r2=538995
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Project.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Project.java Thu May 17 09:16:16 2007
@@ -309,6 +309,12 @@
         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);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java?view=diff&rev=538995&r1=538994&r2=538995
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java Thu May 17 09:16:16 2007
@@ -199,9 +199,9 @@
         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

Added: ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml?view=auto&rev=538995
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml Thu May 17 09:16:16 2007
@@ -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>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message