Index: blimp/BUILD.gn |
diff --git a/blimp/BUILD.gn b/blimp/BUILD.gn |
index 7654f2dda74e3dd3eb0f8e99243d880afa6990c5..397ed58d3090a75aae58f1a757b32acef3172089 100644 |
--- a/blimp/BUILD.gn |
+++ b/blimp/BUILD.gn |
@@ -6,6 +6,11 @@ import("//build/config/chrome_build.gni") |
import("//build/config/ui.gni") |
import("//testing/test.gni") |
+if (is_android) { |
+ import("//build/config/android/config.gni") |
+ import("//build/config/android/rules.gni") |
+} |
+ |
# Convenience meta-target for all of Blimp's production & test code. |
group("blimp") { |
# In spite of the name, this really just means that non-test targets |
@@ -73,6 +78,35 @@ test("blimp_unittests") { |
if (is_linux) { |
deps += [ "//blimp/engine:unit_tests" ] |
} |
+ |
+ if (is_android) { |
+ deps += [ ":blimp_unittests_java_deps" ] |
+ } |
+} |
+ |
+if (is_android) { |
+ # This is the list of targets that the tests need to depend on in order to add |
+ # the java classes for their native counterparts to the test apk. |
+ # We could directly include them in the test target, but in order to |
+ # keep the visibility of the //blimp/client/core:core_java target restricted, |
+ # we make it visible to this group (which is testonly) and depend on this |
+ # group instead. |
+ # We could not add ":blimp_unittests" to the visibility list of |
+ # //blimp/client/core:core_java, since the targets that actually need to |
+ # depend on it are generated by the test template (see testing/test.gni). So |
+ # it was better to add this indirection and expose it to this testonly target, |
+ # which can be used in this file only. |
+ java_group("blimp_unittests_java_deps") { |
+ testonly = true |
+ visibility = [ ":*" ] |
+ |
+ deps = [ |
+ "//base:base_java", |
+ "//blimp/client/core:core_java", |
+ "//net/android:net_java", |
+ "//ui/android:ui_java", |
+ ] |
+ } |
} |
if (is_linux) { |