ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: any way include a fileset in a classpath conditionally?
Date Tue, 27 Aug 2002 17:55:07 GMT
Filesets cannot be conditional, but include/exclude elements have 
if/unless attributes in exactly the same manner as target if/unless.

	Erik


Nolan Ring wrote:
> Hi,
> 
> The following is the classpath for my javac task.  The problem I'm having is
> that the nightlyBuildDir directory, which is defined in a global.properties
> file, may or may not exist.  If it does exist, I want its contents to be
> included in the classpath; if it doesn't exist I want it to be skipped.
> Right now, if ${nightlyBuildDir} doesn't exist my build fails.
> 
> Is there some way to conditionally set include fileset based on whether or
> not ${nightlyBuildDir} exists?  I thought, at first, that <available> might
> work, but don't want to run the entire target conditionally - just set this
> piece of the classpath. 
> 
>         <classpath>
>             <pathelement path="${classpath}"/>
>             <pathelement path="${classesDir}"/>
>             <fileset dir="${distDir}">
>                 <include name="**/*.jar"/>
>                 <include name="**/*.zip"/>
>                 <exclude name="${jarName}"/>
>             </fileset>
>             <fileset dir="${nightlyBuildDir}">
>                 <include name="**/*.jar" />
>                 <include name="**/*.zip" />
>                 <exclude name="${jarName}" />
>             </fileset>
>             <fileset dir="${libDir}">
>                 <include name="**/*.jar"/>
>             </fileset>
>          </classpath>
> 
> Thanks much.
> 
> Nolan Ring
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 
> 
> 



--
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