ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ant question2 <antquesti...@yahoo.com>
Subject Re: reference inside an ant task.
Date Tue, 04 May 2004 15:17:25 GMT
I seemed to have solved part of the problem.  The issue was not with 
the reference but with the property I was using to display the path reference.
If I move the property setting inside the task then the output behaves as I expect it to.
The binding times for properties of ihnertied references is clearly very complex.
 
Here is the working code
 
 
<?xml version="1.0"?>
<project name="a.xml" default="default">
  <path id="path1">
    <fileset dir=".">
      <include name="a.xml"/>
    </fileset>
  </path>

  <target name="default" >
    <property name="print1" refid="path1"/>
    <echo message="${print1}" /> 
     <ant antfile="b.xml" inheritRefs="false">
       <reference refid="path1"/>
     </ant>
  </target>
</project>
 
-----------------------------------------------------
 
<?xml version="1.0"?>
<project name="b.xml" default="default">
   <path id="path1">
    <fileset dir=".">
      <include name="b.xml"/>
    </fileset>
  </path>

  <target name="default" >
    <property name="print2" refid="path1"/>
    <echo message="${print2}" /> 
  </target>
</project>

--------------------------
 
 
$ ant -f a.xml
Buildfile: a.xml
default:
     [echo] C:\cygwin\home\a.xml
Overriding previous definition of reference to path1
default:
     [echo] C:\cygwin\home\a.xml
BUILD SUCCESSFUL
Total time: 1 second

		
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message