ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: <rant> inheritrefs just seems to plain not work </rant>
Date Fri, 22 Apr 2005 13:59:07 GMT
> From: Rob Walker [mailto:robw@ascert.com]
> 
> Our top level build.xml looks like this:
> 
>     <project name="vt" default="usage" basedir=".." >
>     ...
>         <path id="vt.class.path">
>             <pathelement path="${java.class.path}/"/>
>             <pathelement path="${classpath}"/>
>             <pathelement path="${dir.obj}"/>
>             <fileset dir="${dir.proj}">
>                 <include name="**/lib/*.jar"/>
>             </fileset>
>             <fileset dir="${dir.build}/ext">
>                 <include name="**/*.jar"/>
>             </fileset>
>         </path>
>     ...
>         <target name="vcomp" depends="init">
>             <ant antfile="${dir.build}/build_vcomp.xml"
> inheritrefs="true"/>
>         </target>
> 
> Whatever we try, the build_vcomp.xml just won't inherit the
> "vt.class.path" reference. We get Ant errors saying the
"vt.class.path"
> isn't defined.
> 
> Is this a know problem? Are we missing something stupidly obvious?

You're not showing enough to really ascertain for sure what could be
wrong. Have you tried to distill down your builds to something simple
enough that can be sent whole for troubleshooting?

This is often not a futile exercise, as many times users can't reproduce
the failure with a simpler version of their build, and eventually figure
out the problem is elsewhere...

This distilled build can simple define an id'd path in the top level
build, and echo the refid'd path in the subbuild. I suggest you try
this. --DD

PS: IMHO, I see signs that your build may suffer from using
    too many variables. Removing 'static' variables (the ones
    that in fact you never need to change) leads to more stable
    builds in my experience. Use variables only when necessary.

PPS: <import> can often be used to refactor complex multi-file
     builds. You should consider it if you plan to work on this
     build again soon.

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


Mime
View raw message