diff --git a/WHATSNEW b/WHATSNEW index 5b67ef947..d68a869cd 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -176,6 +176,9 @@ Other changes: * you can now specify the -sourcepath for explicitly. +* now supports a new "listfiles" attribute to list the source + files it's handing off to the compiler. + * The compiler implementation for javac can now be chosen on a task by task basis. Use the new compiler attribute of to override the build.compiler property. diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java index 6c81439e3..2a22f2810 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javac.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java @@ -136,6 +136,7 @@ public class Javac extends MatchingTask { private Vector implementationSpecificArgs = new Vector(); protected boolean failOnError = true; + protected boolean listFiles = false; protected File[] compileList = new File[0]; private String source; @@ -370,6 +371,18 @@ public class Javac extends MatchingTask { return extdirs.createPath(); } + /** + * List the source files being handed off to the compiler + */ + public void setListfiles(boolean list) { + listFiles = list; + } + + /** Get the listfiles flag. */ + public boolean getListfiles() { + return listFiles; + } + /** * Throw a BuildException if compilation fails */ @@ -806,6 +819,14 @@ public class Javac extends MatchingTask { + (compileList.length == 1 ? "" : "s") + (destDir != null ? " to " + destDir : "")); + if (listFiles) { + for (int i=0 ; i < compileList.length ; i++) + { + String filename = compileList[i].getAbsolutePath(); + log(filename) ; + } + } + CompilerAdapter adapter = CompilerAdapterFactory.getCompiler(compilerImpl, this);