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

Unified Diff: build/config/android/rules.gni

Issue 485833003: Pull new GN, update toolchain definitions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android Created 6 years, 4 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: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 61a83223242a57213a78dcb17f657cacae4617e7..1a40088557439d52a2397870ce8eb622f5ee6cbd 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -595,6 +595,12 @@ template("android_apk") {
# resource dependencies of the apk.
# unittests_dep: This should be the label of the gtest native target. This
# target must be defined previously in the same file.
+# unittests_binary: The name of the binary produced by the unittests_dep
+# target, relative to the root build directory. If unspecified, it assumes
+# the name of the unittests_dep target (which will be correct unless that
+# target specifies an "output_name".
+# TODO(brettw) make this automatic by allowing get_target_outputs to
+# support executables.
#
# Example
# unittest_apk("foo_unittests_apk") {
@@ -602,7 +608,16 @@ template("android_apk") {
# unittests_dep = ":foo_unittests"
# }
template("unittest_apk") {
+ assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name")
+
test_suite_name = get_label_info(invoker.unittests_dep, "name")
+
+ if (defined(invoker.unittests_binary)) {
+ unittests_binary = root_out_dir + "/" + invoker.unittests_binary
+ } else {
+ unittests_binary = root_out_dir + "/" + test_suite_name
+ }
+
android_apk(target_name) {
apk_name = test_suite_name
final_apk_path = "$root_build_dir/${apk_name}_apk/${apk_name}-debug.apk"
@@ -610,7 +625,7 @@ template("unittest_apk") {
"//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java"
]
android_manifest = "//testing/android/java/AndroidManifest.xml"
- unittests_outputs = get_target_outputs(invoker.unittests_dep)
+ unittests_outputs = [ unittests_binary ]
native_libs = [unittests_outputs[0]]
if (defined(invoker.deps)) {
deps = invoker.deps
« no previous file with comments | « DEPS ('k') | build/toolchain/android/BUILD.gn » ('j') | build/toolchain/gcc_toolchain.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698