Merge changes I09902215,I4f86780c

* changes:
  convert java_plugin with bp2build
  convert java static dependencies
This commit is contained in:
Sam Delmerico
2022-02-02 14:27:32 +00:00
committed by Gerrit Code Review
5 changed files with 139 additions and 8 deletions

View File

@@ -2010,7 +2010,7 @@ type javaLibraryAttributes struct {
Javacopts bazel.StringListAttribute
}
func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) {
func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) *javaLibraryAttributes {
srcs := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs))
attrs := &javaLibraryAttributes{
Srcs: srcs,
@@ -2020,9 +2020,21 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) {
attrs.Javacopts = bazel.MakeStringListAttribute(m.properties.Javacflags)
}
var deps bazel.LabelList
if m.properties.Libs != nil {
attrs.Deps = bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, m.properties.Libs))
deps.Append(android.BazelLabelForModuleDeps(ctx, m.properties.Libs))
}
if m.properties.Static_libs != nil {
//TODO(b/217236083) handle static libs similarly to Soong
deps.Append(android.BazelLabelForModuleDeps(ctx, m.properties.Static_libs))
}
attrs.Deps = bazel.MakeLabelListAttribute(deps)
return attrs
}
func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) {
attrs := m.convertLibraryAttrsBp2Build(ctx)
props := bazel.BazelTargetModuleProperties{
Rule_class: "java_library",