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

Side by Side 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 unified diff | Download patch
« build/android/gyp/lint.py ('K') | « build/android/lint_action.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/sanitizers/sanitizers.gni") 6 import("//build/config/sanitizers/sanitizers.gni")
7 import("//build/config/zip.gni") 7 import("//build/config/zip.gni")
8 import("//third_party/ijar/ijar.gni") 8 import("//third_party/ijar/ijar.gni")
9 9
10 assert(is_android) 10 assert(is_android)
11 11
12 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) 12 rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
13 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) 13 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir)
14 rebased_android_sdk_build_tools = 14 rebased_android_sdk_build_tools =
15 rebase_path(android_sdk_build_tools, root_build_dir) 15 rebase_path(android_sdk_build_tools, root_build_dir)
16 16
17 android_sdk_jar = "$android_sdk/android.jar" 17 android_sdk_jar = "$android_sdk/android.jar"
18 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) 18 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
19 android_default_aapt_path = "$rebased_android_sdk_build_tools/aapt" 19 android_default_aapt_path = "$rebased_android_sdk_build_tools/aapt"
20 20
21 android_configuration_name = "Release" 21 android_configuration_name = "Release"
22 if (is_debug) { 22 if (is_debug) {
23 android_configuration_name = "Debug" 23 android_configuration_name = "Debug"
24 } 24 }
25 25
26 template("android_lint") { 26 template("android_lint") {
27 set_sources_assignment_filter([])
28
29 jar_path = invoker.jar_path
30 android_manifest = invoker.android_manifest
31 java_files = invoker.java_files
32 base_path = "$target_gen_dir/$target_name"
33
34 action(target_name) { 27 action(target_name) {
35 deps = [] 28 deps = []
36 forward_variables_from(invoker, 29 forward_variables_from(invoker,
37 [ 30 [
38 "deps", 31 "deps",
39 "data_deps", 32 "data_deps",
40 "public_deps", 33 "public_deps",
41 "testonly", 34 "testonly",
42 ]) 35 ])
36 _cache_dir = "$root_build_dir/android_lint_cache"
37 _result_path = "$target_gen_dir/$target_name/result.xml"
38 _config_path = "$target_gen_dir/$target_name/config.xml"
39 _suppressions_file = "//build/android/lint/suppressions.xml"
40 _platform_xml_path =
41 "${android_sdk_root}/platform-tools/api/api-versions.xml"
42
43 script = "//build/android/gyp/lint.py" 43 script = "//build/android/gyp/lint.py"
44 result_path = base_path + "/result.xml" 44 depfile = "$target_gen_dir/$target_name.d"
45 config_path = base_path + "/config.xml"
46 suppressions_file = "//build/android/lint/suppressions.xml"
47 inputs = [ 45 inputs = [
48 suppressions_file, 46 _platform_xml_path,
49 android_manifest, 47 _suppressions_file,
50 jar_path, 48 invoker.android_manifest,
51 ] + java_files 49 ]
52 50
53 outputs = [ 51 outputs = [
54 config_path, 52 depfile,
55 result_path, 53 _config_path,
54 _result_path,
56 ] 55 ]
57 56
58 deps += [ "//build/android:prepare_android_lint_cache" ]
59
60 rebased_java_files = rebase_path(java_files, root_build_dir)
61
62 args = [ 57 args = [
63 "--lint-path=$rebased_android_sdk_root/tools/lint", 58 "--lint-path=$rebased_android_sdk_root/tools/lint",
59 "--cache-dir",
60 rebase_path(_cache_dir, root_build_dir),
61 "--platform-xml-path",
62 rebase_path(_platform_xml_path, root_build_dir),
63 "--depfile",
64 rebase_path(depfile, root_build_dir),
64 "--config-path", 65 "--config-path",
65 rebase_path(suppressions_file, root_build_dir), 66 rebase_path(_suppressions_file, root_build_dir),
66 "--manifest-path", 67 "--manifest-path",
67 rebase_path(android_manifest, root_build_dir), 68 rebase_path(invoker.android_manifest, root_build_dir),
68 "--product-dir=.", 69 "--product-dir=.",
69 "--jar-path",
70 rebase_path(jar_path, root_build_dir),
71 "--processed-config-path", 70 "--processed-config-path",
72 rebase_path(config_path, root_build_dir), 71 rebase_path(_config_path, root_build_dir),
73 "--result-path", 72 "--result-path",
74 rebase_path(result_path, root_build_dir), 73 rebase_path(_result_path, root_build_dir),
75 "--java-files=$rebased_java_files",
76 "--enable", 74 "--enable",
77 ] 75 ]
76
77 if (defined(invoker.create_cache) && invoker.create_cache) {
78 args += [
79 "--create-cache",
80 "--silent",
81 ]
82 } else {
83 inputs += [ invoker.jar_path ] + invoker.java_files
84 deps += [ "//build/android:prepare_android_lint_cache" ]
85 _rebased_java_files = rebase_path(invoker.java_files, root_build_dir)
86 args += [
87 "--jar-path",
88 rebase_path(invoker.jar_path, root_build_dir),
89 "--java-files=$_rebased_java_files",
90 ]
91 }
78 } 92 }
79 } 93 }
80 94
81 template("proguard") { 95 template("proguard") {
82 action(target_name) { 96 action(target_name) {
83 set_sources_assignment_filter([]) 97 set_sources_assignment_filter([])
84 forward_variables_from(invoker, 98 forward_variables_from(invoker,
85 [ 99 [
86 "deps", 100 "deps",
87 "data_deps", 101 "data_deps",
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 ] 2184 ]
2171 args = [ 2185 args = [
2172 "--depfile", 2186 "--depfile",
2173 rebase_path(depfile, root_build_dir), 2187 rebase_path(depfile, root_build_dir),
2174 "--script-output-path", 2188 "--script-output-path",
2175 rebase_path(generated_script, root_build_dir), 2189 rebase_path(generated_script, root_build_dir),
2176 ] 2190 ]
2177 args += test_runner_args 2191 args += test_runner_args
2178 } 2192 }
2179 } 2193 }
OLDNEW
« 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