Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 27402 invoked from network); 3 Mar 2000 23:59:01 -0000 Received: from devlynx.com (192.41.51.219) by locus.apache.org with SMTP; 3 Mar 2000 23:59:01 -0000 Received: from sw-tech.demon.co.uk (sw-tech.demon.co.uk [158.152.60.6]) by devlynx.com (8.8.5) id XAA11969; Fri, 3 Mar 2000 23:59:00 GMT Message-ID: Date: Fri, 3 Mar 2000 23:35:30 +0000 To: ant-dev@jakarta.apache.org From: Jorgen Thelin Subject: [PATCH] - Allow for easier extensibility of javac task MIME-Version: 1.0 X-Mailer: Turnpike (32) Version 4.01 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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 | ------------------------------------------------------------