ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject Re: How to execute task just if a propertie is set
Date Thu, 16 May 2002 18:32:44 GMT

On Thursday, May 16, 2002, at 10:40  AM, Emerson Cargnin - MSA wrote:

> thanks Diane, but i was using this manual successfully 'till now. I'm 
> gonna
> update the ant version to the 1.5 beta one. Has anyone used it without
> errors?

It has been generally quite good.

I have had a number of problems with empty sets causing trouble.  If you 
avoid that construct, you should be ok.  (The construct is a rather 
unusual one, caused by using the same build file with different 
properties for all sixty of our builds.  Some have libraries they need, 
some have earlier products, and I want the same constructions for both.)

See "Zip exceptions from Depend when "includes" blank"  from May 15and 
"Why does FileList.getFiles() not allow empty lists?" from May 14 for 
the gory details.  These should be avoidable for many people, but they 
are a real pain for those of us who cannot avoid them.

On the plus side, the ability to send zipgroupfilesets to the jar task 
and isset condition are both REALLY cool, and justifies an immediate 
switch noce we get past these problems.

Once I get a way to do javac, depend, and jar with potentially empty 
filesets or filelists without exceptions, we will go to a full 
deployment.  It is VERY cool.

Gory details of the construct to be wary of:
   <target name="compile">
     <javac
       srcdir="${compile.source}"
       destdir="${compile.classes}">
       <classpath>
         <filelist dir="${compile.library.dir}" 
files="${compile.library.classpath}"/>
         <filelist dir="${compile.products.dir}" 
files="${compile.products.classpath}"/>
       </classpath>
     </javac>
   </target>

has an explicit "build failed - empty fileset" thrown.

   <target name="depend">
     <depend
       srcdir="${compile.source}"
       destdir="${compile.classes}"
       cache="${compile.depcache}"
       closure="yes"
       excludes="${compile.excludedFiles}"
       includes="${compile.includedFiles}">
       <classpath>
         <fileset dir="${compile.library.dir}" 
includes="${compile.library.classpath}"/>
         <fileset dir="${compile.products.dir}" 
includes="${compile.products.classpath}"/>
       </classpath>
     </depend>
   </target>

throws an exception.  I can stop the exception by putting "foo.jar" or 
some other nonsense in the classpath, but I do not want to do that if I 
can help it.

Scott


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