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

Side by Side Diff: build/config/android/rules.gni

Issue 833003004: Update unittest_apk target to allow specifying the name of the apk. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//base/android/linker/config.gni") 5 import("//base/android/linker/config.gni")
6 import("//build/config/android/config.gni") 6 import("//build/config/android/config.gni")
7 import("//build/config/android/internal_rules.gni") 7 import("//build/config/android/internal_rules.gni")
8 import("//tools/grit/grit_rule.gni") 8 import("//tools/grit/grit_rule.gni")
9 import("//tools/relocation_packer/config.gni") 9 import("//tools/relocation_packer/config.gni")
10 10
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 # deps: Specifies the dependencies of this target. These will be passed to 1421 # deps: Specifies the dependencies of this target. These will be passed to
1422 # the underlying android_apk invocation and should include the java and 1422 # the underlying android_apk invocation and should include the java and
1423 # resource dependencies of the apk. 1423 # resource dependencies of the apk.
1424 # unittests_dep: This should be the label of the gtest native target. This 1424 # unittests_dep: This should be the label of the gtest native target. This
1425 # target must be defined previously in the same file. 1425 # target must be defined previously in the same file.
1426 # unittests_binary: The basename of the library produced by the unittests_dep 1426 # unittests_binary: The basename of the library produced by the unittests_dep
1427 # target. If unspecified, it assumes the name of the unittests_dep target 1427 # target. If unspecified, it assumes the name of the unittests_dep target
1428 # (which will be correct unless that target specifies an "output_name". 1428 # (which will be correct unless that target specifies an "output_name".
1429 # TODO(brettw) make this automatic by allowing get_target_outputs to 1429 # TODO(brettw) make this automatic by allowing get_target_outputs to
1430 # support executables. 1430 # support executables.
1431 # apk_name: The name of the produced apk. If unspecified, it uses the name
1432 # of the unittests_dep target postfixed with "_apk"
1431 # 1433 #
1432 # Example 1434 # Example
1433 # unittest_apk("foo_unittests_apk") { 1435 # unittest_apk("foo_unittests_apk") {
1434 # deps = [ ":foo_java", ":foo_resources" ] 1436 # deps = [ ":foo_java", ":foo_resources" ]
1435 # unittests_dep = ":foo_unittests" 1437 # unittests_dep = ":foo_unittests"
1436 # } 1438 # }
1437 template("unittest_apk") { 1439 template("unittest_apk") {
1438 testonly = true 1440 testonly = true
1439 1441
1440 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") 1442 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name")
1441 1443
1442 test_suite_name = get_label_info(invoker.unittests_dep, "name") 1444 test_suite_name = get_label_info(invoker.unittests_dep, "name")
cjhopman 2015/01/07 23:29:35 if the invoker defines both unittests_binary and a
qsr 2015/01/08 08:58:16 Done.
1443 1445
1444 if (defined(invoker.unittests_binary)) { 1446 if (defined(invoker.unittests_binary)) {
1445 unittests_binary = invoker.unittests_binary 1447 unittests_binary = invoker.unittests_binary
1446 } else { 1448 } else {
1447 unittests_binary = "lib" + test_suite_name + ".so" 1449 unittests_binary = "lib" + test_suite_name + ".so"
1448 } 1450 }
1449 1451
1452 if (defined(invoker.apk_name)) {
1453 apk_name = invoker.apk_name
1454 } else {
1455 apk_name = test_suite_name
1456 }
1457
1450 android_apk(target_name) { 1458 android_apk(target_name) {
1451 _apk_name = test_suite_name 1459 _apk_name = apk_name
1452 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" 1460 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk"
1453 java_files = [ "//testing/android/java/src/org/chromium/native_test/ChromeNa tiveTestActivity.java" ] 1461 java_files = [ "//testing/android/java/src/org/chromium/native_test/ChromeNa tiveTestActivity.java" ]
1454 android_manifest = "//testing/android/java/AndroidManifest.xml" 1462 android_manifest = "//testing/android/java/AndroidManifest.xml"
1455 native_libs = [ unittests_binary ] 1463 native_libs = [ unittests_binary ]
1456 if (defined(invoker.asset_location)) { 1464 if (defined(invoker.asset_location)) {
1457 asset_location = invoker.asset_location 1465 asset_location = invoker.asset_location
1458 } 1466 }
1459 deps = [ 1467 deps = [
1460 "//base:base_java", 1468 "//base:base_java",
1461 ] 1469 ]
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 # TODO(GYP): implement this. 1698 # TODO(GYP): implement this.
1691 template("uiautomator_test") { 1699 template("uiautomator_test") {
1692 if (defined(invoker.testonly)) { 1700 if (defined(invoker.testonly)) {
1693 testonly = invoker.testonly 1701 testonly = invoker.testonly
1694 } 1702 }
1695 assert(target_name != "") 1703 assert(target_name != "")
1696 assert(invoker.deps != [] || true) 1704 assert(invoker.deps != [] || true)
1697 group(target_name) { 1705 group(target_name) {
1698 } 1706 }
1699 } 1707 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698