Yeah, that's why I'm hoping someone who's more an Ant expert has a way of
changing the environment to dynamically add the ECJ JAR. We

I don't pretend to be an ant guru but I think the following solution
should work:

<!-- set up ecj -->
<property name="ecj.jar"
         value="C:\<valid path to ecj>\ecj_3.2.jar"/>
<property name="ecj.batch.class"
         value="org.eclipse.jdt.internal.compiler.batch.Main"/>
<tempfile property="javac.batch" suffix=".bat" destdir="build"/>

<condition property="javac.script.content"
          value="%JAVA_HOME%\bin\java -cp ${ecj.jar} ${ecj.batch.class} %*">
   <os family="Windows"/>
</condition>
<condition property="javac.script.content"
          value="-- unix stuff goes here --">
   <os family="unix"/>
</condition>


<!-- Compile! -->
<echo message="${javac.script.content}" file="${javac.batch}"/>
<javac destdir="${build.output}"
      ... [blah blah blah] ...
      fork="yes"
      executable="${javac.batch}"                     
      includeAntRuntime="no">


Let's call it "temporary batch file solution".

Regards,

2006/9/11, Nathan Beyer <[EMAIL PROTECTED]>:


> -----Original Message-----
> From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]
>
> Nathan Beyer wrote:
> > I've done some tweaking to the build scripts around compiler usage and
> > wanted to run it by the list for comments, etc.
> >
> >
> >
> > *   I've removed the "-showversion" JVM argument from the module build
> > scripts that were using it when executing the tests. The launcher
> behavior
> > changed a bit here, so this isn't working with the IBM VME yet. This can
> be
> > added back later. Note: this wasn't consistently being used in all
> scripts
> > prior to this change.
> >
>
> right - I don't think it's much of a loss to not have it, but we'll put
> it back as soon as we can.
> >
> >
> > *   Following the lead of other 'javac' properties configured in the
> > /make/properties.xml file, I've added a 'hy.javac.compiler' property
> that is
> > used by the scripts to set the 'compiler' property on 'javac' tasks.
> > Currently, this is just set to 'modern' to maintain the previous
> behavior.
>
> Why didn't you make it "hy.jc.cr"?  Seriously.  Would it have killed you
> to put in the "armon"?

Personally, I would prefer that, but in this case I was just trying to be
consistent. All of the other javac properties are prefixed with
"hy.javac.XXX".

>
>
> [SNIP]
> >
> > The other big reason to do this is to attempt to use the Eclipse (ECJ)
> > compiler for the build. I've tested using the ECJ by setting the new
> > property and the build and tests work as normal, but I haven't found a
> way
> > to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
> > folder. As such, I've left the compiler property at 'modern' for now.
>
> Ugh.  I thought it was working before w/o having to put it in ant/lib,
> although i don't remember the reason why we took it away.

I don't think it was ever working with the Eclipse compiler before, was it?

> >
> >
> >
> > I'd like to permanently set the compiler property to use the ECJ v3.2,
> but
> > this will seemingly "break the build" if Ant isn't setup properly. Does
> > anyone have any objections to using ECJ as the standard compiler? Since
> > Harmony will use this as it's 'javac', I believe it would be proper for
> > Harmony to be built with the same compiler.
>
> That's fine, but I think we should solve the problem of where ECJ should
> be.  Having to dork w/ ant itself seems wrong.

Yeah, that's why I'm hoping someone who's more an Ant expert has a way of
changing the environment to dynamically add the ECJ JAR. We use 'ant' tasks
from the top build script to call the dependant scripts, but I haven't found
any documentation or examples that change Ant's classpath this way.

>
> >
> >
> >
> > Does anyone know of any means of "dynamically" setting up Ant with ECJ?
> One
> > thought I had was an extension to 'fetch-depends' that copies ECJ to
> > ANT_HOME\lib for builders. I'm not sure if that would be considered
> > desirable behavior.
>
> No - I don't think we should alter peoples working environments like that.
>
> Can we make it automatic for now?  if it detects ECJ it uses it,
> otherwise uses Sun?  (But then we still have the problem with the latest
> Sun compiler, don't we...)
>
> geir
>
> >
> >
> >
> > -Nathan

--
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to