You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by is...@parc.com on 2002/11/06 00:15:19 UTC

beyond Javac semantics using CompilerAdapter

Looking at the nicely-extensible Javac/CompilerAdapter code,
what's the best way to implement an interface to a compiler 
that has options beyond Javac's?

The eclipse compiler has a host of non-Javac options
(and some remappings of the same options), and the
AspectJ compiler has 3-4 more.  Approaches I garnered:

1 support an "argument" file (prefixed with @, used
  by javac, ajc, and jikes) which contains an arbitrary
  set of args/options.

  a) extract this from the list of unflagged arguments
     --> unable to do this.  Javac.scanDir() controls files
         admitting only *.java.

  b) support a single additional argument -- setArgfile(Path)
     (http://issues.apache.org/bugzilla/show_bug.cgi?id=7542)

2 Use Facade, and implementation-specific arguments
  @see ImplementationSpecificArgument Javac.createCompilerArg()
  ?? but this seems to be limited to the compilers recognized
     by Ant, and would not work for a user-supplied compiler

3 Don't use Javac; write a taskdef directly.
  This is really bad because we'd like users to be able to
  compile using their existing builds by only changing the 
  compiler attribute.

Are there other/better approaches?  best-available sample code?
Advice on picking/executing an approach?

Thanks -
Wes


P.S. - Current taskdef attempts are available at the bottom of
  http://aspectj.org/dl-11

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: beyond Javac semantics using CompilerAdapter

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 5 Nov 2002, <is...@parc.com> wrote:

> 2 Use Facade, and implementation-specific arguments
>   @see ImplementationSpecificArgument Javac.createCompilerArg()
>   ?? but this seems to be limited to the compilers recognized
>      by Ant, and would not work for a user-supplied compiler

No, whatever you'd put into build.compiler or <javac>'s compiler
attribute should work here.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>