support libs for android_library
adds support for *-> android_library and android_library->* edges Change-Id: I41d4e1d1b8106a17e67951d47e67b59ef3170d17 Test: manually inspected build files for libWallpaperPicker & android-suppor-v4
This commit is contained in:
25
java/aar.go
25
java/aar.go
@@ -1054,12 +1054,15 @@ func (a *AndroidLibrary) ConvertWithBp2build(ctx android.TopDownMutatorContext)
|
||||
ctx.ModuleErrorf("Module has direct dependencies but no sources. Bazel will not allow this.")
|
||||
}
|
||||
|
||||
name := a.Name()
|
||||
props := bazel.BazelTargetModuleProperties{
|
||||
Rule_class: "android_library",
|
||||
Bzl_load_location: "@rules_android//rules:rules.bzl",
|
||||
}
|
||||
|
||||
ctx.CreateBazelTargetModule(
|
||||
bazel.BazelTargetModuleProperties{
|
||||
Rule_class: "android_library",
|
||||
Bzl_load_location: "@rules_android//rules:rules.bzl",
|
||||
},
|
||||
android.CommonAttributes{Name: a.Name()},
|
||||
props,
|
||||
android.CommonAttributes{Name: name},
|
||||
&bazelAndroidLibrary{
|
||||
&javaLibraryAttributes{
|
||||
javaCommonAttributes: commonAttrs,
|
||||
@@ -1069,4 +1072,16 @@ func (a *AndroidLibrary) ConvertWithBp2build(ctx android.TopDownMutatorContext)
|
||||
a.convertAaptAttrsWithBp2Build(ctx),
|
||||
},
|
||||
)
|
||||
|
||||
neverlink := true
|
||||
ctx.CreateBazelTargetModule(
|
||||
props,
|
||||
android.CommonAttributes{Name: name + "-neverlink"},
|
||||
&bazelAndroidLibrary{
|
||||
javaLibraryAttributes: &javaLibraryAttributes{
|
||||
Neverlink: bazel.BoolAttribute{Value: &neverlink},
|
||||
Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}),
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user