Bug 42715 - ant.version property lost in imported build scripts
Summary: ant.version property lost in imported build scripts
Status: RESOLVED DUPLICATE of bug 42263
Alias: None
Product: Ant
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 1.7.0
Hardware: Other Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 08:04 UTC by Russ Baker
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Russ Baker 2007-06-21 08:04:57 UTC
The ant.version property is unset in imported build scripts using ANT 1.7. I
have a build file that uses an import "<import file="newBuild.xml"/>". In this
file, we do a check to see if the user is using the correct version of ANT using
the following:

    <condition property="ant.version.okay">
        <or>
          <contains string="${ant.version}" substring="1.6"/>
          <contains string="${ant.version}" substring="1.7"/>
        </or>
    </condition>

The property was never set, so I checked to see if the property was set by doing
this:
<echo>
	ANT VERSION: ${ant.version}
</echo> 

And this is exactly what appeared on the output:

ANT VERSION: ${ant.version}

So, it looks like the property gets lost somehow. I tested this on two different
boxes, so I'm pretty sure this is a bug.
Comment 1 Steve Loughran 2007-06-21 08:25:38 UTC

*** This bug has been marked as a duplicate of 42263 ***
Comment 2 Steve Loughran 2007-06-21 08:26:55 UTC
oh, rereading its not quite the same; its import and not subant. Reopening.
Comment 3 Peter Reilly 2007-06-21 09:12:20 UTC
I think that this is the same as  42263.

Please check your build file with a svn build of ant,
or provide an example set of build files that
show the problem.
Comment 4 Russ Baker 2007-06-21 12:38:13 UTC
This is happening when I am testing the Beehive dist. You can get the build
files and do a repro by following the instructions here:
http://wiki.apache.org/beehive/For_Beehive_Developers. Once you set up the
environment to use ANT 1.7, you can repro.
Comment 5 Peter Reilly 2007-06-21 13:09:55 UTC
The build file:
http://svn.apache.org/repos/asf/beehive/trunk/ant/beehive-runtime.xml
contains the <ant inheritAll="false"/> task which will trigger
this the 42263 bug:
    <target name="deploy.beehive.webapp.runtime" description="Deploy the Beehive
webapp runtime given a webapp root as -Dwebapp.dir">
        <ant target="deploy.netui" dir="${beehive.home}/netui/" inheritAll="false">
            <property name="webapp.dir" location="${webapp.dir}"/>
        </ant>
    </target>

    <target name="deploy.controls.webapp.runtime" description="Deploy the
Beehive controls runtime given a webapp root as -Dwebapp.dir">
        <ant target="deploy.controls.runtime" dir="${beehive.home}/controls/"
inheritAll="false">
            <property name="webapp.dir" location="${webapp.dir}"/>
        </ant>
    </target>

The project should work with ant 1.7.1(svn), in the mean-time
you can use the work-around of passing the ant.version to
the nested ant project:
   <ant target=....>
     <property name="ant.version" value="${ant.version}"/>
      ...
    </ant>
Re-Marking as duplicate

*** This bug has been marked as a duplicate of 42263 ***