summaryrefslogtreecommitdiffstats
path: root/testing/android
diff options
context:
space:
mode:
authoryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 23:23:51 +0000
committeryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 23:23:51 +0000
commit300800480f12dc97c8e9d90dd101fabd29203115 (patch)
tree21cfcb39e090675b55c3c512da10ee721bd11817 /testing/android
parent4f3db5b5a785511a73282af279d3f30c975944a9 (diff)
downloadchromium_src-300800480f12dc97c8e9d90dd101fabd29203115.zip
chromium_src-300800480f12dc97c8e9d90dd101fabd29203115.tar.gz
chromium_src-300800480f12dc97c8e9d90dd101fabd29203115.tar.bz2
[Android] Add chrome_java target for building Java code in the chromium layer.
Also includes a refactoring of the Ant xml scripts to use a common template (contributed by shashishekhar@chromium.org). As part of this, I also continued Torne's effort of removing our reliance on environment variables. Unfortunately this currently means that you have to specify 5 gyp flags: ANDROID_SDK, ANDROID_SDK_ROOT, ANDROID_SDK_TOOLS, ANDROID_SDK_VERSION, ANDROID_TOOLCHAIN. This'll get better as we make further use of the checked in sdk both upstream and downstream. The problem stems from the android tree and released sdk having different configurations. Review URL: https://chromiumcodereview.appspot.com/10830012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/android')
-rwxr-xr-xtesting/android/generate_native_test.py4
-rw-r--r--testing/android/native_test.gyp5
-rw-r--r--testing/android/native_test_apk.xml26
3 files changed, 20 insertions, 15 deletions
diff --git a/testing/android/generate_native_test.py b/testing/android/generate_native_test.py
index f5c3356..c5fc1ed 100755
--- a/testing/android/generate_native_test.py
+++ b/testing/android/generate_native_test.py
@@ -145,7 +145,7 @@ class NativeTestApkGenerator(object):
"""
cmd = ['ant']
if ant_args:
- cmd.append(ant_args)
+ cmd.extend(ant_args)
cmd.append("-DAPP_ABI=" + self._target_abi)
cmd.extend(['-buildfile',
os.path.join(self._output_directory, 'native_test_apk.xml')])
@@ -189,7 +189,7 @@ def main(argv):
help=('If specified, build the generated apk with ant. '
'Otherwise assume compiling within the Android '
'source tree using Android.mk.'))
- parser.add_option('--ant-args',
+ parser.add_option('--ant-args', action='append',
help='extra args for ant')
options, _ = parser.parse_args(argv)
diff --git a/testing/android/native_test.gyp b/testing/android/native_test.gyp
index fb21f27..38d2f39 100644
--- a/testing/android/native_test.gyp
+++ b/testing/android/native_test.gyp
@@ -39,6 +39,11 @@
'action': [
'ant',
'-DPRODUCT_DIR=<(ant_build_out)',
+ '-DANDROID_SDK=<(android_sdk)',
+ '-DANDROID_SDK_ROOT=<(android_sdk_root)',
+ '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
+ '-DANDROID_SDK_VERSION=<(android_sdk_version)',
+ '-DANDROID_TOOLCHAIN=<(android_toolchain)',
'-buildfile',
'<(DEPTH)/testing/android/native_test_apk.xml',
]
diff --git a/testing/android/native_test_apk.xml b/testing/android/native_test_apk.xml
index 444cf93..64d0e88 100644
--- a/testing/android/native_test_apk.xml
+++ b/testing/android/native_test_apk.xml
@@ -11,25 +11,25 @@ found in the LICENSE file.
Building native test runner ChromeNativeTests_replaceme.apk
</description>
- <property environment="env"/>
- <property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
- <property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
- <property name="toolchain.dir" location="${env.ANDROID_TOOLCHAIN}"/>
- <property name="src" location="."/>
- <property name="source.dir" location="java/src"/>
+ <!--
+ TODO(yfriedman): This target can be invoked from multiple depths. So we use ${PRODUCT_DIR} to normalize the paths. This could be cleaned up.
+ -->
+ <import file="${PRODUCT_DIR}/../../build/android/ant/common.xml"/>
+ <import file="${PRODUCT_DIR}/../../build/android/ant/sdk-targets.xml"/>
+ <!--
+ TODO(yfriedman): Remove the need to specify this. We should generate the packages in a way such
+ that it's not required.
+ -->
+ <property name="source.absolute.dir" value="java/src"/>
+ <path id="javac.custom.classpath">
+ <pathelement location="${ANDROID_SDK}/android.jar" />
+ </path>
<property name="target.abi" value="${APP_ABI}"/>
- <property name="target" value="android-${env.ANDROID_SDK_VERSION}"/>
<path id="native.libs.gdbserver">
<fileset file="${toolchain.dir}/../../gdbserver"/>
</path>
- <condition property="location.base"
- value="${sdk.dir}"
- else="${sdk.dir}/platforms/android-${sdk.version}">
- <isset property="env.ANDROID_BUILD_TOP"/>
- </condition>
-
<!-- We expect PRODUCT_DIR to be set like the gyp var
(e.g. $ROOT/out/Debug) -->
<fail message="PRODUCT_DIR env var not set?">