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

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

Issue 2506263003: Revert of Add GN build rules to allow java_assertion_enabler to enable Java asserts. (Closed)
Patch Set: Created 4 years, 1 month 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/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 60ba966b100e70bee1d86a9edd438a864d3167d2..6a7cda3bc6c150809c8e7defbf06f6d4f11a2d84 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -6,7 +6,6 @@
# Some projects (e.g. V8) do not have non-build directories DEPS'ed in.
import("//build_overrides/build.gni")
import("//build/config/android/config.gni")
-import("//build/config/dcheck_always_on.gni")
import("//build/config/sanitizers/sanitizers.gni")
assert(is_android)
@@ -1007,11 +1006,10 @@
_rebased_build_config = rebase_path(_build_config, root_build_dir)
assert(_rebased_build_config != "" || true) # Mark used.
+ _proguard_preprocess =
+ defined(invoker.proguard_preprocess) && invoker.proguard_preprocess
_input_jar_path = invoker.input_jar_path
_output_jar_path = invoker.output_jar_path
-
- _proguard_preprocess =
- defined(invoker.proguard_preprocess) && invoker.proguard_preprocess
_jar_excluded_patterns = []
if (defined(invoker.jar_excluded_patterns)) {
@@ -1021,15 +1019,24 @@
invoker.strip_resource_classes
_filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes
- _enable_assert =
- defined(invoker.supports_android) && invoker.supports_android &&
- (is_java_debug || dcheck_always_on)
- assert(_enable_assert || true) # Mark used.
-
if (_filter_jar) {
_filter_target = "${target_name}__filter"
-
- _filter_jar_path = "$target_out_dir/$target_name-filtered.jar"
+ _output_jar_target = _filter_target
+ }
+ if (_proguard_preprocess) {
+ _proguard_target = "${target_name}__proguard_process"
+ _output_jar_target = _proguard_target
+ }
+ if (!_filter_jar && !_proguard_preprocess) {
+ _copy_target = "${target_name}__copy"
+ _output_jar_target = _copy_target
+ }
+
+ if (_filter_jar) {
+ _filtered_jar_path = _output_jar_path
+ if (_proguard_preprocess) {
+ _filtered_jar_path = "$target_out_dir/$target_name-filtered.jar"
+ }
action(_filter_target) {
script = "//build/android/gyp/jar.py"
forward_variables_from(invoker,
@@ -1042,13 +1049,13 @@
_input_jar_path,
]
outputs = [
- _filter_jar_path,
+ _filtered_jar_path,
]
args = [
"--input-jar",
rebase_path(_input_jar_path, root_build_dir),
"--jar-path",
- rebase_path(_filter_jar_path, root_build_dir),
+ rebase_path(_filtered_jar_path, root_build_dir),
"--excluded-classes=$_jar_excluded_patterns",
]
if (_strip_resource_classes) {
@@ -1058,34 +1065,31 @@
}
if (_proguard_preprocess) {
- _output_jar_target = "${target_name}__proguard_process"
- _proguard_output_jar = _output_jar_path
_proguard_config_path = invoker.proguard_preprocess_config
- proguard(_output_jar_target) {
+ proguard(_proguard_target) {
if (_filter_jar) {
- _proguard_input_jar = _filter_jar_path
- deps = [
+ _proguard_input_jar = _filtered_jar_path
+ public_deps = [
":$_filter_target",
]
} else {
_proguard_input_jar = _input_jar_path
- deps = []
+ public_deps = []
}
if (defined(invoker.deps)) {
- deps += invoker.deps
+ deps = invoker.deps
}
if (defined(invoker.public_deps)) {
- public_deps = invoker.public_deps
+ public_deps += invoker.public_deps
}
inputs = [
_build_config,
_proguard_config_path,
_proguard_input_jar,
]
- output_jar_path = _proguard_output_jar
-
- _rebased_input_paths =
- [ rebase_path(_proguard_input_jar, root_build_dir) ]
+ output_jar_path = _output_jar_path
+
+ _rebased_input_paths = [ rebase_path(_input_jar_path, root_build_dir) ]
_rebased_proguard_configs =
[ rebase_path(_proguard_config_path, root_build_dir) ]
args = [
@@ -1094,57 +1098,15 @@
"--classpath=@FileArg($_rebased_build_config:javac:classpath)",
]
}
- } else if (_enable_assert) {
- _output_jar_target = "${target_name}__assert"
- _assert_output_jar = _output_jar_path
- action(_output_jar_target) {
- script = "$root_out_dir/bin/helper/java_assertion_enabler"
- deps = [
- "//build/android/java_assertion_enabler($default_toolchain)",
- ]
- if (_filter_jar) {
- _assert_input_jar = _filter_jar_path
- deps += [ ":$_filter_target" ]
- } else {
- _assert_input_jar = _input_jar_path
- }
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
- if (defined(invoker.public_deps)) {
- public_deps = invoker.public_deps
- }
- inputs = [
- _assert_input_jar,
- ]
- outputs = [
- _assert_output_jar,
- ]
- args = [
- rebase_path(_assert_input_jar, root_build_dir),
- rebase_path(_assert_output_jar, root_build_dir),
- ]
- }
- } else {
- _output_jar_target = "${target_name}__copy"
- copy(_output_jar_target) {
- if (_filter_jar) {
- _copy_input_jar = _filter_jar_path
- public_deps = [
- ":$_filter_target",
- ]
- } else {
- _copy_input_jar = _input_jar_path
- public_deps = []
- }
- if (defined(invoker.deps)) {
- deps = invoker.deps
- }
- if (defined(invoker.public_deps)) {
- public_deps += invoker.public_deps
- }
+ } else if (!_filter_jar) {
+ copy(_copy_target) {
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "public_deps",
+ ])
sources = [
- _copy_input_jar,
+ _input_jar_path,
]
outputs = [
_output_jar_path,
@@ -1840,7 +1802,6 @@
visibility += [ ":$_dex_target_name" ]
}
- supports_android = _supports_android
build_config = _build_config
input_jar_path = invoker.jar_path
output_jar_path = _jar_path
@@ -2132,7 +2093,6 @@
"proguard_preprocess",
"proguard_preprocess_config",
])
- supports_android = _supports_android
build_config = _build_config
input_jar_path = _javac_jar_path
output_jar_path = _process_prebuilt_jar_path

Powered by Google App Engine
This is Rietveld 408576698