Merge "bootclasspath_fragment: Require at least one hidden_api package property" am: 4a737a2d8b am: 811d444ce1

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2062450

Change-Id: I0e4673a5d702427d752e3e413bae96454b601207
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-06-06 18:33:18 +00:00
committed by Automerger Merge Worker
8 changed files with 120 additions and 3 deletions

View File

@@ -862,11 +862,18 @@ func (b *BootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleC
packagePrefixes := b.sourceOnlyProperties.Hidden_api.Package_prefixes
singlePackages := b.sourceOnlyProperties.Hidden_api.Single_packages
if splitPackages != nil || packagePrefixes != nil || singlePackages != nil {
if splitPackages == nil {
splitPackages = []string{"*"}
}
output.SignaturePatternsPath = buildRuleSignaturePatternsFile(
ctx, output.AllFlagsPath, splitPackages, packagePrefixes, singlePackages)
} else if !b.isTestFragment() {
ctx.ModuleErrorf(`Must specify at least one of the split_packages, package_prefixes and single_packages properties
If this is a new bootclasspath_fragment or you are unsure what to do add the
the following to the bootclasspath_fragment:
hidden_api: {split_packages: ["*"]},
and then run the following:
m analyze_bcpf && analyze_bcpf --bcpf %q
it will analyze the bootclasspath_fragment and provide hints as to what you
should specify here. If you are happy with its suggestions then you can add
the --fix option and it will fix them for you.`, b.BaseModuleName())
}
return output