ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject RE: problem in compiling source code
Date Fri, 28 May 2004 14:40:35 GMT

--- "Chandolu, Yuva" <YChandolu@arbinet.com> wrote:
> I tried "compile" and it worked!!, great, thanks.
> 
> But why don't the targets in the build file executed
> in the order we specify
> (using depends)... Any ideas?

First Idea: Read the Fine Manual

Second Idea: Depends works just the reverse. Your
compile target depends on init target, which means
that when you invoke compile, init will be called
automatically. And since init depends on nothing when
it is called no other target will be invoked.

Example:

<target name="-init" description="Initializes the
needed properties">
   <property name="..." value="..."/>
   ...

</target>

<target name="compile" depends="-init"
description="Compiles the project">
    <javac ...>
</target>

<target name="-test-init" depends="-init"
description="Initializes the needed for testing
properties">
   <property name="..." value="..."/>
   ...
</target>

<target name="test" depends="-test-init,compile"
description="Performs unit tests">
    <junit...>
</target>

<target name="dist" depends="compile,test"
description="Makes a project distribution">
    <jar ...>
    <war ...>
</target>

Note: targets starting with - cannot be started from
command line. Targets

> 
> Thanks
> Yuva
> 
> -----Original Message-----
> From: Ivan Ivanov
> [mailto:rambiusparkisanius@yahoo.com] 
> Sent: Friday, May 28, 2004 1:47 PM
> To: Ant Users List
> Subject: RE: problem in compiling source code
> 
> Try this 
> ant -buildfile aggregator.xml compile
> --- "Chandolu, Yuva" <YChandolu@arbinet.com> wrote:
> > I am just calling the following from command
> prompt
> > 
> > Ant -buildfile aggregator.xml
> > 
> > Let me know if I need to do any thing else.
> > 
> > Thanks
> > Yuva
> > 
> > -----Original Message-----
> > From: Peter Reilly
> [mailto:peter.reilly@corvil.com] 
> > Sent: Friday, May 28, 2004 8:00 AM
> > To: Ant Users List
> > Subject: Re: problem in compiling source code
> > 
> > You are calling ant compile or ant dist ?
> > 
> > Jusr calling ant will case the default target to
> > run, in
> > this call "init"
> > 
> > Peter
> > 
> > Chandolu, Yuva wrote:
> > 
> > >Sorry, here is the actual build.xml file
> content...
> > >
> >
>
>==============================================================
> > ><project name="Real Time Aggregator"
> default="init"
> > >basedir="c:\javabuilds\cdraggregator">
> > >    <description>
> > >        Ant build file for real-time aggregator
> > >    </description>
> > >
> > >  <!-- set global properties for this build -->
> > >  <property name="build"
> > location="${basedir}\build"/>
> > >  <property name="src" location="${build}\src"/>
> > >  <property name="classes"
> > location="${build}\classes"/>
> > >  <property name="orig_src"
> > location="c:\sourcecode\java\src"/>
> > >  <property name="classpath"
> > >  value="
> > >            ${classes};
> > >            ${basedir}\classes12.zip;
> > >            ${basedir}\activation.jar;
> > >            ${basedir}\mail.jar
> > >           "
> > >  />
> > >
> > >  <target name="init">
> > >
> > >    <!-- Create the build directory structure
> used
> > by compile -->
> > >
> > >    <mkdir dir="${build}"/>
> > >    <mkdir
> > dir="${src}\com\thexchange\realtimeaggregator"/>
> > >    <mkdir dir="${src}\com\thexchange\util"/>
> > >    <mkdir dir="${src}\com\thexchange\utility"/>
> > >    <mkdir dir="${build}\classes"/>
> > >
> > >    <copy
> > todir="${src}\com\thexchange\realtimeaggregator">
> > >    	<fileset
> >
> dir="${orig_src}\com\thexchange\realtimeaggregator">
> > >    		<include name="**\*.java"/>
> > >    	</fileset>
> > >    </copy>
> > >
> > >    <copy todir="${src}\com\thexchange\util">
> > >    	<fileset
> > dir="${orig_src}\com\thexchange\util">
> > >    		<include name="**\*.java"/>
> > >    	</fileset>
> > >    </copy>
> > >
> > >    <copy todir="${src}\com\thexchange\utility">
> > >    	<fileset
> > dir="${orig_src}\com\thexchange\utility">
> > >    		<include name="**\*.java"/>
> > >    	</fileset>
> > >    </copy>
> > >
> > >  </target>
> > >
> > >  <target name="compile" depends="init"
> > description="compile the source " >
> > >    <!-- Compile the java code from ${src} into
> > ${classes} -->
> > >    <echo message="before compile"/>
> > >    <javac srcdir="${src}" destdir="${classes}"
> > classpath="${classpath}">
> > >    	<include name="**\*.java" />
> > >    </javac>
> > >    <echo message="after compile"/>
> > >
> > >  </target>
> > >
> > >  <target name="dist" depends="compile"
> > description="generate the
> > >distribution" >
> > >    <jar jarfile="${build}\cdraggregator.jar"
> > basedir="${classes}"/>
> > >  </target>
> > >
> > >  <target name="clean" depends="dist"
> > description="clean up" >
> > >    <!-- Delete the ${build} directory tree -->
> > >    <delete dir="${src}"/>
> > >    <delete dir="${classes}"/>
> > >  </target>
> > >
> > ></project>
> >
>
>==============================================================
> > >
> > >Thanks
> > >Yuva
> > >
> > >
> > >  
> > >
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/ 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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


Mime
View raw message