ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hughes <leslie.hug...@rubus.com>
Subject RE: Ant newbie
Date Fri, 23 Mar 2001 12:54:18 GMT
Hi,

Compiling only a fixed set of files can be a problem in Java as javac tries
to search out depends for you, and compile them.

To compile files in the src directory to the classes directoty just use the
javac task something like

	<target name="compile">
		<javac srcdir="src" destdir="classes"/>
	</target>

For a list of files I think something like

<target name="compile">
	<javac srcdir="src" destdir="classes" includes="momoAxis.java,
momoColor.java ....."/>
</target>

should work.

But why not group your 'junk/test' code into different packages (say
junktestcode), then you can just excludes="junktestcode/**" This also makes
things easier when running test scripts and/or deploying code as you can get
<junit> to execute tests only in your test package and archive up only
non-test code using <jar>

Hope this helps,

Bye,

Les



> -----Original Message-----
> From: plim [mailto:pengster@i.am]
> Sent: 23 March 2001 01:14
> To: Ant-User@Jakarta. Apache. Org
> Subject: Ant newbie
> 
> 
> Hi I'm a newbie at Ant
> Can somebody give me a hand at setting up my buidfile?
> 
> This is what I have...
> 
> My project root directory is called "root"
> under the root directory I have 2 sub-directories called 
> "src" and "classes"
> I have a fixed set of java files in the src directory...
> momoAxis.java
> momoColor.java
> momoCoord.java
> momoData.java
> momoDate.java
> momoDateAxis.java
> momoDateEntry.java
> momoEntry.java
> momoGUI.java
> momoGraph.java
> momoLine.java
> momoMeter.java
> 
> How can I setup a FileSet or just a property that list all my 
> java files?
> PatternSets will not work for me because I have many 
> test/junk java files in
> the src directory as well. I only want to compile the fixed 
> set of java
> files.
> Something like....
> CLASSES =	momoAxis.class \
> 		momoColor.class \
> 		momoCoord.class \
> 		momoData.class \
> 		etc..
> 
> How can I setup tasks to compile each java file in the src directory
> and put the corresponding class files in the classes directory?
> Also how do I use the depend task to generate dependencies 
> for each class
> file?
> Something like...
> .SUFFIXES: .java .class
> .java.class: $(DEPENDENCIES)
> 	$(COMPILER) $(COPTIONS) -classpath "$(CLASSPATH)"  $?
> 
> 
> Thanks very much
> pengster
> 
> 

Mime
View raw message