ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Inger, Matthew" <In...@Synygy.com>
Subject RE: APT processor
Date Mon, 19 Jul 2004 13:58:05 GMT
Having looked at the Javac task, I'm not so sure that refactoring it right
now is a good idea, as it would involve possibly redefining the
CompilerAdapter
class, and thus affecting all existing compiler adapters.

-----Original Message-----
From: Inger, Matthew [mailto:Inger@Synygy.com]
Sent: Monday, July 19, 2004 9:43 AM
To: 'Ant Users List'
Subject: RE: APT processor


It's possible.  The reason I extended Javac was that Apt has all of the same
command line flags and parameters, and adds a few of it's own to boot.
What i did was to ignore to the compiler attribute:

public Apt() {
   super.setCompiler(AptCompilerAdapter.class.getName());
}

public void setCompiler(String compiler) {
   log("Ignoring compiler attribute for the APT task, as it is fixed",
       Project.MSG_WARN);
}

public void setFork(boolean fork) {
   if (fork)
      super.setCompiler(AptExternalCompilerAdapter.class.getName());
   else
      super.setCompiler(AptCompilerAdapter.class.getName());
}

public void execute() throws BuildException {
   if (! JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)) {
       throw new BuildException("Apt task requires Java 1.5+");
   }
   super.execute();
}

I will attach the diffs as is to the enhancement request I have
already created.  I'll look into the refactoring if you feel it's
necessary.

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: Monday, July 19, 2004 9:40 AM
To: 'Ant Users List'
Subject: RE: APT processor


> From: Inger, Matthew [mailto:Inger@Synygy.com]
> 
> I've created a task for running the APT processor.  It extends the
> existing javac task, and adds on a few additional attributes which are
> specific to APT. Shall I post the source code changes?

Of course ;-) I think it will take a little time before people wrap their
heads around APT and put it to good use, but I guess so far with JDK 1.5
still being in beta, only a few bleeding edge developers are toying with it.

Please open a BugZilla enhancement, and post there.

Note though that Javac may not be the best candidate to extend, with its
extra Compiler Adapter complexity? Maybe we need an abstract JdkTool base
class? --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message