ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: any way include a fileset in a classpath conditionally?
Date Tue, 27 Aug 2002 17:53:08 GMT
I have gotten around this by using nested dirsets. 
The trick is to point the dirset to some higher-level
directory that you expect will exist, and include
subdirectories that match the directory that might
exist.  If it does not, the dirset will be empty, no
harm done.  I'm not sure how best to make this
approach work if you are using an absolute path,
however.

-Matt

--- Nolan Ring <Nolan.Ring@Sun.Com> 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>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.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