ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Burgess <demon.g...@gmail.com>
Subject Re: Newbie question concerning ant javac
Date Fri, 29 May 2009 15:48:08 GMT
On Fri, May 29, 2009 at 10:35 AM, a1slowhand <ron_dump@yahoo.com> wrote:

>
> My company is just now moving to Ant and I have been given the task of
> moving
> it.  I have been able to compile our main source directory, so I know I
> have
> Ant installed and working propertly. We have our based code, and then
> custom
> code underneath that narrows the based code. My problem is how to select
> "certain" source files for the compile.
>
> |TopSrc source dir  <-- based code
> |    main.java
> |    a.java
> |    b.java
> |--|CustomerXX <-- narrowed code
> |--    b.java
> |--|CustomerYY <-- another customer code narrowed
> |--    a.java
> |--    b.java
>
> What I would like to do is after making the changes to CustomerXX\b.java
> compile grabbing TopSrc\main.java  & TopSrc\a.java &
> TopSrc\CustomerXX\b.java, and ensuring that TopSrc\b.java is NOT selected
> to
> advoid a duplicate class error from the compile.  Similar process would
> happen when changing CustomerYY's code.  I only need to compile the
> Customer
> that changed.  The closest that I have come is to compile source directory
> and all sub-directories.  Which Javac complains of duplicate classes when
> it
> compiles one of the sub-directories java apps with the same name as one in
> the root source directory.
>


My first thought here might be to try using a *fileset* to recognize all the
files in the chosen customer directory as the first step.  Once I have those
filenames in hand, I can then use another *fileset* to pick up files in the
top-level dir and exclude filenames that are already found in the customer
dir fileset.  I don't know if this is a valid interpretation of
*fileset*usage, but this is the approach that comes to mind to
research first.

If using the filesets to attempt compiling directly from the source
directories doesn't prove feasible, perhaps an intermediate step of copying
only the source files you want (identified by the filesets) to an
intermediate source directory, and do your compilation against that file
location.   This approach might mean all the intermediate files look like
"changed" files due to being copied, but there are ways to tell the COPY
task to only copy over files that have changed.

Again, this is all me thinking out loud, and not something I've had to
attempt myself.
-- 
CRB

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message