File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes How to Prevent Reduntant compilation IN ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to Prevent Reduntant compilation IN ANT " Watch "How to Prevent Reduntant compilation IN ANT " New topic
Author

How to Prevent Reduntant compilation IN ANT

maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
see this build.xml

init is separate task,compilation is separate task here;when i run this script for the firsttime it compiled the files;but next time i didnt change anything in source files;i dont want to source files to be compiled again;will ant script run the compile task(compile the all source files) again?

<project name="MyProject" default="dist" basedir=".">
<description>simple example build file</description>
<!-- set global properties for this build -->
<property name="src" location="com/blah/blah/blah"/>
<property name="build" value="c:/JDeveloper/jdev/mywork/Model/classes"/>
<property name="ejbjardir" value="C:/Source/dist"/>
<property name="CopyofEjbJAR" value="c:/downloads"/>
<property name="jdev.home" value="C:/JDeveloper"/>

<path id="common.class.path">
<pathelement location="${jdev.home}/j2ee/home/lib/ejb.jar" />
<pathelement location="c:/utilities/commons-logging.jar" />
</path>

<property name="common.class.path" refid="common.class.path"/>

<target name="init">
<delete file="${CopyofEjbJAR}/EJB.jar"/>
<copy file="${ejbjardir}/EJB.jar" todir="${CopyofEjbJAR}"/>
<delete>
<fileset dir="." includes="**/*.cdi"/>
</delete>
</target>


<target name="compile" depends="init" description="compile the source ">
<javac srcdir="${src}" destdir="${build}" debug="on">
<classpath>
<pathelement path="${common.class.path}" />
</classpath>
</javac>
</target>

</project>
Dave Tuttle
Ranch Hand

Joined: Jan 18, 2006
Posts: 34
Try this: http://ant.apache.org/faq.html#always-recompiles
--Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Prevent Reduntant compilation IN ANT