ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Compiling against a shared code area
Date Mon, 03 Jan 2005 13:34:33 GMT
"McIntosh, Stephen" <> writes:

    > Hello.  I'm not quite a newbie user of Ant, but I'm not an expert either.
    > I'm hoping there's a solution to my problem:
    > I would like to have Ant compile a set of java files against two separate
    > source directories, one "local" and one "shared".
    > This can easily be done like this:
    > <javac	srcdir = "${local}:${shared}"
    > 	destdir="${dest}">
    > </javac>
    > except that this solution assumes that the local and shared directories do
    > not have any overlapping files.
    > In my situation, there necessarily will be a lot of overlapping files.
    > The above method leads to a "duplicate class" error.
    > Is there a way for me to make Ant take source files from the shared area
    > unless they exist in the local area, and then take them from the local area
    > instead?

Are you not using source control, at all?  My quess is that you
aren't.  So, my first suggestion is to get a source control management
system and use it.  Ant isn't for solving source control issues, and
the last thing you need ant to do for you is somehow munge your files
as you try to build a home-grown source control/compilation
environment.  If you are using source control, then use it.  All you
are talking about are locally modified versions of files from the
server (server ~~ shared area).  If you need to, learn how to work on
a branch.

But, if you must use ant for something like this?  Make a target which
copies the shared folders to some directory.  Then, make a target
which copies from the local area overwriting your destination
directory with the files that are available locally.  Then, compile
from that source area.  To speed this up, try to get the copy targets
to only copy files that are different from the files coming in.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message