ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ant Man <antquest...@yahoo.com>
Subject Overriding
Date Mon, 26 Apr 2004 15:22:30 GMT
I am having trouble getting the ant inheritRefs to work as I would
expect it too.  I would like to set various class paths in my top level
ant file and have sub ant files be unable to change their class 
paths from what they are given.
 
Here is a small ant build script which demonstrates the idea.
I have set path1 differently in files a.xml and b.xml.  I attempt to
override the path1 so that a.xml sets the path for b.xml. Unfortunatly
in my output the two path1's are showing different output.
This is not what I expected to see.  I have been looking at this
code for several days  now and have tried many different combinations
of settings yet I can not seem to get the override to work correctly.
 
Ken
 
<?xml version="1.0"?>
<project name="a.xml" default="default">
  <path id="path1">
    <fileset dir=".">
      <include name="a.xml"/>
    </fileset>
  </path>
  <property name="print1" refid="path1"/>
  <target name="default" >
    <echo message="${print1}" /> 
     <ant antfile="b.xml" inheritRefs="true">
<!-- The next line does not seem to effect the output at all--> 
       <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>
  <property name="print2" refid="path1"/>
  <target name="default" >
    <echo message="${print2}" /> 
  </target>
</project>

 
 
 

		
---------------------------------
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message