diff options
Diffstat (limited to 'java/bootclasspath_fragment.go')
-rw-r--r-- | java/bootclasspath_fragment.go | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index eddcb61f9..c3a5d5f70 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -140,7 +140,7 @@ type bootclasspathFragmentProperties struct { BootclasspathFragmentsDepsProperties } -type SourceOnlyBootclasspathProperties struct { +type HiddenApiPackageProperties struct { Hidden_api struct { // Contains prefixes of a package hierarchy that is provided solely by this // bootclasspath_fragment. @@ -149,6 +149,14 @@ type SourceOnlyBootclasspathProperties struct { // hidden API flags. See split_packages property for more details. Package_prefixes []string + // A list of individual packages that are provided solely by this + // bootclasspath_fragment but which cannot be listed in package_prefixes + // because there are sub-packages which are provided by other modules. + // + // This should only be used for legacy packages. New packages should be + // covered by a package prefix. + Single_packages []string + // The list of split packages provided by this bootclasspath_fragment. // // A split package is one that contains classes which are provided by multiple @@ -208,6 +216,11 @@ type SourceOnlyBootclasspathProperties struct { } } +type SourceOnlyBootclasspathProperties struct { + HiddenApiPackageProperties + Coverage HiddenApiPackageProperties +} + type BootclasspathFragmentModule struct { android.ModuleBase android.ApexModuleBase @@ -271,6 +284,12 @@ func bootclasspathFragmentFactory() android.Module { ctx.PropertyErrorf("coverage", "error trying to append coverage specific properties: %s", err) return } + + err = proptools.AppendProperties(&m.sourceOnlyProperties.HiddenApiPackageProperties, &m.sourceOnlyProperties.Coverage, nil) + if err != nil { + ctx.PropertyErrorf("coverage", "error trying to append hidden api coverage specific properties: %s", err) + return + } } // Initialize the contents property from the image_name. @@ -731,7 +750,8 @@ func (b *BootclasspathFragmentModule) generateHiddenAPIBuildActions(ctx android. // TODO(b/192868581): Remove once the source and prebuilts provide a signature patterns file of // their own. if output.SignaturePatternsPath == nil { - output.SignaturePatternsPath = buildRuleSignaturePatternsFile(ctx, output.AllFlagsPath, []string{"*"}, nil) + output.SignaturePatternsPath = buildRuleSignaturePatternsFile( + ctx, output.AllFlagsPath, []string{"*"}, nil, nil) } // Initialize a HiddenAPIInfo structure. @@ -806,11 +826,13 @@ func (b *BootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleC // signature patterns. splitPackages := b.sourceOnlyProperties.Hidden_api.Split_packages packagePrefixes := b.sourceOnlyProperties.Hidden_api.Package_prefixes - if splitPackages != nil || packagePrefixes != nil { + 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) + output.SignaturePatternsPath = buildRuleSignaturePatternsFile( + ctx, output.AllFlagsPath, splitPackages, packagePrefixes, singlePackages) } return output |