Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1402)

Unified Diff: content/shell/android/javatests/content_shell_test_apk.xml

Issue 10905138: Add test jar generation logic for ant builds. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/android/javatests/content_shell_test_apk.xml
diff --git a/content/shell/android/javatests/content_shell_test_apk.xml b/content/shell/android/javatests/content_shell_test_apk.xml
index 78b6c0e7722a813f2e9dda66f202342835d734a3..29e8a6092c4059283e64d0f28d29d667a7deb274 100644
--- a/content/shell/android/javatests/content_shell_test_apk.xml
+++ b/content/shell/android/javatests/content_shell_test_apk.xml
@@ -12,74 +12,37 @@
<import file="../../../../build/android/ant/common.xml"/>
<import file="../../../../build/android/ant/sdk-targets.xml"/>
- <property name="target.abi" value="${APP_ABI}"/>
+ <property-value name="target.abi" value="${APP_ABI}"/>
cjhopman 2012/09/07 19:50:35 Should the other below this also be switched to th
<property name="out.dir" location="${PRODUCT_DIR}/content_shell_test"/>
<property name="resource.absolute.dir" value="../res"/>
<property name="gen.absolute.dir" value="${out.dir}/gen"/>
- <path id="native.libs.gdbserver">
- <fileset file="${android.gdbserver}"/>
- </path>
<property name="native.libs.absolute.dir" location="${out.dir}/libs" />
<property name="asset.absolute.dir" location="${out.dir}/assets" />
-
- <path id="out.dex.jar.input.ref">
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_base.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_base_javatests.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_content.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_content_javatests.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_media.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_net.jar"/>
- <pathelement location="${PRODUCT_DIR}/lib.java/chromium_net_javatests.jar"/>
- <pathelement location="${PRODUCT_DIR}/content_shell/classes"/>
- </path>
- <property name="java.compilerargs" value="-classpath ${toString:out.dex.jar.input.ref}"/>
-
- <!-- We expect PRODUCT_DIR to be set like the gyp var
- (e.g. $ROOT/out/Debug) -->
- <fail message="PRODUCT_DIR env var not set?">
- <condition>
- <not>
- <isset property="PRODUCT_DIR"/>
- </not>
- </condition>
- </fail>
-
- <target name="-post-compile">
- <!-- copy gdbserver to main libs directory if building debug.
Yaron 2012/09/07 19:19:31 Where did this logic go?
cjhopman 2012/09/07 19:50:35 This step claims to enable native debugging. You'v
shashi 2012/09/07 20:53:06 I do not think this is needed for ContentShell tes
- TODO(jrg): for now, Chrome on Android always builds native code
- as Release and java/ant as Debug, which means we always install
- gdbserver. Resolve this discrepancy, possibly by making this
- Release Official build java/ant as Release. -->
- <if>
- <condition>
- <equals arg1="${build.target}" arg2="debug" />
- </condition>
- <then>
- <echo message="Copying gdbserver to the apk to enable native debugging"/>
- <copy todir="${out.dir}/libs/${target.abi}">
- <path refid="native.libs.gdbserver"/>
- </copy>
- </then>
- </if>
-
- <!-- We also want a .jar as well as an .apk for ContentShellTest-debug
- so that proguard can be used to list the tests by annotation. -->
- <jar destfile="${out.dir}/${ant.project.name}-debug.jar">
- <fileset dir="${out.dir}/classes" includes="**/*.class"/>
- <zipfileset
- includes="**/*.class"
- src="${PRODUCT_DIR}/lib.java/chromium_content_javatests.jar"/>
- <zipfileset
- includes="**/*.class"
- src="${PRODUCT_DIR}/lib.java/chromium_net_javatests.jar"/>
- </jar>
-
- </target>
+ <!-- Set the output directory for the final apk to the ${apks.dir}. -->
+ <property-location name="out.final.file" location="${apks.dir}/${ant.project.name}-debug.apk"
cjhopman 2012/09/07 19:50:35 Shouldn't this directory always exist at this poin
shashi 2012/09/07 23:31:31 Yes, it is just a safe setter. On 2012/09/07 19:50
+ check-exists="false" />
+ <property name="generate.test.jar" value="true" />
<!-- Classpath for javac -->
<path id="javac.custom.classpath">
- <path refid="out.dex.jar.input.ref"/>
+ <fileset file="${lib.java.dir}/chromium_base_javatests.jar"/>
cjhopman 2012/09/07 19:50:35 use <pathelement location=[...]/> for a single fil
shashi 2012/09/07 23:31:31 Done.
+ <fileset file="${lib.java.dir}/chromium_content_javatests.jar"/>
+ <fileset file="${lib.java.dir}/chromium_net_javatests.jar"/>
+ <fileset file="${lib.java.dir}/chromium_media.jar"/>
Yaron 2012/09/07 19:19:31 Why media?
shashi 2012/09/07 23:31:31 Nice catch, it is not needed, I cleaned up a few j
+ <fileset file="${test.lib.java.dir}/ContentShell-debug.jar"/>
cjhopman 2012/09/07 19:50:35 I don't really like depending on one of the debug
shashi 2012/09/07 23:31:31 This is for javac classpath. If multiple definitio
</path>
- <import file="${sdk.dir}/tools/ant/build.xml" />
+ <!-- Use the output jar for dex, this jar contains all the compiled
+ classes as well as classes from included jars.
+ -->
+ <path id="out.dex.jar.input.ref">
+ <fileset file="${test.lib.java.dir}/ContentShellTest-debug.jar"/>
cjhopman 2012/09/07 19:50:35 <pathelement location=
shashi 2012/09/07 23:31:31 Done.
+ </path>
+ <!-- Set the classes directory to null, to avoid including compiled
+ classes, the compiled classes are already included in generated
+ {ant.project.name)-debug.jar file.
+ -->
+ <property name="out.dex.input.absolute.dir" value="" />
+
+ <import file="${sdk.dir}/tools/ant/build.xml" />
</project>

Powered by Google App Engine
This is Rietveld 408576698