[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Building non-debuggable plugins with Ant - global setting?

Eric,

Some background.  The Ant <javac> task is actually a wrapper if you will.
Under the covers a "compiler adapter" is created.  This adapter "adapts" the
standard <javac> args to a particular compiler's command line etc.  In the
case of PDE core, we are keen on our own compiler and so wrote a JDT
compiler adapter.  The net result of that being the JDT compiler is used to
run the <javac> tasks.   This is specified in the template.xml as follows:

<target name="init">
    <property name="build.compiler"
value="org.eclipse.pde.internal.core.JDTCompilerAdapter"/>
</target>

You can change this if you like but that would be an untested configuration
and we likely would not be able to help much.

I poked around a bit and found that this adapter is hardcoded to turn
debugging on.  sigh.  Look in setupJavacCommand() towards the end for :
    cmd.createArgument().setValue("-g");

Notice also that further up it correctly checks the debug flag and only
adds -g to the command line if it was set.

As for optimization, I'm not sure.  It may well be that debug and
optimization are mutually exclusive.  If you have a minute, perhaps remove
the line above from the compiler adapter and see if things work for you.
Let me know.

Thanks

Jeff

"Eric Simpson" <esimpson@xxxxxxxxxx> wrote in message
news:3B9D31DB.FE54D84F@xxxxxxxxxxxxx
>
> When I build my component using Ant the class files are the same as
> those generated in the PDE which, to me, means that they are debuggable
> by default.  How can I specify in my component build that I want
> non-debuggable?
>
> The "javac" task will check for the "debug" and "optimize" attributes
> but I think this is on the actual task which is specified in the PDE's
> template.xml.  Setting a "debug" property to "off" and "optimize" to
> "on" in my component's build script did not cause any change.
>
> How is this done in regular Ant projects?
>
> Thanks,
> Eric
>