You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by External Lists <ex...@ManagedObjects.com> on 2000/05/09 17:41:55 UTC

Suggestion for Javac

I am soliciting opinions on the following idea:

The javac tag uses the build.compiler property to determine which compiler
to run.  However, if you want to control the debug, optimize and deprecation
options, you need to explicitly choose them in your <javac> task.

I propose a change where, instead of defaulting debug, optimize and
deprecation to false, they instead obtain their initial values from optional
properties named build.compiler.debug, build.compiler.optimize, and
build.compiler.deprecation, and can be overridden by the defined attributes,
if present.  This way, you can build a debug version of your code simply by
running build with -Dbuild.compiler.debug=on, instead of having to
explicitly identify the debug attribute in each javac task.

This seems more orthoginal to how build.compiler is used.

Thanks for any comments.

John


Re: Suggestion for Javac

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "EL" == External Lists <ex...@ManagedObjects.com> writes:

 EL> I propose a change where, instead of defaulting debug, optimize
 EL> and deprecation to false, they instead obtain their initial
 EL> values from optional properties named build.compiler.debug,
 EL> build.compiler.optimize, and build.compiler.deprecation, 

There has been active discussion about the new direction of Ant two
weeks ago. One thing that has been widely agreed on was that
properties and especially "magic" properties should be limited if not
removed at all.

Sam Ruby suggested to add styles for things like this. This way you
specify defaults for all javac-tasks in a style sheet and add a
different set of options for a single javac task with a given ID
attribute ...

I think, Sam's approach is more general than yours and applies to
other tasks as well.

Stefan