Skip to content

Commit c565344

Browse files
brettchabotcopybara-androidxtest
authored andcommitted
Exclude external maven dependencies source from apk source jar.
A new version of bazel apparently started including source jars from maven dependencies into the transitive_source_jars depset. Add temporary logic to filter out those source jars for now, to fix errors with duplicate kotlin stdlib source being added. PiperOrigin-RevId: 534494589
1 parent eb66819 commit c565344

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_extensions/maven/axt_maven_apk.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ load("//build_extensions/maven:maven_info.bzl", "MavenFilesInfo", "MavenInfo")
55

66
def _axt_maven_apk_impl(ctx):
77
# produce src jar
8+
# hack - exclude source jars from external maven artifacts
9+
# TODO(b/283992063): use an aspect to gather this info
10+
axt_jars = [jar for jar in ctx.attr.included_dep[JavaInfo].transitive_source_jars.to_list() if "maven.org" not in jar.path]
811
combine_jars(
912
ctx = ctx,
10-
input_jars_deps = ctx.attr.included_dep[JavaInfo].transitive_source_jars,
13+
input_jars_deps = axt_jars,
1114
output = ctx.outputs.src_jar,
1215
)
1316

0 commit comments

Comments
 (0)