ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: javac task to include properties file
Date Tue, 01 Mar 2005 18:04:46 GMT

--- Jeffrey E Care <carej@us.ibm.com> wrote:

> AFAIK javac ignores non-Java files (you can see this
> in verbose or debug 
> mode). If you need to have copies of other file
> types in your "classes" 
> directory then the obvious solution would be to copy
> them. 
> 
> Implementation left as an exercise for the reader.

<target name="compile" depends="copyProps, -init">
  <javac srcdir="${project.src}"
     destdir="${project.classes}" classpath="...">
</target>

<target name="copyProps" depends="-init">
  <copy todir="${project.classes}">
     <fileset dir="${project.src}">
        <include name="**/*.properties">
     </fileset>
  </copy>  
</target>

It is a useful exercise :)) One of my very first
errors when I started mastering Ant was that in
compile target I did an <antcall> to copyProps instead
of depending on it. As the build xml grew bigger, it
ended to copying the properties file several times due
to poor design and lots of <antcall>s.
It is also worth noting that when an i18n'ed
application is developed copyProps target is a possble
place for doing <native2ascii> transformation.

Regards Ivan

> 
> JEC
> -- 
> Jeffrey E. Care (carej@us.ibm.com)
> WebSphere Build SWAT Team Lead
> WebSphere Build Tooling Lead (Project Mantis)
> https://w3.opensource.ibm.com/projects/mantis
> 
> 
> "Michael Wang \(IT\)" <MWANG@bordersgroupinc.com>
> wrote on 03/01/2005 
> 11:15:33 AM:
> 
> > any arg to include those properties which will
> copy them from srcdir
> > to targetdir? thanks.
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

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


Mime
View raw message