diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go index 4f7b4014a..a8793fe87 100644 --- a/java/java.go +++ b/java/java.go @@ -2813,6 +2813,14 @@ type bp2BuildJavaInfo struct { hasKotlin bool } +// Replaces //a/b/my_xsd_config with //a/b/my_xsd_config-java +func xsdConfigJavaTarget(ctx android.BazelConversionPathContext, mod blueprint.Module) string { + callback := func(xsd android.XsdConfigBp2buildTargets) string { + return xsd.JavaBp2buildTargetName() + } + return android.XsdConfigBp2buildTarget(ctx, mod, callback) +} + // convertLibraryAttrsBp2Build returns a javaCommonAttributes struct with // converted attributes shared across java_* modules and a bp2BuildJavaInfo struct // which has other non-attribute information needed for bp2build conversion @@ -2827,8 +2835,15 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) for axis, configToProps := range archVariantProps { for config, _props := range configToProps { if archProps, ok := _props.(*CommonProperties); ok { - archSrcs := android.BazelLabelForModuleSrcExcludes(ctx, archProps.Srcs, archProps.Exclude_srcs) + srcsNonXsd, srcsXsd := android.PartitionXsdSrcs(ctx, archProps.Srcs) + excludeSrcsNonXsd, _ := android.PartitionXsdSrcs(ctx, archProps.Exclude_srcs) + archSrcs := android.BazelLabelForModuleSrcExcludes(ctx, srcsNonXsd, excludeSrcsNonXsd) srcs.SetSelectValue(axis, config, archSrcs) + + // Add to static deps + xsdJavaConfigLibraryLabels := android.BazelLabelForModuleDepsWithFn(ctx, srcsXsd, xsdConfigJavaTarget) + staticDeps.Append(xsdJavaConfigLibraryLabels) + } } } |