Eclipse uses its own compiler. There's an adapter you can use in Ant
(if you really need this level of parity).

org.eclipse.jdt.core.JDTCompilerAdapter


On Feb 9, 7:37 am, Derek Lee <[email protected]> wrote:
> Hi,
>
> I'm using Eclipse GALILEO, android 1.6, and Ant 1.8.0RC1 version.
>
> After building with Eclipse and Ant, I compared each
> generated .class, .dex, .apk files.
> But,each files are not same...
>
> For example,
> There is MethodList.class file(built with Eclipse) in bin folder,
> and MethodList.class file(built with ant) in bin_1.6 folder,
>
> bin/MethodList.class , bin_1.6/MethodList.class are not same...
>
> So, my questions are :
> 1. If each binary files(.class, .dex, .apk files) are not same, they
> can do same thing in each emulator or device?
> 2. (if not) How can i build same binaries using Eclipse & Ant?
>
> My Eclipse build options(Preferences - Java - Compiler) are like
> these:
> - Complier compliance lever : 1.6
> - Use default compliance settings : checked
> - Generated .class files compatibility : 1.6
> - Source compatibility : 1.6
> - Disallow idenfitiers called 'assert' : Error
> - Disallow identifiers called 'enum' : Error
> - Add variable attributes to generate class files : checked
> - Add line number attributes to generate class files : checked
> - Add Source file name to generate class file : checked
> - preserve unused(never read) local vairables : checked
> - inline finally blocks : checked
>
> And my Javac, dex, apk builder option is Build.xml are like these :
> <!-- Compile this project's .java files into .class files. -->
>     <target name="compile" depends="resource-src, aidl">
>         <javac encoding="ascii" target="1.5" debug="true" extdirs=""
>                 destdir="${out-classes}"
>                 bootclasspathref="android.target.classpath">
>             <src path="${source-folder}" />
>             <src path="${gen-folder}" />
>             <classpath>
>                 <fileset dir="${external-libs-folder}"
> includes="*.jar"/>
>                 <pathelement path="${main-out-classes}"/>
>             </classpath>
>          </javac>
>     </target>
>
>  <!-- Convert this project's .class files into .dex files. -->
>     <target name="dex" depends="compile">
>         <echo>Converting compiled files and external libraries into $
> {out-folder}/${dex-file}...</echo>
>         <apply executable="${dx}" failonerror="true" parallel="true">
>             <arg value="--dex" />
>             <arg value="--output=${intermediate-dex-location}" />
>             <arg path="${out-classes-location}" />
>             <fileset dir="${external-libs-folder}" includes="*.jar"/>
>         </apply>
>     </target>
>
> <target name="package">
>         <apkbuilder
>                 outfolder="${out-folder}"
>                 basename="${ant.project.name}"
>                 signed="${sign.package}"
>                 verbose="true">
>             <file path="${intermediate-dex}" />
>             <sourcefolder path="${source-folder}" />
>             <jarfolder path="${external-libs-folder}" />
>             <nativefolder path="${native-libs-folder}" />
>         </apkbuilder>
>     </target>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to