ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Dev environment for multiple Ant-based projects
Date Sat, 08 Jul 2000 02:42:23 GMT
Hi all,

I was wondering, how do most people manage their CLASSPATHs and shell
environment in general when working with multiple Ant-based projects?
I've assumed *nix here, but the question applies to all platforms.

In a standard Ant-based project, you've got:

 - build.(sh|bat) in the project root
 - the code you're working on in src/*
 - the jar files necessary to build in lib/* and perhaps
src/classes/WEB-INF/lib/*

Now to do the usual code-compile-debug cycle, it would seem that you
either have to:

 - keep jumping between your source directory and project root, eg
    $ vi Foo.java
    $ cd ../../../../../
    $ ./build.sh
    $ cd src/WEB-INF/classes/bar/baz

 - or preset your CLASSPATH to include the source root, and stuff in
/lib and WEB-INF/classes/lib, and compile in the source directory.

I suspect most people choose the second option. This breaks the clean
notion of everything going through Ant, and puts the burden of
CLASSPATH maintenance on developers instead of the build system.
Developers can no longer jump between projects without first fixing
their CLASSPATH.

One could of course have a universal CLASSPATH with all possibly
useful jars, but that's a headache to maintain, especially when
different projects need different versions of the same jar.


Anyway, a solution I came up with was to have a .projrc file in each
project root, and to invoke a new shell which uses .projrc. The new
shell provides an environment where project-specific CLASSPATHs,
aliases and whatnot can be set, and cleanly unset when the developer
stops working, or switches to another project.

Currently, the .projrc sets the CLASSPATH, sets $HOME to the project
root, and creates an alias 'cdc' to the working code directory. Most
of the work is done in a global /etc/projrc file. If anyone wants to
play with it, the files are attached.

--Jeff
Mime
View raw message