Two paths are used for compilation, used as -compile as classpathref, but one of them is not used in dexing.
<target name="-compile" depends="-build-setup, -pre-build, -code-gen, -pre-compile"> <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping..."> <path id="project.javac.classpath"> <path refid="project.all.jars.path" /> <path refid="tested.project.classpath" /> </path> <javac encoding="${java.encoding}" source="${java.source}" target="${java.target}" debug="true" extdirs="" includeantruntime="false" destdir="${out.classes.absolute.dir}" bootclasspathref="project.target.class.path" verbose="${verbose}" classpathref="project.javac.classpath" fork="${need.javac.fork}"> <src path="${source.absolute.dir}" /> <src path="${gen.absolute.dir}" /> <compilerarg line="${java.compilerargs}" /> </javac> β¦ </target>
These paths are "project.all.jars.path" and "test.project.classpath", but the path "test.project.classpath" is not used in dexing, so you can change it in a pre-compile target, for example this:
<target name="-pre-compile" > <path id="tmp"> <pathelement path="${toString:tested.project.classpath}"/> <fileset dir="${exported.jars.dir}" > <include name="*.jar" /> </fileset> </path> <path id="tested.project.classpath"><pathelement path="${toString:tmp}"/></path> <path id="tmp"/> </target>
Here you add the path to the exported jars to "test.project.classpath" before starting the compilation. You can put "exported.jars.dir" in your ant.properties file.
source share