bp2build: convert paths/module refs to Bazel label

This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
This commit is contained in:
Liz Kammer
2021-01-26 09:18:53 -05:00
parent aef038aac1
commit 356f7d45c1
27 changed files with 734 additions and 154 deletions

View File

@@ -219,13 +219,17 @@ func (library *libraryDecorator) setSource() {
library.MutatedProperties.VariantIsSource = true
}
func (library *libraryDecorator) autoDep(ctx BaseModuleContext) autoDep {
func (library *libraryDecorator) autoDep(ctx android.BottomUpMutatorContext) autoDep {
if library.preferRlib() {
return rlibAutoDep
} else if library.rlib() || library.static() {
return rlibAutoDep
} else if library.dylib() || library.shared() {
return dylibAutoDep
} else if ctx.BazelConversionMode() {
// In Bazel conversion mode, we are currently ignoring the deptag, so we just need to supply a
// compatible tag in order to add the dependency.
return rlibAutoDep
} else {
panic(fmt.Errorf("autoDep called on library %q that has no enabled variants.", ctx.ModuleName()))
}