ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hodgetts <...@zzyzxtek.com>
Subject JIndent Task (Javac Preprocessor?)
Date Mon, 27 Nov 2000 00:16:54 GMT
I'm in the process of writing a task that will call the JIndent
formatter tool.

I'd like this task to process any source file that would be
compiled by the Javac task.  In other words, any source file
whose class file is older (out of date).

I haven't yet laid out the XML for the task, but I suspect I'll
need:
   * source directory for .java files
   * reference directory for .class files
   * destination directory for processed .java files
   * includes and excludes
   * fork (with jvm, maxmemory, dir, and timeout [like Junit task?])
   * JIndent parameters (maybe a subset since there's a bunch)

I don't see any way to hook a preprocessor into the Javac task,
so I need a new task.  Is this a correct conclusion?

 From looking at the Javac task, it looks like there are several
utility classes that can help me make the same file list that
needs to be processed that the Javac task would process (e.g.,
DirectoryScanner, SourceFileScanner, GlobPatternMapper, etc.).
Right now, it looks to me like I need to pretty much imitate
the same general code pattern from the Javac task to build the
file list, and then invoke JIndent on the files.  I think I need
to extend MatchingTask to pick up the include and exclude
features, right?

Am I on the right track?  Any advice or suggestions?  Is there
anything else I can look at (docs or sources) that might help?
I'm having a little difficulty following all the behind the
scenes processing of the file list, but maybe I just need more
time staring at the code.

Thanks in advance,
-Paul


Mime
View raw message