You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Michael Wang (IT)" <MW...@bordersgroupinc.com> on 2005/03/01 17:15:33 UTC

javac task to include properties file

any arg to include those properties which will copy them from srcdir to targetdir? thanks.

Re: javac task to include properties file

Posted by Ivan Ivanov <ra...@yahoo.com>.
--- Jeffrey E Care <ca...@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\)" <MW...@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


Re: javac task to include properties file

Posted by Jeffrey E Care <ca...@us.ibm.com>.
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.

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\)" <MW...@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.