| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="robolectric" default="test"> |
| |
| <!-- The build.properties file can be created by you and is never touched |
| by the 'android' tool. This is the place to change some of the default property values |
| used by the Ant rules. |
| Here are some properties you may want to change/update: |
| |
| application.package |
| the name of your application package as defined in the manifest. Used by the |
| 'uninstall' rule. |
| source.dir |
| the name of the source directory. Default is 'src'. |
| out.dir |
| the name of the output directory. Default is 'bin'. |
| |
| Properties related to the SDK location or the project target should be updated |
| using the 'android' tool with the 'update' action. |
| |
| This file is an integral part of the build system for your application and |
| should be checked in in Version Control Systems. |
| |
| --> |
| <property file="build.properties"/> |
| |
| <!-- The default.properties file is created and updated by the 'android' tool, as well |
| as ADT. |
| This file is an integral part of the build system for your application and |
| should be checked in in Version Control Systems. --> |
| <property file="default.properties"/> |
| |
| <exec executable="./find-android.sh" outputproperty="sdk.dir"/> |
| |
| <!-- Custom Android task to deal with the project target, and import the proper rules. |
| This requires ant 1.6.0 or above. --> |
| <path id="android.antlibs"> |
| <pathelement path="${sdk.dir}/tools/lib/anttasks.jar"/> |
| <pathelement path="${sdk.dir}/tools/lib/sdklib.jar"/> |
| <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar"/> |
| <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar"/> |
| <pathelement path="${sdk.dir}/tools/lib/jarutils.jar"/> |
| </path> |
| |
| <path id="android.target.classpath"> |
| <pathelement path="${sdk.dir}/platforms/android-7/android.jar"/> |
| <pathelement path="${sdk.dir}/add-ons/addon_google_apis_google_inc_7/libs/maps.jar"/> |
| </path> |
| |
| <property name="main.absolute.dir" location="${main.dir}"/> |
| <property name="out.main.dir" value="${out.absolute.dir}/mainClasses"/> |
| <property name="out.main.absolute.dir" value="${out.main.dir}"/> |
| <property name="main.external.libs.dir" value="lib/main"/> |
| <property name="main.external.libs.absolute.dir" location="${main.external.libs.dir}"/> |
| |
| <property name="test.absolute.dir" location="${test.dir}"/> |
| <property name="out.test.dir" value="${out.absolute.dir}/testClasses"/> |
| <property name="out.test.absolute.dir" value="${out.test.dir}"/> |
| <property name="publish.dir" location="${out.absolute.dir}/publish"/> |
| |
| <property environment="env"/> |
| <condition property="build.number" value="${env.BUILD_NUMBER}" else="unknown"> |
| <isset property="env.BUILD_NUMBER"/> |
| </condition> |
| |
| <target name="compile" |
| description="compile module source"> |
| <mkdir dir="${out.main.absolute.dir}"/> |
| |
| <javac encoding="ascii" source="1.6" target="1.6" debug="true" extdirs="" |
| destdir="${out.main.absolute.dir}" |
| verbose="${verbose}" classpath="${extensible.classpath}"> |
| <src path="${main.absolute.dir}"/> |
| <classpath> |
| <pathelement path="${out.main.absolute.dir}"/> |
| <path refid="android.target.classpath"/> |
| <fileset dir="${main.external.libs.absolute.dir}" includes="*.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="compile.tests" depends="compile" |
| description="compile module source; test classes" unless="skip.tests"> |
| <mkdir dir="${out.test.absolute.dir}"/> |
| |
| <javac encoding="ascii" source="1.6" target="1.6" debug="true" extdirs="" |
| destdir="${out.test.absolute.dir}" |
| verbose="${verbose}" classpath="${extensible.classpath}"> |
| <src path="${test.absolute.dir}"/> |
| <classpath> |
| <pathelement path="${out.main.absolute.dir}"/> |
| <pathelement path="${out.test.absolute.dir}"/> |
| <path refid="android.target.classpath"/> |
| <fileset dir="${main.external.libs.absolute.dir}" includes="*.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="clean" description="cleanup module"> |
| <delete dir="${out.absolute.dir}"/> |
| <delete dir="${out.test.absolute.dir}"/> |
| </target> |
| |
| <target name="test" depends="compile.tests" description="test all"> |
| <mkdir dir="${basedir}/out/reports/tests"/> |
| <junit showoutput="true"> |
| <formatter type="plain"/> |
| <formatter type="xml"/> |
| <batchtest todir="${basedir}/out/reports/tests"> |
| <fileset dir="${basedir}/test"> |
| <include name="**/*Test.java"/> |
| </fileset> |
| </batchtest> |
| <classpath> |
| <pathelement path="${out.main.absolute.dir}"/> |
| <pathelement path="${out.test.absolute.dir}"/> |
| <fileset dir="${main.external.libs.dir}" includes="*.jar"/> |
| <path refid="android.target.classpath"/> |
| </classpath> |
| </junit> |
| </target> |
| |
| </project> |