ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Redefining path id aliases in a subproject
Date Thu, 15 Nov 2001 02:31:32 GMT
--- Anupama Ramesh <anupama.ramesh@demandtec.com> wrote:
> I'm a new user.If you're using build.xml and defining subprojects this
> may be important.I was wondering if any of you have seen the problem.Ant
> won't let a subproject redefine path id aliases.  So, if someone defines
> a path id for your classpath like:
> 
>     <path id="class.path">
>         <pathelement path="${classpath}"/>
>         <pathelement location="${jboss.dist}/lib/ext/jboss-j2ee.jar"/>
>         <pathelement location="${tomcat.dist}/lib/servlet.jar"/>
>     </path>
> 
> And you try to redefine class.path in a subproject's build.xml the
> redefinition won't take.

I'm not sure what you mean by "won't take". I don't have a problem
redefining a <path> id in a sub-buildfile.

Could you try assigning the path to a property so you can <echo> it out,
then sending that along so we can see what it's doing for you?

For example:
$ cat build.xml
<project default="main">
  <path id="a_path">
    <pathelement path="${java.library.path}"/>
  </path>
  <property name="path" refid="a_path"/>
  <target name="main">
    <echo message="path = ${path}"/>
    <ant dir="sub"/>
  </target>
</project>
$ cat sub/build.xml
<project default="subtarget">
  <path id="a_path">
    <pathelement path="${java.class.path}"/>
  </path>
  <property name="newpath" refid="a_path"/>
  <target name="subtarget">
    <echo message="newpath = ${newpath}"/>
  </target>
</project>
$ ant
Buildfile: build.xml

main:
  [echo] path = /usr/local/java/jdk13/bin:/home/work/ant...(etc.)

subtarget:
  [echo] newpath =
/usr/ant/lib/optional.jar:/usr/ant/lib/jaxp.jar...(etc.)

BUILD SUCCESSFUL

Total time: 0 seconds

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message