Skip to content

Commit bddd6d2

Browse files
committed
adding html_support
1 parent e1d20bb commit bddd6d2

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")
@@ -116,6 +117,13 @@ def _run_android_lint(
116117
args.add("--output", output)
117118
outputs.append(output)
118119

120+
args.add("--html-output", html_output)
121+
outputs.append(html_output)
122+
123+
label = ctx.attr.android_home.label
124+
if ctx.attr.android_home:
125+
args.add("--android_home", label.workspace_root)
126+
119127
ctx.actions.run(
120128
mnemonic = "AndroidLint",
121129
inputs = inputs,
@@ -196,11 +204,13 @@ def process_android_lint_issues(ctx, regenerate):
196204
)
197205

198206
output = ctx.actions.declare_file("{}.xml".format(ctx.label.name))
207+
html_output = ctx.actions.declare_file("{}.html".format(ctx.label.name))
199208
_run_android_lint(
200209
ctx,
201210
android_lint = _utils.only(_utils.list_or_depset_to_list(_utils.get_android_lint_toolchain(ctx).android_lint.files)),
202211
module_name = _get_module_name(ctx),
203212
output = output,
213+
html_output = html_output,
204214
srcs = ctx.files.srcs,
205215
deps = depset(transitive = deps),
206216
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
@@ -95,6 +95,8 @@ internal class AndroidLintRunner {
9595
projectFilePath.pathString,
9696
"--xml",
9797
actionArgs.output.pathString,
98+
"--html",
99+
actionArgs.htmlOutput.pathString,
98100
"--exitcode",
99101
"--compile-sdk-version",
100102
actionArgs.compileSdkVersion,

0 commit comments

Comments
 (0)