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

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

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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 a0569974e1b71268a759aad9d57b35846ede3cfb..39b2f397294c69cd726067efd627325a26a49067 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -49,9 +49,6 @@ template("generate_jni") {
script = "//base/android/jni_generator/jni_generator.py"
depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d"
sources = invoker.sources
- inputs = [
- jni_generator_include,
- ]
outputs = [
depfile,
"${jni_output_dir}/{{source_name_part}}_jni.h",
@@ -66,7 +63,7 @@ template("generate_jni") {
"--output_dir",
rebase_path(jni_output_dir, root_build_dir),
"--includes",
- rebase_path(jni_generator_include, "//"),
+ rebase_path(jni_generator_include, jni_output_dir),
"--native_exports_optional",
]
if (defined(invoker.jni_generator_jarjar_file)) {
@@ -166,7 +163,6 @@ template("generate_jar_jni") {
script = "//base/android/jni_generator/jni_generator.py"
sources = [
jar_file,
- jni_generator_include,
]
outputs = [
depfile,
@@ -185,7 +181,7 @@ template("generate_jar_jni") {
"--output_dir",
rebase_path(jni_output_dir, root_build_dir),
"--includes",
- rebase_path(jni_generator_include, root_build_dir),
+ rebase_path(jni_generator_include, jni_output_dir),
"--native_exports_optional",
]
}
@@ -733,7 +729,7 @@ template("java_strings_grd_prebuilt") {
# datadeps, testonly
#
# Example
-# java_library("foo") {
+# java_binary("foo") {
# java_files = [ "org/chromium/foo/FooMain.java" ]
# deps = [ ":bar_java" ]
# main_class = "org.chromium.foo.FooMain"
@@ -776,7 +772,65 @@ template("java_binary") {
}
}
-# Declare an java library target
+# 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 a java library target
#
# Variables
# deps: Specifies the dependencies of this target. Java targets in this list
@@ -874,7 +928,7 @@ template("java_library") {
}
}
-# Declare an java library target for a prebuilt jar
+# Declare a java library target for a prebuilt jar
#
# Variables
# deps: Specifies the dependencies of this target. Java targets in this list
@@ -1107,6 +1161,8 @@ template("android_java_prebuilt") {
# native_libs: List paths of native libraries to include in this apk. If these
# libraries depend on other shared_library targets, those dependencies will
# also be included in the apk.
+# apk_under_test: For an instrumentation test apk, this is the target of the
+# tested apk.
# testonly: Marks this target as "test-only".
#
# DEPRECATED_java_in_dir: Directory containing java files. All .java files in
@@ -1138,9 +1194,10 @@ template("android_apk") {
}
assert(defined(invoker.final_apk_path) || defined(invoker.apk_name))
+ assert(defined(invoker.android_manifest))
gen_dir = "$target_gen_dir/$target_name"
base_path = "$gen_dir/$target_name"
- _build_config = "$base_path.build_config"
+ _build_config = "$target_gen_dir/$target_name.build_config"
resources_zip_path = "$base_path.resources.zip"
all_resources_zip_path = "$base_path.resources.all.zip"
jar_path = "$base_path.jar"
@@ -1223,6 +1280,7 @@ template("android_apk") {
}
}
+ _android_manifest = invoker.android_manifest
_rebased_build_config = rebase_path(_build_config, root_build_dir)
write_build_config("${_template_name}__build_config") {
@@ -1230,11 +1288,16 @@ template("android_apk") {
dex_path = final_dex_path
resources_zip = resources_zip_path
build_config = _build_config
+ android_manifest = _android_manifest
if (defined(invoker.deps)) {
deps = invoker.deps
}
+ if (defined(invoker.apk_under_test)) {
+ apk_under_test = invoker.apk_under_test
+ }
+
native_libs = _native_libs
}
@@ -1243,7 +1306,7 @@ template("android_apk") {
final_deps += [ ":${_template_name}__process_resources" ]
process_resources("${_template_name}__process_resources") {
srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
- android_manifest = invoker.android_manifest
+ android_manifest = _android_manifest
resource_dirs = [ "//build/android/ant/empty/res" ]
zip_path = resources_zip_path
generate_constant_ids = true
@@ -1289,7 +1352,7 @@ template("android_apk") {
supports_android = true
requires_android = true
override_build_config = _build_config
- android_manifest = invoker.android_manifest
+ android_manifest = _android_manifest
chromium_code = true
if (defined(invoker.java_files)) {
java_files = invoker.java_files
@@ -1397,7 +1460,7 @@ template("android_apk") {
final_deps += [ ":${_template_name}__create" ]
create_apk("${_template_name}__create") {
apk_path = _final_apk_path
- android_manifest = invoker.android_manifest
+ android_manifest = _android_manifest
resources_zip = all_resources_zip_path
dex_path = final_dex_path
load_library_from_apk = _load_library_from_apk
@@ -1490,13 +1553,12 @@ template("unittest_apk") {
}
android_apk(target_name) {
- _apk_name = apk_name
- final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk"
+ 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",
- "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestInstrumentationTestRunner.java",
+ "//testing/android/native_test/java/src/org/chromium/native_test/ChromeNativeTestActivity.java",
+ "//testing/android/native_test/java/src/org/chromium/native_test/ChromeNativeTestInstrumentationTestRunner.java",
]
- android_manifest = "//testing/android/java/AndroidManifest.xml"
+ android_manifest = "//testing/android/native_test/java/AndroidManifest.xml"
native_libs = [ unittests_binary ]
if (defined(invoker.asset_location)) {
asset_location = invoker.asset_location

Powered by Google App Engine
This is Rietveld 408576698