diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 20:54:28 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 20:54:28 +0000 |
commit | 755be4f221b00a6abec1f0fd62c6e296b3687f7b (patch) | |
tree | 189e1f7e2ce7899808e1f55ec070ded6f604764c | |
parent | 0dad65a1a4cdeab710cc78bfc13c5db609d59484 (diff) | |
download | chromium_src-755be4f221b00a6abec1f0fd62c6e296b3687f7b.zip chromium_src-755be4f221b00a6abec1f0fd62c6e296b3687f7b.tar.gz chromium_src-755be4f221b00a6abec1f0fd62c6e296b3687f7b.tar.bz2 |
Move ant call from python to gyp
All of our APKs should be built with build/java_apk.gypi. Currently,
native test APKs are built very differently. This change makes them
build more like other apks, as a first step to using java_apk.gypi.
Since WebKit's gyp files use generate_native_test.py directly,
rather than including apk_test.gypi, generate_native_test.py
needs to continue to support using it for ant compilation. :(
BUG=177121
Review URL: https://chromiumcodereview.appspot.com/12310002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183614 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/apk_test.gypi | 36 | ||||
-rwxr-xr-x | testing/android/generate_native_test.py | 23 |
2 files changed, 36 insertions, 23 deletions
diff --git a/build/apk_test.gypi b/build/apk_test.gypi index 1690dfcf..4fd3db5 100644 --- a/build/apk_test.gypi +++ b/build/apk_test.gypi @@ -23,6 +23,10 @@ '<(DEPTH)/base/base.gyp:base_java', '<(DEPTH)/tools/android/android_tools.gyp:android_tools', ], + 'variables': { + 'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk/', + 'generate_native_test_stamp': '<(intermediate_dir)/generate_native_test.stamp', + }, 'target_conditions': [ ['_toolset == "target"', { 'conditions': [ @@ -37,35 +41,43 @@ '>@(input_jars_paths)', ], 'outputs': [ - '<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk', + '<(generate_native_test_stamp)', ], 'action': [ '<(DEPTH)/testing/android/generate_native_test.py', '--native_library', '<(input_shlib_path)', '--output', - '<(PRODUCT_DIR)/<(test_suite_name)_apk', + '<(intermediate_dir)', '--strip-binary=<(android_strip)', '--app_abi', '<(android_app_abi)', - '--ant-args', - '-quiet', - '--ant-args', + '--stamp-file', + '<(generate_native_test_stamp)', + '--no-compile', + ], + }, + { + 'action_name': 'ant_apk_<(test_suite_name)', + 'message': 'Building <(test_suite_name) test apk.', + 'inputs': [ + '<(generate_native_test_stamp)', + ], + 'outputs': [ + '<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk', + ], + 'action': [ + 'ant', '-quiet', '-DPRODUCT_DIR=<(ant_build_out)', - '--ant-args', '-DANDROID_SDK=<(android_sdk)', - '--ant-args', '-DANDROID_SDK_ROOT=<(android_sdk_root)', - '--ant-args', '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', - '--ant-args', '-DANDROID_SDK_VERSION=<(android_sdk_version)', - '--ant-args', '-DANDROID_GDBSERVER=<(android_gdbserver)', - '--ant-args', '-DCHROMIUM_SRC=<(ant_build_out)/../..', - '--ant-args', '-DINPUT_JARS_PATHS=>(input_jars_paths)', + '-DAPP_ABI=<(android_app_abi)', + '-buildfile', '<(intermediate_dir)/native_test_apk.xml', ], }], }], # 'OS == "android" and gtest_target_type == "shared_library" diff --git a/testing/android/generate_native_test.py b/testing/android/generate_native_test.py index 0dbc7d7..af5bd8c 100755 --- a/testing/android/generate_native_test.py +++ b/testing/android/generate_native_test.py @@ -162,6 +162,10 @@ def main(argv): help='Binary to use for stripping the native libraries.') parser.add_option('--ant-args', action='append', help='extra args for ant') + parser.add_option('--stamp-file', + help='Path to file to touch on success.') + parser.add_option('--no-compile', action='store_true', + help='Use this flag to disable ant compilation.') options, _ = parser.parse_args(argv) @@ -179,22 +183,19 @@ def main(argv): if not options.strip_binary: raise Exception('No tool for stripping the libraries has been supplied') - # Remove all quotes from the jars string and pass the list to ant as - # INPUT_JARS_PATHS. - # TODO(cjhopman): Remove this when all targets pass the list of jars as an - # ant-arg directly. - jar_list = [] - if options.jars: - jar_list = options.jars.replace('"', '').split() - options.ant_args.append('-DINPUT_JARS_PATHS=' + " ".join(jar_list)) - - ntag = NativeTestApkGenerator(native_library=options.native_library, strip_binary=options.strip_binary, output_directory=options.output, target_abi=options.app_abi) + ntag.CreateBundle() - ntag.Compile(options.ant_args) + if not options.no_compile: + ntag.Compile(options.ant_args) + + if options.stamp_file: + with file(options.stamp_file, 'a'): + os.utime(options.stamp_file, None) + logging.info('COMPLETE.') if __name__ == '__main__': |