ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorgen Thelin <ant-...@sw-technologies.com>
Subject [PATCH] - Allow for easier extensibility of javac task
Date Fri, 03 Mar 2000 23:35:30 GMT

To allow easier customization and extensibility of the javac task for
something I am trying at the moment, I need the ability to provide a
specialised DirectoryScanner and/or file list to support multiple source
code directory roots.  

The attached minor changes allow me to reuse the vast majority of the
javac task through extension, rather than having to use copy-and-paste.
** There is no effect from these change on the existing javac task
behaviour **

Background:

For my app I need to be able to more tightly control the files that are
select, which I can be able to do by overriding the getDirectoryScanner
method to return a specialised scanner, and overriding the scanDir
method to process these file lists accordingly.
The current private visibility modifiers, and explicit call to "super"
rather than "this" prevents my reusing the javac task directly.

However, inclusion of the changes in the central code base will allow me
to customize the compile behaviour to select files from multiple source
directory trees that are not nested (so includes/excludes patterns don't
help here), but which need to be compiled together as a unit.


[BTW, I am implementing a general purpose higher-level build tool for
libraries, not advocating this as a good way to structure your
development source code directories!   -- so no "best practice
lectures", please ;-)
The "multi-root" feature exists in the current implementation, and I am
rewriting the tool to use Ant tasks for the build steps, but I need to
retain backward compatibility with the functionality of the old
implementation :-( ]

Thanks for your consideration of these changes.

- Jorgen



Index: Javac.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/task
defs/Javac.java,v
retrieving revision 1.9
diff -r1.9 Javac.java
100,101c100,101
<     private Vector compileList = new Vector();
<     private Hashtable filecopyList = new Hashtable();
---
>     protected Vector compileList = new Vector();
>     protected Hashtable filecopyList = new Hashtable();
196c196
<         DirectoryScanner ds = super.getDirectoryScanner(srcDir);
---
>         DirectoryScanner ds = this.getDirectoryScanner(srcDir);
255c255
<     private void scanDir(File srcDir, File destDir, String files[]) {
---
>     protected void scanDir(File srcDir, File destDir, String files[])
{




------------------------------------------------------------
| Software Technologies  ----:----  http://www.SwTech.com/ |
| ----------->  One-stop Developer Reference  <----------- |
| Technical reference for professional software developers |
------------------------------------------------------------


Mime
View raw message