aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/android_rules.xml63
-rw-r--r--scripts/android_test_rules.xml2
2 files changed, 43 insertions, 22 deletions
diff --git a/scripts/android_rules.xml b/scripts/android_rules.xml
index 6c42ee9..e91dc0b 100644
--- a/scripts/android_rules.xml
+++ b/scripts/android_rules.xml
@@ -66,6 +66,24 @@
<property name="out.release.package"
location="${out.absolute.dir}/${ant.project.name}-release.apk" />
+ <!-- Verbosity -->
+ <property name="verbose" value="false" />
+ <!-- This is needed by emma as it uses multilevel verbosity instead of simple 'true' or 'false'
+ The property 'verbosity' is not user configurable and depends exclusively on 'verbose'
+ value.-->
+ <condition property="verbosity" value="verbose" else="quiet">
+ <istrue value="${verbose}" />
+ </condition>
+ <!-- This is needed to switch verbosity of zipalign and aapt. Depends exclusively on 'verbose'
+ -->
+ <condition property="v.option" value="-v" else="">
+ <istrue value="${verbose}" />
+ </condition>
+ <!-- This is needed to switch verbosity of dx. Depends exclusively on 'verbose' -->
+ <condition property="verbose.option" value="--verbose" else="">
+ <istrue value="${verbose}" />
+ </condition>
+
<!-- Tools -->
<condition property="exe" value=".exe" else=""><os family="windows" /></condition>
<property name="adb" location="${android.tools.dir}/adb${exe}" />
@@ -92,6 +110,7 @@
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate.dex.file}" />
+ <arg line="${verbose.option}" />
<arg path="${out.classes.absolute.dir}" />
<fileset dir="${external.libs.absolute.dir}" includes="*.jar" />
<external-libs />
@@ -116,7 +135,7 @@
outfolder="${out.absolute.dir}"
basename="${ant.project.name}"
signed="@{sign.package}"
- verbose="true">
+ verbose="${verbose}">
<file path="${intermediate.dex.file}" />
<sourcefolder path="${source.absolute.dir}" />
<nativefolder path="${native.libs.absolute.dir}" />
@@ -126,18 +145,20 @@
</sequential>
</macrodef>
- <!-- This is macro used only for sharing code among two targets, -debug and
- -debug-with-emma which do exactly the same but differ in dependencies -->
- <macrodef name="debug-helper">
+ <!-- This is macro which zipaligns in.package and outputs it to out.package. Used by targets
+ debug, -debug-with-emma and release.-->
+ <macrodef name="zipalign-helper">
+ <attribute name="in.package" />
+ <attribute name="out.package" />
<sequential>
<echo>Running zip align on final apk...</echo>
<exec executable="${zipalign}" failonerror="true">
+ <arg line="${v.option}" />
<arg value="-f" />
<arg value="4" />
- <arg path="${out.debug.unaligned.package}" />
- <arg path="${out.debug.package}" />
+ <arg path="@{in.package}" />
+ <arg path="@{out.package}" />
</exec>
- <echo>Debug Package: ${out.debug.package}</echo>
</sequential>
</macrodef>
@@ -171,6 +192,7 @@
<echo>Generating R.java / Manifest.java from the resources...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
+ <arg line="${v.option}" />
<arg value="-m" />
<arg value="-J" />
<arg path="${gen.absolute.dir}" />
@@ -206,7 +228,7 @@
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
- verbose="false" classpath="${extensible.classpath}">
+ verbose="${verbose}" classpath="${extensible.classpath}">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<classpath>
@@ -250,7 +272,9 @@
<!-- Builds debug output package, provided all the necessary files are already dexed -->
<target name="debug" depends="-package-debug-sign"
description="Builds the application and signs it with a debug key.">
- <debug-helper />
+ <zipalign-helper in.package="${out.debug.unaligned.package}"
+ out.package="${out.debug.package}" />
+ <echo>Debug Package: ${out.debug.package}</echo>
</target>
<target name="-release-check">
@@ -287,16 +311,12 @@
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
- keypass="${key.alias.password}" />
+ keypass="${key.alias.password}"
+ verbose="${verbose}" />
<!-- Zip aligns the APK -->
- <echo>Running zip align on final apk...</echo>
- <exec executable="${zipalign}" failonerror="true">
- <arg value="-f" />
- <arg value="4" />
- <arg path="${out.unaligned.package}" />
- <arg path="${out.release.package}" />
- </exec>
+ <zipalign-helper in.package="${out.unaligned.package}"
+ out.package="${out.release.package}" />
<echo>Release Package: ${out.release.package}</echo>
</target>
@@ -329,8 +349,8 @@
</target>
<target name="clean" description="Removes output files created by other targets.">
- <delete dir="${out.absolute.dir}" />
- <delete dir="${gen.absolute.dir}" />
+ <delete dir="${out.absolute.dir}" verbose="${verbose}" />
+ <delete dir="${gen.absolute.dir}" verbose="${verbose}" />
</target>
<!-- Targets for code-coverage measurement purposes, invoked from external file -->
@@ -341,7 +361,7 @@
<echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo>
<!-- It only instruments class files, not any external libs -->
<emma enabled="true">
- <instr verbosity="verbose"
+ <instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
@@ -370,7 +390,8 @@
</target>
<target name="-debug-with-emma" depends="-package-with-emma">
- <debug-helper />
+ <zipalign-helper in.package="${out.debug.unaligned.package}"
+ out.package="${out.debug.package}" />
</target>
<target name="-install-with-emma" depends="-debug-with-emma">
diff --git a/scripts/android_test_rules.xml b/scripts/android_test_rules.xml
index 7bed3a5..14bdb2f 100644
--- a/scripts/android_test_rules.xml
+++ b/scripts/android_test_rules.xml
@@ -86,7 +86,7 @@
<echo>Extracting coverage report...</echo>
<emma>
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
- verbosity="verbose">
+ verbosity="${verbosity}">
<!-- TODO: report.dir or something like should be introduced if necessary -->
<infileset dir=".">
<include name="coverage.ec" />