ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew.W...@adidas.com.hk
Subject RE: How to write an build script so that the jar get updated ONLY whe n its .class is compiled (i.e. the java get changed)
Date Wed, 21 Apr 2004 07:37:32 GMT
Hi,
 Thanks for you response.
 What I have observed (based on the result) is that, the javac works in that
way.
 But for jar, it NEVER jar the file again if the jar file (jarfile
attribute) exists.
e.g.
	<target name="po_client_jar" depends="compile">
		<echo>+---------------------------------------+</echo>
		<echo>+       Building PO Client Jar          +</echo>
		<echo>+---------------------------------------+</echo>
		<jar jarfile="${po.client.jar}"
basedir="${esc2.classbindir}" includes="**/cbo/po/ejb/**"
excludes="**/cbo/po/ejb/**EJB.*,**/cbo/po/ejb/**MDB.*"/>
	</target>




-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, 21 April, 2004 3:34 PM
To: user@ant.apache.org
Subject: Re: How to write an build script so that the jar get updated ONLY
whe n its .class is compiled (i.e. the java get changed)


On Wed, 21 Apr 2004, Andrew Wong <Andrew.Wong@adidas.com.hk> wrote:

> Hi, How to write an build script so that the jar get updated ONLY
> when its .class is compiled (i.e. the java get changed) I can't do
> it with uptodate tag

You don't do anything special at all.

<javac> doesn't do anything if your .class files are more recent than
your .java files.

<jar> doesn't do anything if the jar file content is more recent than
what you'd want to add.

So all you do is simply use <javac> and <jar> and let the tasks take
care of the rest.

Stefan

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message