diff options
| author | 2023-03-03 19:22:15 +0000 | |
|---|---|---|
| committer | 2023-03-03 23:07:51 +0000 | |
| commit | 5afd9fad98f5a30edae4f8f23044d4be6ab73fc6 (patch) | |
| tree | ae50faae735e9fe4189064b598a6f16102ad4130 /java | |
| parent | 4d56abf9375f6b6b0f945bfd725036c19e8d08a7 (diff) | |
code cleanup for bp2build java_binary with kt srcs
there is now support for resoure_strip_prefix in kt_jvm_library targets.
Test: built AnalyzerKt and updated go ./bp2build tests
Change-Id: I4a6fe45276d45519186b6f40a02db990511d6def
Diffstat (limited to 'java')
| -rw-r--r-- | java/java.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/java/java.go b/java/java.go index 574709169..6a764cfe9 100644 --- a/java/java.go +++ b/java/java.go @@ -2938,9 +2938,10 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) { ktAttrs := &javaLibraryAttributes{ Deps: deps, javaCommonAttributes: &javaCommonAttributes{ - Srcs: commonAttrs.Srcs, - Plugins: commonAttrs.Plugins, - Javacopts: commonAttrs.Javacopts, + Srcs: commonAttrs.Srcs, + Plugins: commonAttrs.Plugins, + Javacopts: commonAttrs.Javacopts, + javaResourcesAttributes: commonAttrs.javaResourcesAttributes, }, } @@ -2948,19 +2949,6 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) { ktAttrs.javaCommonAttributes.Common_srcs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs)) } - // kt_jvm_library does not support resource_strip_prefix, if this attribute - // is set, than javaResourcesAttributes needs to be set in the - // javaCommonAttributes of the java_binary target - if commonAttrs.javaResourcesAttributes != nil { - if commonAttrs.javaResourcesAttributes.Resource_strip_prefix != nil { - attrs.javaCommonAttributes = &javaCommonAttributes{ - javaResourcesAttributes: commonAttrs.javaResourcesAttributes, - } - } else { - ktAttrs.javaCommonAttributes.javaResourcesAttributes = commonAttrs.javaResourcesAttributes - } - } - ctx.CreateBazelTargetModule(ktProps, android.CommonAttributes{Name: ktName}, ktAttrs) attrs.Runtime_deps.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + ktName}}) } |