ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: porting over my make build process ant
Date Fri, 14 Feb 2003 21:08:51 GMT
It depends what you mean by projects... Many new comers to Ant from a Make
background what to put a build.xml in every directory of the project. Ant
works best by having a single build.xml at the root of the project, which
builds all the Java sources in the src/ or src/java/ directory, outputting
the classes in build/classes, for example. Many Ant task are designed to
recurse directories automatically (like <javac srcdir="src" /> will compile
all .java files in any subdir of src/)

Ant 1.5.1 (last official release) doesn't do inclusion too well (see the FAQ
for XML entity includes), and unless you really have many different projects
to build, you want to learn more about Ant before using it. Write an Ant
build for one project (start with the one which as the least dependencies on
code/classes other than its own), then a second one, then you can start
refactoring them to use XML entity includes (or use Ant CVS HEAD which has a
new <include> task).

Things that would help to guide you would be you directory layout, whether
you have Java sources only, or C/C++/else type of sources, if you generate
code or files as part of the build process (like converting IDL files,
etc...).

I hope this helps, --DD

-----Original Message-----
From: Danny Zapata [mailto:dzapata@bea.com] 
Sent: Friday, February 14, 2003 2:36 PM
To: 'ant-user@jakarta.apache.org'
Subject: porting over my make build process ant

I wanted to port our current build process over to ant and I have been
struggling with a couple of things.

This is the current build process:
For every project, the makefile 1st sources a config file, which contains a
bunch of common variables that are used for the build, then lists some files
to be compiled, then calls a makefile which contains rules common to all
projects.  The reasoning for using a common rules file is that the same
rules don't have to be repeated in every project makefile, the project
makefile only needs to include the rules file.  That way the project
makefile can only contain the files to be built.  The makefiles are included
using the include command within the project makefile.

In trying to implement this in ant, I am generating a properties file which
is to be included in the projects build.xml file.  That will suit my needs
(for now) for the config part.

For the common rules, I tried to include a rules.xml file at the end of the
project build.xml, using 
<ant antfile="${EV_TROOT}\config\rules.xml"/> 

Here is what my original makefile looks like (edited for space):

include ${EV_TROOT}/config/java_config.mk
srcdirs:=${EV_TROOT}/src/idl
idls:= \
	common \
	db \
	AuthenticationService
include $(EV_TROOT)/config/java_rules.mk

This is what the build.xml file looks like now:
<?xml version="1.0"?>

<project name="jclient/corba" default="build" basedir=".">

		<property name="srcdirs" value="${EV_TROOT}\src\idl"/>
		<property name="idls" value="common db blm blm_rule blm_decl
blm_priv blm_subj blm_obj blm_srv LocationService ble pd ms ServerGroup
AuthenticationService"/>


	<target name="build">
		<property file="${EV_TROOT}/config/jconfig.props" />
		<echo message="${ORBIXWEB_HOME} here" />
		<echo message="${EV_TROOT} here" />

		<ant antfile="${EV_TROOT}\config\jrules.xml"/>
	</target>
</project>

So the major problem is that I can't properly include my rules file inside
my project file so I won't have to write any rules in the project file and
be able to reference the rules in jrules.xml inside my projects' build.xml
file.

Any help would be greatly appreciated.

Thanks,
Danny

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

Mime
View raw message