Commit 70296792 authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Use not_needed instead of asserts in build files

Bug: None
Change-Id: If581f3d86f151d3ab4004b736a7c9092375a23d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098587
Auto-Submit: Peter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749459}
parent e501d4a3
...@@ -1316,7 +1316,7 @@ template("assert_valid_out_dir") { ...@@ -1316,7 +1316,7 @@ template("assert_valid_out_dir") {
"*\bposix/*", "*\bposix/*",
"*\bwin/*", "*\bwin/*",
]) ])
assert(target_name != "") # Mark as used. not_needed([ "target_name" ])
sources = invoker.actual_sources sources = invoker.actual_sources
assert( assert(
sources == invoker.actual_sources, sources == invoker.actual_sources,
......
...@@ -652,7 +652,7 @@ template("test_runner_script") { ...@@ -652,7 +652,7 @@ template("test_runner_script") {
get_label_info(invoker.apk_target, "target_gen_dir") + "/" + get_label_info(invoker.apk_target, "target_gen_dir") + "/" +
get_label_info(invoker.apk_target, "name") + ".build_config" get_label_info(invoker.apk_target, "name") + ".build_config"
_rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir)
assert(_rebased_apk_build_config != "") # Mark as used. not_needed([ "_rebased_apk_build_config" ])
} else if (_test_type == "gtest") { } else if (_test_type == "gtest") {
assert( assert(
defined(invoker.executable_dist_dir), defined(invoker.executable_dist_dir),
...@@ -2797,6 +2797,7 @@ if (enable_java_templates) { ...@@ -2797,6 +2797,7 @@ if (enable_java_templates) {
# Override the default action_pool when goma is enabled. # Override the default action_pool when goma is enabled.
pool = "//build/config/android:goma_javac_pool" pool = "//build/config/android:goma_javac_pool"
} }
# Flag enable_kythe_annotations requires # Flag enable_kythe_annotations requires
# checkout_android_prebuilts_build_tools=True in .gclient. # checkout_android_prebuilts_build_tools=True in .gclient.
if (enable_kythe_annotations && !invoker.enable_errorprone) { if (enable_kythe_annotations && !invoker.enable_errorprone) {
...@@ -3388,7 +3389,7 @@ if (enable_java_templates) { ...@@ -3388,7 +3389,7 @@ if (enable_java_templates) {
} }
if (defined(invoker.android_manifest_for_lint)) { if (defined(invoker.android_manifest_for_lint)) {
_android_manifest_for_lint = invoker.android_manifest_for_lint _android_manifest_for_lint = invoker.android_manifest_for_lint
assert(_android_manifest_for_lint != "") # Mark as used. not_needed([ "_android_manifest_for_lint" ])
} }
if (_lint_enabled) { if (_lint_enabled) {
_android_lint_target = "${_main_target_name}__lint" _android_lint_target = "${_main_target_name}__lint"
......
...@@ -2174,7 +2174,7 @@ if (enable_java_templates) { ...@@ -2174,7 +2174,7 @@ if (enable_java_templates) {
process_file_template([ _final_apk_path ], process_file_template([ _final_apk_path ],
"{{source_dir}}/{{source_name_part}}") "{{source_dir}}/{{source_name_part}}")
_final_apk_path_no_ext = _final_apk_path_no_ext_list[0] _final_apk_path_no_ext = _final_apk_path_no_ext_list[0]
assert(_final_apk_path_no_ext != "") # Mark as used. not_needed([ "_final_apk_path_no_ext" ])
} }
# Non-base bundle modules create only proto resources. # Non-base bundle modules create only proto resources.
...@@ -2255,8 +2255,10 @@ if (enable_java_templates) { ...@@ -2255,8 +2255,10 @@ if (enable_java_templates) {
_load_library_from_apk = _load_library_from_apk =
defined(invoker.load_library_from_apk) && invoker.load_library_from_apk defined(invoker.load_library_from_apk) && invoker.load_library_from_apk
assert(_use_chromium_linker || true) # Mark as used. not_needed([
assert(_use_modern_linker || true) # Mark as used. "_use_chromium_linker",
"_use_modern_linker",
])
assert(!_load_library_from_apk || _use_chromium_linker, assert(!_load_library_from_apk || _use_chromium_linker,
"load_library_from_apk requires use_chromium_linker") "load_library_from_apk requires use_chromium_linker")
...@@ -2295,7 +2297,6 @@ if (enable_java_templates) { ...@@ -2295,7 +2297,6 @@ if (enable_java_templates) {
} }
_secondary_abi_native_libs_deps = [] _secondary_abi_native_libs_deps = []
assert(_secondary_abi_native_libs_deps == []) # mark as used.
if (defined(invoker.secondary_abi_shared_libraries) && if (defined(invoker.secondary_abi_shared_libraries) &&
invoker.secondary_abi_shared_libraries != []) { invoker.secondary_abi_shared_libraries != []) {
......
...@@ -73,8 +73,10 @@ template("chrome_public_common_apk_or_module_tmpl") { ...@@ -73,8 +73,10 @@ template("chrome_public_common_apk_or_module_tmpl") {
_is_trichrome = defined(invoker.is_trichrome) && invoker.is_trichrome _is_trichrome = defined(invoker.is_trichrome) && invoker.is_trichrome
_is_64_bit_browser = _is_64_bit_browser =
defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser
assert(_is_modern || !_is_modern) # Mark as used. not_needed([
assert(_is_64_bit_browser || !_is_64_bit_browser) # Mark as used. "_is_modern",
"_is_64_bit_browser",
])
assert(!(_is_monochrome && _is_trichrome), assert(!(_is_monochrome && _is_trichrome),
"Cannot be both trichrome and monochrome!") "Cannot be both trichrome and monochrome!")
assert(_is_trichrome == defined(invoker.static_library_provider), assert(_is_trichrome == defined(invoker.static_library_provider),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment