When I compile an Android project within Eclipse, it doesn't generate any Ant scripts or anything, so I assume it's using the Eclipse compiler to generate the .class files, and using dx
to translate those into .dex. So that's fine, and I'm aware that the Eclipse compiler is different from javac
and can't be changed.
But when I use android
to generate a build.xml
file, I see that it references other Ant files, and eventually I am able to track down the actual invocation to javac
. So I have a few questions about this.
- I'm an Ant newbie. Does the
<javac>
Ant command correspond to thejavac
referenced by myJAVA_HOME
env variable? Or is it something else? - When you use the 'Export Application' option in Eclipse, does it still use the Eclipse compiler? Will I always be forced to use a different compiler in Ant vs. in Eclipse?
- Can I specify any compiler I want if I alter the
build.xml
file and change the "compile" target?
I don't really care that much what compiler I'm using, I'm just curious. The main thing I'm after is to make sure that I'm using a modern compiler and I can expect all the usual optimizations (e.g. the interning of string literals). Am I correct in assuming this?
P.S. Speaking of optimizations, does dx
do anything more fancy than simply translating one bytecode to another?