diff options
author | qsr <qsr@chromium.org> | 2015-01-08 03:39:35 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-08 11:41:00 +0000 |
commit | e97f885871e033274a60af0d5fcd4e94f62ef92f (patch) | |
tree | 455ece97ac24209144ea4b3a8b051df196d9c83b /build | |
parent | 397c13773ca89b005f0501e3ef9b00e4f26db338 (diff) | |
download | chromium_src-e97f885871e033274a60af0d5fcd4e94f62ef92f.zip chromium_src-e97f885871e033274a60af0d5fcd4e94f62ef92f.tar.gz chromium_src-e97f885871e033274a60af0d5fcd4e94f62ef92f.tar.bz2 |
Update unittest_apk target to allow specifying the name of the apk.
This is useful when we want to build a template that will automatically
construct a test on desktop platforms and a test apk on Android.
R=cjhopman@chromium.org
Review URL: https://codereview.chromium.org/833003004
Cr-Commit-Position: refs/heads/master@{#310479}
Diffstat (limited to 'build')
-rw-r--r-- | build/config/android/rules.gni | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 4c4e744..5417863 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -1428,6 +1428,8 @@ template("android_apk") { # (which will be correct unless that target specifies an "output_name". # TODO(brettw) make this automatic by allowing get_target_outputs to # support executables. +# apk_name: The name of the produced apk. If unspecified, it uses the name +# of the unittests_dep target postfixed with "_apk" # # Example # unittest_apk("foo_unittests_apk") { @@ -1441,14 +1443,24 @@ template("unittest_apk") { test_suite_name = get_label_info(invoker.unittests_dep, "name") + # This trivial assert is needed in case both unittests_binary and apk_name + # are defined, as otherwise test_suite_name would not be used. + assert(test_suite_name != "") + if (defined(invoker.unittests_binary)) { unittests_binary = invoker.unittests_binary } else { unittests_binary = "lib" + test_suite_name + ".so" } + if (defined(invoker.apk_name)) { + apk_name = invoker.apk_name + } else { + apk_name = test_suite_name + } + android_apk(target_name) { - _apk_name = test_suite_name + _apk_name = apk_name final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" java_files = [ "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java", |