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

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

Issue 1828693002: Reland of Android: Run lint using a cache in the output directory (fix-up) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 9 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
« build/android/gyp/lint.py ('K') | « build/android/lint_action.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 79805d15a9a2187471e8a66c2e86b356bbf332d8..6c421df7786fb450ec1b260dec44fbb345fd17cd 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -24,13 +24,6 @@ if (is_debug) {
}
template("android_lint") {
- set_sources_assignment_filter([])
-
- jar_path = invoker.jar_path
- android_manifest = invoker.android_manifest
- java_files = invoker.java_files
- base_path = "$target_gen_dir/$target_name"
-
action(target_name) {
deps = []
forward_variables_from(invoker,
@@ -40,41 +33,62 @@ template("android_lint") {
"public_deps",
"testonly",
])
+ _cache_dir = "$root_build_dir/android_lint_cache"
+ _result_path = "$target_gen_dir/$target_name/result.xml"
+ _config_path = "$target_gen_dir/$target_name/config.xml"
+ _suppressions_file = "//build/android/lint/suppressions.xml"
+ _platform_xml_path =
+ "${android_sdk_root}/platform-tools/api/api-versions.xml"
+
script = "//build/android/gyp/lint.py"
- result_path = base_path + "/result.xml"
- config_path = base_path + "/config.xml"
- suppressions_file = "//build/android/lint/suppressions.xml"
+ depfile = "$target_gen_dir/$target_name.d"
inputs = [
- suppressions_file,
- android_manifest,
- jar_path,
- ] + java_files
+ _platform_xml_path,
+ _suppressions_file,
+ invoker.android_manifest,
+ ]
outputs = [
- config_path,
- result_path,
+ depfile,
+ _config_path,
+ _result_path,
]
- deps += [ "//build/android:prepare_android_lint_cache" ]
-
- rebased_java_files = rebase_path(java_files, root_build_dir)
-
args = [
"--lint-path=$rebased_android_sdk_root/tools/lint",
+ "--cache-dir",
+ rebase_path(_cache_dir, root_build_dir),
+ "--platform-xml-path",
+ rebase_path(_platform_xml_path, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--config-path",
- rebase_path(suppressions_file, root_build_dir),
+ rebase_path(_suppressions_file, root_build_dir),
"--manifest-path",
- rebase_path(android_manifest, root_build_dir),
+ rebase_path(invoker.android_manifest, root_build_dir),
"--product-dir=.",
- "--jar-path",
- rebase_path(jar_path, root_build_dir),
"--processed-config-path",
- rebase_path(config_path, root_build_dir),
+ rebase_path(_config_path, root_build_dir),
"--result-path",
- rebase_path(result_path, root_build_dir),
- "--java-files=$rebased_java_files",
+ rebase_path(_result_path, root_build_dir),
"--enable",
]
+
+ if (defined(invoker.create_cache) && invoker.create_cache) {
+ args += [
+ "--create-cache",
+ "--silent",
+ ]
+ } else {
+ inputs += [ invoker.jar_path ] + invoker.java_files
+ deps += [ "//build/android:prepare_android_lint_cache" ]
+ _rebased_java_files = rebase_path(invoker.java_files, root_build_dir)
+ args += [
+ "--jar-path",
+ rebase_path(invoker.jar_path, root_build_dir),
+ "--java-files=$_rebased_java_files",
+ ]
+ }
}
}
« build/android/gyp/lint.py ('K') | « build/android/lint_action.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698