summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-01-09 07:54:41 +0000
committer Jihoon Kang <jihoonkang@google.com> 2025-01-09 07:58:04 +0000
commit2b13370ee83b13998f14b7e862c6c547a13dfdc4 (patch)
tree095f97e82b8106b1e2c122d20bc7a6c4db398c1c
parent44670268657b495ea803001cb22b1abd70297a6a (diff)
Fix sdk lib impl lib collection in platform_bootclasspath
https://r.android.com/2757569 accidentally led to visiting the sdk library impl lib direct deps with the wrong dependency tag, leading to the transitive source files not being properly collected in the generated srcjar file in platform bootclasspath. This change fixes the issue by collecting the dependency using the correct tag. Test: go test ./java Change-Id: I1be37be1af7b13860d5c0ec99c3567100e5158bd
-rw-r--r--java/platform_bootclasspath.go2
-rw-r--r--java/platform_bootclasspath_test.go7
2 files changed, 7 insertions, 2 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go
index d09a02e50..152eb1eeb 100644
--- a/java/platform_bootclasspath.go
+++ b/java/platform_bootclasspath.go
@@ -172,7 +172,7 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
// Do not add implLibModule to allModules as the impl lib is only used to collect the
// transitive source files
var implLibModule []android.Module
- ctx.VisitDirectDepsWithTag(implLibraryTag, func(m android.Module) {
+ ctx.VisitDirectDepsWithTag(platformBootclasspathImplLibDepTag, func(m android.Module) {
implLibModule = append(implLibModule, m)
})
diff --git a/java/platform_bootclasspath_test.go b/java/platform_bootclasspath_test.go
index f2768dbe3..1f691a019 100644
--- a/java/platform_bootclasspath_test.go
+++ b/java/platform_bootclasspath_test.go
@@ -30,18 +30,23 @@ func TestPlatformBootclasspath(t *testing.T) {
preparer := android.GroupFixturePreparers(
prepareForTestWithPlatformBootclasspath,
FixtureConfigureBootJars("platform:foo", "system_ext:bar"),
+ android.FixtureMergeMockFs(android.MockFS{
+ "api/current.txt": nil,
+ "api/removed.txt": nil,
+ }),
android.FixtureWithRootAndroidBp(`
platform_bootclasspath {
name: "platform-bootclasspath",
}
- java_library {
+ java_sdk_library {
name: "bar",
srcs: ["a.java"],
system_modules: "none",
sdk_version: "none",
compile_dex: true,
system_ext_specific: true,
+ unsafe_ignore_missing_latest_api: true,
}
`),
)