diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go index fe4df7520..b751b9a31 100644 --- a/java/java.go +++ b/java/java.go @@ -815,7 +815,10 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo // If the min_sdk_version was set then add the canonical representation of the API level to the // snapshot. if j.deviceProperties.Min_sdk_version != nil { - canonical := android.ReplaceFinalizedCodenames(ctx.SdkModuleContext().Config(), j.minSdkVersion.String()) + canonical, err := android.ReplaceFinalizedCodenames(ctx.SdkModuleContext().Config(), j.minSdkVersion.String()) + if err != nil { + ctx.ModuleErrorf("%s", err) + } p.MinSdkVersion = proptools.StringPtr(canonical) } @@ -2707,8 +2710,13 @@ func (m *Library) convertJavaResourcesAttributes(ctx android.TopDownMutatorConte var resources bazel.LabelList var resourceStripPrefix *string + if m.properties.Java_resources != nil && len(m.properties.Java_resource_dirs) > 0 { + ctx.ModuleErrorf("bp2build doesn't support both java_resources and java_resource_dirs being set on the same module.") + } + if m.properties.Java_resources != nil { resources.Append(android.BazelLabelForModuleSrc(ctx, m.properties.Java_resources)) + resourceStripPrefix = proptools.StringPtr(ctx.ModuleDir()) } //TODO(b/179889880) handle case where glob includes files outside package @@ -2839,7 +2847,7 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) return android.IsConvertedToAidlLibrary(ctx, src.OriginalModuleName) }) - apexAvailableTags := android.ApexAvailableTags(ctx.Module()) + apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx, ctx.Module()) if !aidlSrcs.IsEmpty() { aidlLibName := m.Name() + "_aidl_library" |