Skip to content

Commit 0768997

Browse files
committed
adding html_support
1 parent 80a6d08 commit 0768997

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

rules/impl.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def _run_android_lint(
2020
android_lint,
2121
module_name,
2222
output,
23+
html_output,
2324
srcs,
2425
deps,
2526
resource_files,
@@ -63,7 +64,7 @@ def _run_android_lint(
6364
android_lint_skip_bytecode_verifier: Disables bytecode verification
6465
"""
6566
inputs = []
66-
outputs = [output]
67+
outputs = [output, html_output]
6768

6869
args = ctx.actions.args()
6970
args.set_param_file_format("multiline")
@@ -118,6 +119,13 @@ def _run_android_lint(
118119
args.add("--output", output)
119120
outputs.append(output)
120121

122+
args.add("--html-output", html_output)
123+
outputs.append(html_output)
124+
125+
label = ctx.attr.android_home.label
126+
if ctx.attr.android_home:
127+
args.add("--android_home", label.workspace_root)
128+
121129
ctx.actions.run(
122130
mnemonic = "AndroidLint",
123131
inputs = inputs,
@@ -198,11 +206,13 @@ def process_android_lint_issues(ctx, regenerate):
198206
)
199207

200208
output = ctx.actions.declare_file("{}.xml".format(ctx.label.name))
209+
html_output = ctx.actions.declare_file("{}.html".format(ctx.label.name))
201210
_run_android_lint(
202211
ctx,
203212
android_lint = _utils.only(_utils.list_or_depset_to_list(_utils.get_android_lint_toolchain(ctx).android_lint.files)),
204213
module_name = _get_module_name(ctx),
205214
output = output,
215+
html_output = html_output,
206216
srcs = ctx.files.srcs,
207217
deps = depset(transitive = deps),
208218
resource_files = ctx.files.resource_files,

src/cli/AndroidLintActionArgs.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ internal class AndroidLintActionArgs(
3838
transform = argsParserPathTransformer,
3939
)
4040

41+
val htmlOutput: Path by parser.storing(
42+
names = arrayOf("--html-output"),
43+
help = "",
44+
transform = argsParserPathTransformer,
45+
)
46+
4147
val resources: List<Path> by parser.adding(
4248
names = arrayOf("--resource"),
4349
help = "",

src/cli/AndroidLintRunner.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ internal class AndroidLintRunner {
9797
projectFilePath.pathString,
9898
"--xml",
9999
actionArgs.output.pathString,
100+
"--html",
101+
actionArgs.htmlOutput.pathString,
100102
"--exitcode",
101103
"--compile-sdk-version",
102104
actionArgs.compileSdkVersion,

0 commit comments

Comments
 (0)