Commit 46a78727 authored by mikecase's avatar mikecase Committed by Commit bot

Change what manifest and resources are passed to lint.py.

BUG=266140

Review URL: https://codereview.chromium.org/880083004

Cr-Commit-Position: refs/heads/master@{#318153}
parent 1bb2b1f8
...@@ -20,7 +20,7 @@ _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ...@@ -20,7 +20,7 @@ _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),
def _RunLint(lint_path, config_path, processed_config_path, manifest_path, def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
result_path, product_dir, sources, jar_path): result_path, product_dir, sources, jar_path, resource_dir=None):
def _RelativizePath(path): def _RelativizePath(path):
"""Returns relative path to top-level src dir. """Returns relative path to top-level src dir.
...@@ -80,6 +80,8 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path, ...@@ -80,6 +80,8 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
'--classpath', _RelativizePath(jar_path), '--classpath', _RelativizePath(jar_path),
'--xml', _RelativizePath(result_path), '--xml', _RelativizePath(result_path),
] ]
if resource_dir:
cmd.extend(['--resources', _RelativizePath(resource_dir)])
# There may be multiple source files with the same basename (but in # There may be multiple source files with the same basename (but in
# different directories). It is difficult to determine what part of the path # different directories). It is difficult to determine what part of the path
...@@ -164,6 +166,7 @@ def main(): ...@@ -164,6 +166,7 @@ def main():
parser.add_option('--src-dirs', help='Directories containing java files.') parser.add_option('--src-dirs', help='Directories containing java files.')
parser.add_option('--java-files', help='Paths to java files.') parser.add_option('--java-files', help='Paths to java files.')
parser.add_option('--jar-path', help='Jar file containing class files.') parser.add_option('--jar-path', help='Jar file containing class files.')
parser.add_option('--resource-dir', help='Path to resource dir.')
parser.add_option('--stamp', help='Path to touch on success.') parser.add_option('--stamp', help='Path to touch on success.')
parser.add_option('--enable', action='store_true', parser.add_option('--enable', action='store_true',
help='Run lint instead of just touching stamp.') help='Run lint instead of just touching stamp.')
...@@ -191,7 +194,8 @@ def main(): ...@@ -191,7 +194,8 @@ def main():
rc = _RunLint(options.lint_path, options.config_path, rc = _RunLint(options.lint_path, options.config_path,
options.processed_config_path, options.processed_config_path,
options.manifest_path, options.result_path, options.manifest_path, options.result_path,
options.product_dir, sources, options.jar_path) options.product_dir, sources, options.jar_path,
options.resource_dir)
if options.depfile: if options.depfile:
build_utils.WriteDepfile( build_utils.WriteDepfile(
......
...@@ -55,6 +55,8 @@ Still reading? ...@@ -55,6 +55,8 @@ Still reading?
<ignore path="content/shell/android/java/res/"/> <ignore path="content/shell/android/java/res/"/>
<ignore path="chrome/android/shell/res/"/> <ignore path="chrome/android/shell/res/"/>
</issue> </issue>
<issue id="InconsistentLayout" severity="ignore"/>
<issue id="InflateParams" severity="ignore"/>
<issue id="MissingApplicationIcon" severity="ignore"/> <issue id="MissingApplicationIcon" severity="ignore"/>
<issue id="MissingRegistered" severity="ignore"/> <issue id="MissingRegistered" severity="ignore"/>
<issue id="MissingVersion"> <issue id="MissingVersion">
...@@ -69,7 +71,9 @@ Still reading? ...@@ -69,7 +71,9 @@ Still reading?
<issue id="Overdraw" severity="ignore"/> <issue id="Overdraw" severity="ignore"/>
<issue id="Recycle" severity="ignore"/> <issue id="Recycle" severity="ignore"/>
<issue id="Registered" severity="ignore"/> <issue id="Registered" severity="ignore"/>
<issue id="RtlCompat" severity="ignore"/>
<issue id="RtlEnabled" severity="ignore"/> <issue id="RtlEnabled" severity="ignore"/>
<issue id="RtlSymmetry" severity="ignore"/>
<issue id="SdCardPath"> <issue id="SdCardPath">
<ignore path="content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java"/> <ignore path="content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java"/>
</issue> </issue>
...@@ -83,6 +87,8 @@ Still reading? ...@@ -83,6 +87,8 @@ Still reading?
<ignore path="chrome/android/java/res/drawable/btn_back.xml" /> <ignore path="chrome/android/java/res/drawable/btn_back.xml" />
<ignore path="chrome/android/java/res/drawable/btn_forward.xml" /> <ignore path="chrome/android/java/res/drawable/btn_forward.xml" />
</issue> </issue>
<issue id="SignatureOrSystemPermissions" severity="ignore"/>
<issue id="UnusedAttribute" severity="ignore"/>
<issue id="ViewConstructor" severity="ignore"/> <issue id="ViewConstructor" severity="ignore"/>
<issue id="WrongCall" severity="ignore"/> <issue id="WrongCall" severity="ignore"/>
</lint> </lint>
...@@ -15,13 +15,14 @@ ...@@ -15,13 +15,14 @@
}, { }, {
'is_enabled': '', 'is_enabled': '',
}] }]
] ],
'android_manifest_path%': '<(DEPTH)/build/android/AndroidManifest.xml',
'resource_dir%': '<(DEPTH)/build/android/ant/empty/res',
}, },
'inputs': [ 'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/lint.py', '<(DEPTH)/build/android/gyp/lint.py',
'<(DEPTH)/build/android/lint/suppressions.xml', '<(DEPTH)/build/android/lint/suppressions.xml',
'<(DEPTH)/build/android/AndroidManifest.xml',
'<(lint_jar_path)', '<(lint_jar_path)',
], ],
'action': [ 'action': [
...@@ -29,8 +30,9 @@ ...@@ -29,8 +30,9 @@
'--lint-path=<(android_sdk_root)/tools/lint', '--lint-path=<(android_sdk_root)/tools/lint',
'--config-path=<(DEPTH)/build/android/lint/suppressions.xml', '--config-path=<(DEPTH)/build/android/lint/suppressions.xml',
'--processed-config-path=<(config_path)', '--processed-config-path=<(config_path)',
'--manifest-path=<(DEPTH)/build/android/AndroidManifest.xml', '--manifest-path=<(android_manifest_path)',
'--result-path=<(result_path)', '--result-path=<(result_path)',
'--resource-dir=<(resource_dir)',
'--product-dir=<(PRODUCT_DIR)', '--product-dir=<(PRODUCT_DIR)',
'--src-dirs=>(src_dirs)', '--src-dirs=>(src_dirs)',
'--jar-path=<(lint_jar_path)', '--jar-path=<(lint_jar_path)',
......
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
}], }],
['has_java_resources == 1', { ['has_java_resources == 1', {
'variables': { 'variables': {
'res_dir': '<(java_in_dir)/res', 'resource_dir': '<(java_in_dir)/res',
'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], 'res_input_dirs': ['<(resource_dir)', '<@(res_extra_dirs)'],
'resource_input_paths': ['<!@(find <(res_dir) -type f)'], 'resource_input_paths': ['<!@(find <(resource_dir) -type f)'],
'R_dir': '<(intermediate_dir)/java_R', 'R_dir': '<(intermediate_dir)/java_R',
'R_text_file': '<(R_dir)/R.txt', 'R_text_file': '<(R_dir)/R.txt',
......
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