Merge "Bp2build-convert droiddoc_exported_dir" into main am: 4e86d7a342
am: 8ae2b77eaa
am: 7110fa52bb
am: 48525538f7
am: 3e8ac2464a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2734933 Change-Id: I54a898c0de6597a88632f23544ac189f234a2d85 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
0718f9863f
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/google/blueprint/proptools"
|
||||
|
||||
"android/soong/android"
|
||||
"android/soong/bazel"
|
||||
"android/soong/java/config"
|
||||
)
|
||||
|
||||
@@ -844,6 +845,7 @@ type ExportedDroiddocDirProperties struct {
|
||||
|
||||
type ExportedDroiddocDir struct {
|
||||
android.ModuleBase
|
||||
android.BazelModuleBase
|
||||
|
||||
properties ExportedDroiddocDirProperties
|
||||
|
||||
@@ -856,6 +858,7 @@ func ExportedDroiddocDirFactory() android.Module {
|
||||
module := &ExportedDroiddocDir{}
|
||||
module.AddProperties(&module.properties)
|
||||
android.InitAndroidModule(module)
|
||||
android.InitBazelModule(module)
|
||||
return module
|
||||
}
|
||||
|
||||
@@ -867,6 +870,28 @@ func (d *ExportedDroiddocDir) GenerateAndroidBuildActions(ctx android.ModuleCont
|
||||
d.deps = android.PathsForModuleSrc(ctx, []string{filepath.Join(path, "**/*")})
|
||||
}
|
||||
|
||||
// ConvertWithBp2build implements android.BazelModule.
|
||||
func (d *ExportedDroiddocDir) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
props := bazel.BazelTargetModuleProperties{
|
||||
// Use the native py_library rule.
|
||||
Rule_class: "droiddoc_exported_dir",
|
||||
Bzl_load_location: "//build/bazel/rules/droiddoc:droiddoc_exported_dir.bzl",
|
||||
}
|
||||
|
||||
type BazelAttrs struct {
|
||||
Dir *string
|
||||
Srcs bazel.LabelListAttribute
|
||||
}
|
||||
|
||||
attrs := &BazelAttrs{
|
||||
Dir: proptools.StringPtr(*d.properties.Path),
|
||||
Srcs: bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, []string{filepath.Join(*d.properties.Path, "**/*")})),
|
||||
}
|
||||
|
||||
ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: d.Name()}, attrs)
|
||||
|
||||
}
|
||||
|
||||
// Defaults
|
||||
type DocDefaults struct {
|
||||
android.ModuleBase
|
||||
|
Reference in New Issue
Block a user