Skip to content

Commit

Permalink
[BPM] [Kover] Add support for --excludeInheritedFrom flag
Browse files Browse the repository at this point in the history
Summary: [Kover] Add support for --excludeInheritedFrom flag

Test Plan: Bazel CI build

Reviewers: #ldap_mobile-platform-android

Tags: #autoland

Revert Plan: arc backout <revisionId>

JIRA Issues: MOBDROID-3738

Differential Revision: https://code.uberinternal.com/D15720567

typo
  • Loading branch information
oliviernotteghem committed Nov 21, 2024
1 parent 9d84887 commit 04c835a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kotlin/internal/jvm/kover.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def create_kover_metadata_action(
for exclude_annotation in ctx.toolchains[_TOOLCHAIN_TYPE].experimental_kover_exclude_annotation:
excludes.extend(["--excludeAnnotation", exclude_annotation])

for exclude_inherited_from in ctx.toolchains[_TOOLCHAIN_TYPE].experimental_kover_exclude_inherited_from:
excludes.extend(["--excludeInheritedFrom", exclude_inherited_from])

ctx.actions.write(kover_output_metadata_file, "\n".join([
"report",
kover_output_file.path,
Expand Down
6 changes: 6 additions & 0 deletions kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def _kotlin_toolchain_impl(ctx):
experimental_kover_agent = ctx.attr.experimental_kover_agent,
experimental_kover_exclude = ctx.attr.experimental_kover_exclude,
experimental_kover_exclude_annotation = ctx.attr.experimental_kover_exclude_annotation,
experimental_kover_exclude_inherited_from = ctx.attr.experimental_kover_exclude_inherited_from,
experimental_prune_transitive_deps = ctx.attr._experimental_prune_transitive_deps[BuildSettingInfo].value,
)

Expand Down Expand Up @@ -311,6 +312,9 @@ _kt_toolchain = rule(
"experimental_kover_exclude_annotation": attr.string_list(
doc = """List of annotation exclusions to use when generating kover reports.""",
),
"experimental_kover_exclude_inherited_from": attr.string_list(
doc = """List of annotation exclusions from inherited classes to use when generating kover reports.""",
),
"_experimental_prune_transitive_deps": attr.label(
doc = """If enabled, compilation is performed against only direct dependencies.
Transitive deps required for compilation must be explicitly added. Using
Expand Down Expand Up @@ -359,6 +363,7 @@ def define_kt_toolchain(
experimental_kover_agent = None,
experimental_kover_exclude = [],
experimental_kover_exclude_annotation = [],
experimental_kover_exclude_inherited_from = [],
javac_options = Label("//kotlin/internal:default_javac_options"),
kotlinc_options = Label("//kotlin/internal:default_kotlinc_options"),
jacocorunner = None):
Expand Down Expand Up @@ -387,6 +392,7 @@ def define_kt_toolchain(
experimental_kover_agent = experimental_kover_agent,
experimental_kover_exclude = experimental_kover_exclude,
experimental_kover_exclude_annotation = experimental_kover_exclude_annotation,
experimental_kover_exclude_inherited_from = experimental_kover_exclude_inherited_from,
javac_options = javac_options,
kotlinc_options = kotlinc_options,
visibility = ["//visibility:public"],
Expand Down

0 comments on commit 04c835a

Please sign in to comment.