Lines Matching +full:project +full:- +full:level
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="android_rules" default="debug">
4 <!--
5 This build file is imported by the project build file. It contains
14 - custom task definitions,
15 - more properties (do not override those unless the whole build system is modified).
16 - macros used throughout the build,
17 - base build targets,
18 - debug-specific build targets,
19 - release-specific build targets,
20 - instrument-specific build targets,
21 - test project-specific build targets,
22 - install targets,
23 - help target
24 -->
26 <!-- ******************************************************* -->
27 <!-- **************** Overridable Properties *************** -->
28 <!-- ******************************************************* -->
30 <!-- You can override these values in your build.xml or ant.properties.
31 Overriding any other properties may result in broken build. -->
33 <!-- Tells adb which device to target. You can change this from the command line
34 by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=-e" for
35 the emulator. -->
38 <!-- fileset exclude patterns (space separated) to prevent
39 files inside src/ from being packaged. -->
42 <!-- set some properties used for filtering/override. If those weren't defined
44 by the custom tasks receiving them. -->
48 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res and /assets.
52 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patterns...
54 - The first character flag ! avoids printing a warning.
55 - Pattern can have the flag "<dir>" to match only directories
57 - Match is not case-sensitive.
58 -->
61 <!-- dex force jumbo options, to be used when dex merging fails with
62 …UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.DexException: Cannot handle conversion to jumb…
65 -->
69 <!-- compilation options -->
70 <property name="java.encoding" value="UTF-8" />
76 <!-- Renderscript options -->
77 <property name="renderscript.debug.opt.level" value="O0" />
78 <property name="renderscript.release.opt.level" value="O3" />
81 <!-- manifest merger default value -->
84 <!-- instrumentation options -->
87 <!-- Verbosity -->
90 <!-- Output location of the HTML report for the "lint" target.
92 value="${out.dir}/lint-results.html"
95 -->
96 <property name="lint.out.html" value="bin/lint-results.html" />
98 <!-- Output location of the XML report for the "lint" target -->
99 <property name="lint.out.xml" value="bin/lint-results.xml" />
101 <!-- ******************************************************* -->
102 <!-- ********************* Custom Tasks ******************** -->
103 <!-- ******************************************************* -->
105 <!-- jar file from where the tasks are loaded -->
107 <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
110 <!-- Custom tasks -->
113 <!-- Emma configuration -->
120 <!-- End of emma configuration -->
123 <!-- ******************************************************* -->
124 <!-- ******************* Other Properties ****************** -->
125 <!-- ******************************************************* -->
126 <!-- overriding these properties may break the build
127 unless the whole file is updated -->
129 <!-- Input directories -->
143 <!-- Output directories -->
154 <!-- tools location -->
156 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tools" />
162 <!-- Intermediate files -->
165 <property name="resource.package.file.name" value="${ant.project.name}.ap_" />
167 <!-- Build property file -->
171 <!-- This is needed by emma as it uses multilevel verbosity instead of simple 'true' or 'false'
173 value.-->
178 <!-- properties for signing in release mode -->
194 <!-- properties for packaging -->
197 <!-- whether we need to fork javac.
198 This is only needed on Windows when running Java < 7 -->
208 <!-- ******************************************************* -->
209 <!-- ************************ Macros *********************** -->
210 <!-- ******************************************************* -->
212 <!-- macro to do a task on if project.is.library is false.
213 elseText attribute is displayed otherwise -->
214 <macrodef name="do-only-if-not-library">
216 <element name="task-to-do" implicit="yes" />
218 <if condition="${project.is.library}">
220 <task-to-do />
223 <echo level="info">@{elseText}</echo>
229 <!-- macro to do a task on if manifest.hasCode is true.
230 elseText attribute is displayed otherwise -->
231 <macrodef name="do-only-if-manifest-hasCode">
233 <element name="task-to-do" implicit="yes" />
237 <task-to-do />
245 <echo level="info">@{elseText}</echo>
254 <!-- Configurable macro, which allows to pass as parameters output directory,
255 output dex filename and external libraries to dex (optional) -->
256 <macrodef name="dex-helper">
257 <element name="external-libs" optional="yes" />
260 <!-- sets the primary input for dex. If a pre-dex task sets it to
261 something else this has no effect -->
264 <!-- set the secondary dx input: the project (and library) jar files
265 If a pre-dex task sets it to something else this has no effect -->
272 <path refid="project.all.jars.path" />
286 <external-libs />
291 <!-- This is macro that enable passing variable list of external jar files to ApkBuilder
293 <package-helper>
294 <extra-jars>
298 </extra-jars>
299 </package-helper> -->
300 <macrodef name="package-helper">
301 <element name="extra-jars" optional="yes" />
315 <jarfile refid="project.all.jars.path" />
317 <nativefolder refid="project.library.native.folder.path" />
318 <nativefolder refid="project.rs.support.libs.path" />
320 <extra-jars/>
325 <!-- This is macro which zipaligns in.package and outputs it to out.package. Used by targets
326 debug, -debug-with-emma and release.-->
327 <macrodef name="zipalign-helper">
339 <macrodef name="run-tests-helper">
341 <element name="extra-instrument-args" optional="yes" />
343 <echo level="info">Running tests ...</echo>
349 <arg value="-w" />
350 <arg value="-e" />
353 <extra-instrument-args />
354 <arg value="${project.app.package}/${test.runner}" />
359 <macrodef name="record-build-key">
369 <macrodef name="record-build-info">
371 <record-build-key key="build.last.target" value="${build.target}" />
372 <record-build-key key="build.last.is.instrumented" value="${build.is.instrumented}" />
373 … <record-build-key key="build.last.is.packaging.debug" value="${build.is.packaging.debug}" />
374 <record-build-key key="build.last.is.signing.debug" value="${build.is.signing.debug}" />
378 <macrodef name="uninstall-helper">
381 … <echo level="info">Uninstalling @{app.package} from the default emulator or device...</echo>
390 <!-- ******************************************************* -->
391 <!-- ******************** Build Targets ******************** -->
392 <!-- ******************************************************* -->
394 <!-- Basic Ant + SDK check -->
395 <target name="-check-env">
399 <!-- target to disable building dependencies -->
404 <!-- generic setup -->
405 <target name="-setup" depends="-check-env">
406 <echo level="info">Project Name: ${ant.project.name}</echo>
407 <gettype projectTypeOut="project.type" />
409 <!-- sets a few boolean based on project.type
410 to make the if task easier -->
411 <condition property="project.is.library" value="true" else="false">
412 <equals arg1="${project.type}" arg2="library" />
414 <condition property="project.is.test" value="true" else="false">
415 <equals arg1="${project.type}" arg2="test" />
417 <condition property="project.is.testapp" value="true" else="false">
418 <equals arg1="${project.type}" arg2="test-app" />
421 <!-- If a test project, resolve absolute path to tested project. -->
422 <if condition="${project.is.test}">
424 <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
428 <!-- get the project manifest package -->
430 expression="/manifest/@package" output="project.app.package" />
434 <!-- empty default pre-clean target. Create a similar target in
435 your build.xml and it'll be called instead of this one. -->
436 <target name="-pre-clean"/>
438 <!-- clean target -->
439 <target name="clean" depends="-setup, -pre-clean"
444 <!-- if we know about a tested project or libraries, we clean them too. -->
445 <if condition="${project.is.test}">
447 <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
449 <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
455 <!-- get all the libraries -->
459 <getlibpath libraryFolderPathOut="project.library.folder.path" />
462 <isreference refid="project.library.folder.path" />
465 <!-- clean the libraries with nodeps since we already
466 know about all the libraries even the indirect one -->
468 buildpathref="project.library.folder.path"
480 <!-- Pre build setup -->
481 <target name="-build-setup" depends="-setup">
482 <!-- find location of build tools -->
485 <!-- read the previous build mode -->
487 <!-- if empty the props won't be set, meaning it's a new build.
488 To force a build, set the prop to empty values. -->
494 <!-- If the "debug" build type changed, clear out the compiled code.
496 as javac can't deal with this type of change in its dependency computation. -->
507 …<echo level="info">Switching between debug and non debug build: Deleting previous compilation outp…
511 <!-- Else, we may still need to clean the code, for another reason.
513 instrumented but not this one, clear out the compiled code -->
522 …<echo level="info">Switching from instrumented to non-instrumented build: Deleting previous compil…
529 <echo level="info">Resolving Build Target for ${ant.project.name}...</echo>
530 <!-- load project properties, resolve Android target, library dependencies
532 All property names are passed as parameters ending in -Out -->
534 androidJarFileOut="project.target.android.jar"
535 androidAidlFileOut="project.target.framework.aidl"
536 bootClassPathOut="project.target.class.path"
537 targetApiOut="project.target.apilevel"
538 minSdkVersionOut="project.minSdkVersion" />
540 <!-- Value of the hasCode attribute (Application node) extracted from manifest file -->
544 <echo level="info">----------</echo>
545 <echo level="info">Creating output directories if needed...</echo>
552 <do-only-if-manifest-hasCode>
556 </do-only-if-manifest-hasCode>
558 <echo level="info">----------</echo>
559 <echo level="info">Resolving Dependencies for ${ant.project.name}...</echo>
561 libraryFolderPathOut="project.library.folder.path"
562 libraryPackagesOut="project.library.packages"
563 libraryManifestFilePathOut="project.library.manifest.file.path"
564 libraryResFolderPathOut="project.library.res.folder.path"
565 libraryBinAidlFolderPathOut="project.library.bin.aidl.folder.path"
566 libraryRFilePathOut="project.library.bin.r.file.path"
567 libraryNativeFolderPathOut="project.library.native.folder.path"
568 jarLibraryPathOut="project.all.jars.path"
569 targetApi="${project.target.apilevel}"
572 renderscriptSupportLibsOut="project.rs.support.libs.path"
575 <!-- compile the libraries if any -->
579 <isreference refid="project.library.folder.path" />
584 <!-- figure out which target must be used to build the library projects.
585 If emma is enabled, then use 'instrument' otherwise, use 'debug' -->
586 … <condition property="project.libraries.target" value="instrument" else="${build.target}">
590 <echo level="info">----------</echo>
591 <echo level="info">Building Libraries with '${project.libraries.target}'...</echo>
593 <!-- no need to build the deps as we have already
594 the full list of libraries -->
596 buildpathref="project.library.folder.path"
599 <target name="${project.libraries.target}" />
605 <!-- compile the main project if this is a test project -->
606 <if condition="${project.is.test}">
608 <!-- figure out which target must be used to build the tested project.
609 If emma is enabled, then use 'instrument' otherwise, use 'debug' -->
610 <condition property="tested.project.target" value="instrument" else="debug">
614 <echo level="info">----------</echo>
615 …<echo level="info">Building tested project at ${tested.project.absolute.dir} with '${tested.projec…
616 <subant target="${tested.project.target}" failonerror="true">
617 <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
620 <!-- get the tested project full classpath to be able to build
621 the test project -->
623 projectLocation="${tested.project.absolute.dir}"
624 projectClassPathOut="tested.project.classpath"/>
627 <!-- no tested project, make an empty Path object so that javac doesn't
628 complain -->
629 <path id="tested.project.classpath" />
634 <!-- empty default pre-build target. Create a similar target in
635 your build.xml and it'll be called instead of this one. -->
636 <target name="-pre-build"/>
638 <!-- Code Generation: compile resources (aapt -> R.java), aidl, renderscript -->
639 <target name="-code-gen">
640 <!-- always merge manifest -->
645 <library refid="project.library.manifest.file.path" />
648 <do-only-if-manifest-hasCode
650 <echo level="info">Handling aidl files...</echo>
652 framework="${project.target.framework.aidl}"
653 libraryBinAidlFolderPathRefid="project.library.bin.aidl.folder.path"
659 <!-- renderscript generates resources so it must be called before aapt -->
660 <echo level="info">----------</echo>
661 <echo level="info">Handling RenderScript files...</echo>
662 <!-- set the rs target prop in case it hasn't been set. -->
663 <property name="renderscript.target" value="${project.minSdkVersion}" />
671 optLevel="${renderscript.opt.level}"
679 <echo level="info">----------</echo>
680 <echo level="info">Handling Resources...</echo>
685 originalManifestPackage="${project.app.package}"
686 androidjar="${project.target.android.jar}"
689 libraryResFolderPathRefid="project.library.res.folder.path"
690 libraryPackagesRefid="project.library.packages"
691 libraryRFileRefid="project.library.bin.r.file.path"
699 <echo level="info">----------</echo>
700 <echo level="info">Handling BuildConfig class...</echo>
703 package="${project.app.package}"
707 </do-only-if-manifest-hasCode>
710 <!-- empty default pre-compile target. Create a similar target in
711 your build.xml and it'll be called instead of this one. -->
712 <target name="-pre-compile"/>
714 <!-- Compiles this project's .java files into .class files. -->
715 <target name="-compile" depends="-pre-build, -build-setup, -code-gen, -pre-compile">
716 <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
717 <!-- merge the project's own classpath and the tested project's classpath -->
718 <path id="project.javac.classpath">
719 <path refid="project.all.jars.path" />
720 <path refid="tested.project.classpath" />
727 bootclasspathref="project.target.class.path"
729 classpathref="project.javac.classpath"
736 <!-- if the project is instrumented, intrument the classes -->
739 … <echo level="info">Instrumenting classes from ${out.absolute.dir}/classes...</echo>
741 <!-- build the filter to remove R, Manifest, BuildConfig -->
743 appPackage="${project.app.package}"
744 libraryPackagesRefId="project.library.packages"
747 <!-- define where the .em file is going. This may have been
748 setup already if this is a library -->
751 <!-- It only instruments class files, not any external libs -->
765 <!-- if the project is a library then we generate a jar file -->
766 <if condition="${project.is.library}">
768 <echo level="info">Creating library output jar file...</echo>
775 … <echo level="info">Custom jar packaging exclusion: ${android.package.excludes}</echo>
779 …<propertybyreplace name="project.app.package.path" input="${project.app.package}" replace="." with…
784 …excludes="${project.app.package.path}/R.class ${project.app.package.path}/R$*.class ${project.app.…
790 </do-only-if-manifest-hasCode>
793 <!-- empty default post-compile target. Create a similar target in
794 your build.xml and it'll be called instead of this one. -->
795 <target name="-post-compile"/>
797 <!-- Obfuscate target
803 -release-obfuscation-check
805 -debug-obfuscation-check
807 -obfuscate
808 check if the property set in -debug/release-obfuscation-check is set to true.
812 -->
813 <target name="-obfuscate">
819 <!-- input for dex will be proguard's output -->
822 <!-- Add Proguard Tasks -->
826 <!-- Set the android classpath Path object into a single property. It'll be
827 all the jar files separated by a platform path-separator.
829 -->
830 … <pathconvert property="project.target.classpath.value" refid="project.target.class.path">
837 <!-- Build a path object with all the jar files that must be obfuscated.
838 This include the project compiled source code and any 3rd party jar
839 files. -->
840 <path id="project.all.classes.path">
842 <path refid="project.all.jars.path" />
844 <!-- Set the project jar files Path object into a single property. It'll be
845 all the jar files separated by a platform path-separator.
847 -->
848 <pathconvert property="project.all.classes.value" refid="project.all.classes.path">
855 <!-- Turn the path property ${proguard.config} from an A:B:C property
856 into a series of includes: -include A -include B -include C
857 suitable for processing by the ProGuard task. Note - this does
858 not include the leading '-include "' or the closing '"'; those
860 -->
864 … <pathconvert pathsep='" -include "' property="proguard.configcmd" refid="proguard.configpath"/>
872 -include "${proguard.configcmd}"
873 -include "${out.absolute.dir}/proguard.txt"
874 -injars ${project.all.classes.value}
875 -outjars "${obfuscated.jar.file}"
876 -libraryjars ${project.target.classpath.value}
877 -dump "${obfuscate.absolute.dir}/dump.txt"
878 -printseeds "${obfuscate.absolute.dir}/seeds.txt"
879 -printusage "${obfuscate.absolute.dir}/usage.txt"
880 -printmapping "${obfuscate.absolute.dir}/mapping.txt"
886 <!-- Converts this project's .class files into .dex files -->
887 <target name="-dex" depends="-compile, -post-compile, -obfuscate">
888 <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
889 <!-- only convert to dalvik bytecode is *not* a library -->
890 <do-only-if-not-library elseText="Library project: do not convert bytecode..." >
891 <!-- special case for instrumented builds: need to use no-locals and need
892 to pass in the emma jar. -->
895 <dex-helper nolocals="true">
896 <external-libs>
898 </external-libs>
899 </dex-helper>
902 <dex-helper />
905 </do-only-if-not-library>
906 </do-only-if-manifest-hasCode>
909 <!-- Updates the pre-processed PNG cache -->
910 <target name="-crunch">
913 <arg value="-v" />
914 <arg value="-S" />
916 <arg value="-C" />
921 <!-- Puts the project's resources into the output package file
925 -->
926 <target name="-package-resources" depends="-crunch">
927 <!-- only package resources if *not* a library project -->
928 <do-only-if-not-library elseText="Library project: do not package resources..." >
936 androidjar="${project.target.android.jar}"
941 libraryResFolderPathRefid="project.library.res.folder.path"
942 libraryPackagesRefid="project.library.packages"
943 libraryRFileRefid="project.library.bin.r.file.path"
949 <!-- <nocompress /> forces no compression on any files in assets or res/raw -->
950 …<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets an…
952 </do-only-if-not-library>
955 <!-- Packages the application. -->
956 <target name="-package" depends="-dex, -package-resources">
957 <!-- only package apk if *not* a library project -->
958 <do-only-if-not-library elseText="Library project: do not package apk..." >
961 <package-helper>
962 <extra-jars>
963 <!-- Injected from external file -->
965 </extra-jars>
966 </package-helper>
969 <package-helper />
972 </do-only-if-not-library>
975 <target name="-post-package" />
976 <target name="-post-build" />
978 <target name="-set-mode-check">
983 <!-- ******************************************************* -->
984 <!-- **************** Debug specific targets *************** -->
985 <!-- ******************************************************* -->
987 <target name="-set-debug-files" depends="-set-mode-check">
989 …<property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-debug-unalign…
990 … <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-debug.apk" />
995 <target name="-set-debug-mode" depends="-setup">
996 <!-- record the current build target -->
1002 <istrue value="${project.is.testapp}" />
1014 <!-- whether the build is a debug build. always set. -->
1017 <!-- signing mode: debug -->
1020 <!-- Renderscript optimization level: none -->
1021 <property name="renderscript.opt.level" value="${renderscript.debug.opt.level}" />
1025 <target name="-debug-obfuscation-check">
1026 <!-- proguard is never enabled in debug mode -->
1030 <!-- Builds debug output package -->
1031 …<target name="-do-debug" depends="-set-debug-mode, -debug-obfuscation-check, -package, -post-packa…
1032 <!-- only create apk if *not* a library project -->
1033 <do-only-if-not-library elseText="Library project: do not create apk..." >
1035 … <zipalign-helper in.package="${out.packaged.file}" out.package="${out.final.file}" />
1036 <echo level="info">Debug Package: ${out.final.file}</echo>
1038 </do-only-if-not-library>
1039 <record-build-info />
1042 <!-- Builds debug output package -->
1043 <target name="debug" depends="-set-debug-files, -do-debug, -post-build"
1048 <!-- ******************************************************* -->
1049 <!-- *************** Release specific targets ************** -->
1050 <!-- ******************************************************* -->
1052 <!-- called through target 'release'. Only executed if the keystore and
1053 key alias are known but not their password. -->
1054 <target name="-release-prompt-for-password" if="has.keystore" unless="has.password">
1055 <!-- Gets passwords -->
1064 <!-- called through target 'release'. Only executed if there's no
1065 keystore/key alias set -->
1066 <target name="-release-nosign" unless="has.keystore">
1067 <!-- no release builds for library project -->
1068 <do-only-if-not-library elseText="" >
1070 … <echo level="info">No key.store and key.alias properties found in build.properties.</echo>
1071 <echo level="info">Please sign ${out.packaged.file} manually</echo>
1072 <echo level="info">and run zipalign from the Android SDK tools.</echo>
1074 </do-only-if-not-library>
1075 <record-build-info />
1078 <target name="-release-obfuscation-check">
1079 <echo level="info">proguard.config is ${proguard.config}</echo>
1088 <echo level="info">Proguard.config is enabled</echo>
1089 <!-- Secondary dx input (jar files) is empty since all the
1090 jar files will be in the obfuscated jar -->
1096 <target name="-set-release-mode" depends="-set-mode-check">
1097 …rty name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-release-unsigned.ap…
1098 … <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-release.apk" />
1101 <!-- record the current build target -->
1106 <!-- release mode is only valid if the manifest does not explicitly
1107 set debuggable to true. default is false. -->
1111 <!-- signing mode: release -->
1114 <!-- Renderscript optimization level: aggressive -->
1115 <property name="renderscript.opt.level" value="${renderscript.release.opt.level}" />
1125 <!-- property only set in release mode.
1127 when using Ant before 1.8 -->
1133 <target name="-release-sign" if="has.keystore" >
1134 <!-- only create apk if *not* a library project -->
1135 <do-only-if-not-library elseText="Library project: do not create apk..." >
1137 …ty name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}-release-unaligned.a…
1139 <!-- Signs the APK -->
1140 <echo level="info">Signing final apk...</echo>
1149 <!-- Zip aligns the APK -->
1150 <zipalign-helper
1153 <echo level="info">Release Package: ${out.final.file}</echo>
1155 </do-only-if-not-library>
1156 <record-build-info />
1159 <!-- This runs -package-release and -release-nosign first and then runs
1160 only if release-sign is true (set in -release-check,
1161 called by -release-no-sign)-->
1163 …ends="-set-release-mode, -release-obfuscation-check, -package, -post-package, -release-prompt-for-…
1167 <!-- ******************************************************* -->
1168 <!-- ************ Instrumented specific targets ************ -->
1169 <!-- ******************************************************* -->
1171 <!-- These targets are specific for the project under test when it
1173 support emma code coverage -->
1175 <target name="-set-instrumented-mode" depends="-set-mode-check">
1176 …y name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-instrumented-unaligne…
1177 …<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-instrumented.apk…
1180 <!-- whether the build is an instrumented build. -->
1184 <!-- Builds instrumented output package -->
1185 <target name="instrument" depends="-set-instrumented-mode, -do-debug"
1187 <!-- only create apk if *not* a library project -->
1188 <do-only-if-not-library elseText="Library project: do not create apk..." >
1190 … <zipalign-helper in.package="${out.packaged.file}" out.package="${out.final.file}" />
1191 <echo level="info">Instrumented Package: ${out.final.file}</echo>
1193 </do-only-if-not-library>
1194 <record-build-info />
1197 <!-- ******************************************************* -->
1198 <!-- ************ Test project specific targets ************ -->
1199 <!-- ******************************************************* -->
1201 <!-- enable code coverage -->
1206 <!-- fails if the project is not a test project -->
1207 <target name="-test-project-check" depends="-setup">
1211 <isfalse value="${project.is.test}" />
1212 <isfalse value="${project.is.testapp}" />
1216 <fail message="Project is not a test project." />
1221 <target name="test" depends="-test-project-check"
1225 <if condition="${project.is.test}">
1227 <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
1229 <!-- Application package of the tested project extracted from its manifest file -->
1230 <xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
1231 expression="/manifest/@package" output="tested.project.app.package" />
1235 <getprojectpaths projectPath="${tested.project.absolute.dir}"
1236 binOut="tested.project.out.absolute.dir"
1237 srcOut="tested.project.source.absolute.dir" />
1239 <getlibpath projectPath="${tested.project.absolute.dir}"
1240 libraryFolderPathOut="tested.project.lib.source.path"
1248 <!-- this is a test app, the tested package is the app's own package -->
1249 <property name="tested.project.app.package" value="${project.app.package}" />
1253 <property name="tested.project.out.absolute.dir" value="${out.absolute.dir}" />
1254 … <property name="tested.project.source.absolute.dir" value="${source.absolute.dir}" />
1257 libraryFolderPathOut="tested.project.lib.source.path"
1267 value="/data/data/${tested.project.app.package}/coverage.ec" />
1272 <run-tests-helper emma.enabled="true">
1273 <extra-instrument-args>
1274 <arg value="-e" />
1277 </extra-instrument-args>
1278 </run-tests-helper>
1280 <echo level="info">Setting permission to download the coverage file...</echo>
1284 <arg value="run-as" />
1285 <arg value="${tested.project.app.package}" />
1290 <echo level="info">Downloading coverage file into project directory...</echo>
1298 …<pathconvert property="tested.project.lib.source.path.value" refid="tested.project.lib.source.path…
1305 <echo level="info">Extracting coverage report...</echo>
1307 <property name="report.html.out.encoding" value="UTF-8" />
1308 … <report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}"
1310 … <!-- TODO: report.dir or something like should be introduced if necessary -->
1312 <infileset file="${tested.project.out.absolute.dir}/coverage.em" />
1313 <!-- TODO: reports in other, indicated by user formats -->
1319 <echo level="info">Cleaning up temporary files...</echo>
1321 <delete file="${tested.project.out.absolute.dir}/coverage.em" />
1325 <arg value="run-as" />
1326 <arg value="${tested.project.app.package}" />
1330 <echo level="info">Saving the coverage reports in ${out.absolute.dir}</echo>
1333 <run-tests-helper />
1338 <!-- ******************************************************* -->
1339 <!-- ********** Run Lint on the project ********* -->
1340 <!-- ******************************************************* -->
1343 description="Runs lint on the project to look for potential bugs" >
1351 <!-- ******************************************************* -->
1352 <!-- ********** Install/uninstall specific targets ********* -->
1353 <!-- ******************************************************* -->
1359 <!-- only do install if *not* a library project -->
1360 <do-only-if-not-library elseText="Library project: nothing to install!" >
1373 … <echo level="info">Installing ${out.final.file} onto default emulator or device...</echo>
1377 <arg value="-r" />
1381 <!-- now install the tested project if applicable -->
1382 … <!-- can't use project.is.test since the setup target might not have run -->
1386 <isset property="tested.project.dir" />
1393 … <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
1395 … <!-- figure out which tested package to install based on emma.enabled -->
1396 … <condition property="tested.project.install.target" value="installi" else="installd">
1399 … <subant target="${tested.project.install.target}" failonerror="true">
1400 … <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
1430 </do-only-if-not-library>
1433 <target name="installd" depends="-set-debug-files, install"
1435 <target name="installr" depends="-set-release-mode, install"
1437 <target name="installi" depends="-set-instrumented-mode, install"
1439 <target name="installt" depends="-test-project-check, installd"
1443 <!-- Uninstalls the package from the default emulator/device -->
1444 <target name="uninstall" depends="-setup"
1448 <isset property="project.app.package" />
1451 <uninstall-helper app.package="${project.app.package}" />
1458 <!-- Now uninstall the tested project, if applicable -->
1462 <istrue value="${project.is.test}" />
1469 <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
1471 <!-- Application package of the tested project extracted from its manifest file -->
1472 <xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
1473 expression="/manifest/@package" output="tested.project.app.package" />
1476 <isset property="tested.project.app.package" />
1479 <uninstall-helper app.package="${tested.project.app.package}" />
1491 <!-- ******************************************************* -->
1492 <!-- ************************* Help ************************ -->
1493 <!-- ******************************************************* -->
1496 <!-- displays starts at col 13
1497 |13 80| -->
1502 <echo> Use 'ant nodeps clean' to only clean the local project</echo>
1505 <echo> current project and ignore the libraries using:</echo>
1510 <echo> current project and ignore the libraries using:</echo>
1514 <echo> test: Runs the tests. Project must be a test project and</echo>
1534 </project>