Chromium Code Reviews| 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..6a7f4834665c266a40e132f406b2c633249ad457 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,69 @@ 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" |
| + _cache_file = "$_cache_dir/.android/cache/api-versions-6-${android_sdk_build_tools_version}.bin" |
| + _create_cache = defined(invoker.create_cache) && invoker.create_cache |
| + |
| 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 |
| + "${android_sdk_root}/platform-tools/api/api-versions.xml", |
| + _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) |
| + if (_create_cache) { |
| + outputs += [ _cache_file ] |
| + } else { |
| + inputs += [ |
| + _cache_file, |
| + invoker.jar_path, |
| + ] + invoker.java_files |
| + deps += [ "//build/android:prepare_android_lint_cache" ] |
| + } |
| args = [ |
| "--lint-path=$rebased_android_sdk_root/tools/lint", |
| + "--cache-dir", |
| + rebase_path(_cache_dir, root_build_dir), |
| + "--build-tools-version", |
| + android_sdk_build_tools_version, |
| + "--depfile", |
|
jbudorick
2016/03/22 19:27:22
I had issues with the depfile here previously caus
agrieve
2016/03/22 19:57:18
I haven't noticed that it does. I verified the dep
jbudorick
2016/03/22 20:36:25
Hm, maybe I had it misconfigured, then.
|
| + 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 (_create_cache) { |
|
jbudorick
2016/03/22 19:27:22
nit: What about merging the two if (_create_cache)
agrieve
2016/03/22 19:57:18
Done.
|
| + args += [ |
| + "--create-cache", |
| + "--silent", |
| + ] |
| + } else { |
| + _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", |
| + ] |
| + } |
| } |
| } |