diff options
| author | Alix <agespino@google.com> | 2022-12-15 06:12:46 +0000 |
|---|---|---|
| committer | Alix <agespino@google.com> | 2022-12-15 06:27:59 +0000 |
| commit | 266bbf2f9c82c9acda9e47ec4047b3ed94f8a80d (patch) | |
| tree | 30e091b614a3220d3f269da93a382687c384afce /java/java.go | |
| parent | ccfe6022d445b1fecc161c073033ef3e999a3b41 (diff) | |
Libs support for * -> java_library_edge with kt sources
Bug: 244210934
Test: bo2build tests and built kotlinx_atomicfu
Change-Id: Id6eac2f104878e4d7902a32e846ef1cc87dd7863
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/java/java.go b/java/java.go index 9dd585062..54b15f80e 100644 --- a/java/java.go +++ b/java/java.go @@ -2710,14 +2710,6 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) { Rule_class: "java_library", Bzl_load_location: "//build/bazel/rules/java:library.bzl", } - - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) - neverlinkProp := true - neverLinkAttrs := &javaLibraryAttributes{ - Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}), - Neverlink: bazel.BoolAttribute{Value: &neverlinkProp}, - } - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name + "-neverlink"}, neverLinkAttrs) } else { attrs.Common_srcs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs)) @@ -2725,10 +2717,16 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) { Rule_class: "kt_jvm_library", Bzl_load_location: "@rules_kotlin//kotlin:jvm_library.bzl", } - // TODO (b/244210934): create neverlink-duplicate target once kt_jvm_library supports neverlink attribute - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) } + ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) + neverlinkProp := true + neverLinkAttrs := &javaLibraryAttributes{ + Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}), + Neverlink: bazel.BoolAttribute{Value: &neverlinkProp}, + } + ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name + "-neverlink"}, neverLinkAttrs) + } type javaBinaryHostAttributes struct { |
