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

Unified Diff: build/android/BUILD.gn

Issue 1815563005: [Android] Run lint using a cache in the output directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: prereview 2 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
« no previous file with comments | « no previous file | build/android/gyp/lint.py » ('j') | build/android/gyp/lint.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/BUILD.gn
diff --git a/build/android/BUILD.gn b/build/android/BUILD.gn
index 5428875d2ad04ad4658142bb7c41ce7bf610197f..bd0459f6f48b54eae478479130f708518fb396a2 100644
--- a/build/android/BUILD.gn
+++ b/build/android/BUILD.gn
@@ -7,6 +7,42 @@ import("//third_party/ijar/ijar.gni")
sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar"
+# Create or update the API versions cache if necessary by running a
+# functionally empty lint task. This prevents racy creation of the
+# cache while linting java targets in android_lint.
+action("prepare_lint_cache") {
+ cache_dir = "${root_out_dir}/lint_cache"
agrieve 2016/03/19 00:12:53 nit: can we call it "android_lint_cache"?
jbudorick 2016/03/19 00:57:42 Done.
+ depfile = "${cache_dir}/prepare_lint_cache.d"
+ manifest_file = "//build/android/AndroidManifest.xml"
agrieve 2016/03/19 00:12:53 nit: add _ prefix to these two and cache_dir so th
jbudorick 2016/03/19 00:57:42 Done.
+ result_file = "${cache_dir}/result.xml"
+ script = "//build/android/gyp/lint.py"
+
+ inputs = [
+ "${android_sdk_root}/platform-tools/api/api-versions.xml",
+ ]
+ outputs = [
+ depfile,
+ ]
+ args = [
+ "--build-tools-version",
+ android_sdk_build_tools_version,
+ "--cache-dir",
+ rebase_path(cache_dir, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--lint-path",
+ "$rebased_android_sdk_root/tools/lint",
+ "--manifest-path",
+ rebase_path(manifest_file, root_build_dir),
+ "--product-dir",
+ ".",
+ "--result-path",
+ rebase_path(result_file, root_build_dir),
+ "--silent",
+ "--enable",
+ ]
+}
+
action("find_sun_tools_jar") {
script = "//build/android/gyp/find_sun_tools_jar.py"
depfile = "$target_gen_dir/$target_name.d"
« no previous file with comments | « no previous file | build/android/gyp/lint.py » ('j') | build/android/gyp/lint.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698