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

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

Issue 1057783002: Add new GN junit binary template and new GYP java binary template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed cjhopman's feedback. Created 5 years, 8 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
« no previous file with comments | « build/android/pylib/junit/test_runner.py ('k') | build/host_jar.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index a0569974e1b71268a759aad9d57b35846ede3cfb..c22368261f3f20b80bbd146d9600259d6b02ba60 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -776,6 +776,64 @@ template("java_binary") {
}
}
+# Declare a Junit executable target
+#
+# This target creates an executable from java code for running as a junit test
+# suite. The executable will be in the output folder's /bin/ directory.
+#
+# Variables
+# deps: Specifies the dependencies of this target. Java targets in this list
+# will be included in the executable (and the javac classpath).
+#
+# java_files: List of .java files included in this library.
+# srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
+# will be added to java_files and be included in this library.
+# srcjars: List of srcjars to be included in this library, together with the
+# ones obtained from srcjar_deps.
+#
+# chromium_code: If true, extra analysis warning/errors will be enabled.
+#
+# Example
+# junit_binary("foo") {
+# java_files = [ "org/chromium/foo/FooTest.java" ]
+# deps = [ ":bar_java" ]
+# }
+template("junit_binary") {
+ set_sources_assignment_filter([])
+
+ java_binary(target_name) {
+ bypass_platform_checks = true
+ main_class = "org.chromium.testing.local.JunitTestMain"
+ testonly = true
+
+ if (defined(invoker.DEPRECATED_java_in_dir)) {
+ DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
+ }
+ if (defined(invoker.chromium_code)) {
+ chromium_code = invoker.chromium_code
+ }
+ deps = [
+ "//testing/android/junit:junit_test_support",
+ "//third_party/junit",
+ "//third_party/mockito:mockito_java",
+ "//third_party/robolectric:robolectric_java",
+ "//third_party/robolectric:android-all-4.3_r2-robolectric-0",
+ ]
+ if (defined(invoker.deps)) {
+ deps += invoker.deps
+ }
+ if (defined(invoker.java_files)) {
+ java_files = invoker.java_files
+ }
+ if (defined(invoker.srcjar_deps)) {
+ srcjar_deps = invoker.srcjar_deps
+ }
+ if (defined(invoker.srcjars)) {
+ srcjars = invoker.srcjars
+ }
+ }
+}
+
# Declare an java library target
#
# Variables
« no previous file with comments | « build/android/pylib/junit/test_runner.py ('k') | build/host_jar.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698