Merge "Remove updatable-bcp-packages.txt." am: a14b18fb31
am: b9e3166b14
am: 4d0288d834
am: 6931fd6d16
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832483 Change-Id: I9d2a73766f56c6e7076437a3a0e20377f1688f36
This commit is contained in:
@@ -16,7 +16,6 @@ package java
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"android/soong/android"
|
||||
@@ -812,40 +811,6 @@ func bootFrameworkProfileRule(ctx android.ModuleContext, image *bootImageConfig)
|
||||
return profile
|
||||
}
|
||||
|
||||
// generateUpdatableBcpPackagesRule generates the rule to create the updatable-bcp-packages.txt file
|
||||
// and returns a path to the generated file.
|
||||
func generateUpdatableBcpPackagesRule(ctx android.ModuleContext, image *bootImageConfig, apexModules []android.Module) android.WritablePath {
|
||||
// Collect `permitted_packages` for updatable boot jars.
|
||||
var updatablePackages []string
|
||||
for _, module := range apexModules {
|
||||
if j, ok := module.(PermittedPackagesForUpdatableBootJars); ok {
|
||||
pp := j.PermittedPackagesForUpdatableBootJars()
|
||||
if len(pp) > 0 {
|
||||
updatablePackages = append(updatablePackages, pp...)
|
||||
} else {
|
||||
ctx.OtherModuleErrorf(module, "Missing permitted_packages")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort updatable packages to ensure deterministic ordering.
|
||||
sort.Strings(updatablePackages)
|
||||
|
||||
updatableBcpPackagesName := "updatable-bcp-packages.txt"
|
||||
updatableBcpPackages := image.dir.Join(ctx, updatableBcpPackagesName)
|
||||
|
||||
// WriteFileRule automatically adds the last end-of-line.
|
||||
android.WriteFileRule(ctx, updatableBcpPackages, strings.Join(updatablePackages, "\n"))
|
||||
|
||||
rule := android.NewRuleBuilder(pctx, ctx)
|
||||
rule.Install(updatableBcpPackages, "/system/etc/"+updatableBcpPackagesName)
|
||||
// TODO: Rename `profileInstalls` to `extraInstalls`?
|
||||
// Maybe even move the field out of the bootImageConfig into some higher level type?
|
||||
image.profileInstalls = append(image.profileInstalls, rule.Installs()...)
|
||||
|
||||
return updatableBcpPackages
|
||||
}
|
||||
|
||||
func dumpOatRules(ctx android.ModuleContext, image *bootImageConfig) {
|
||||
var allPhonies android.Paths
|
||||
for _, image := range image.variants {
|
||||
|
@@ -1173,7 +1173,6 @@ type ImportProperties struct {
|
||||
Installable *bool
|
||||
|
||||
// If not empty, classes are restricted to the specified packages and their sub-packages.
|
||||
// This information is used to generate the updatable-bcp-packages.txt file.
|
||||
Permitted_packages []string
|
||||
|
||||
// List of shared java libs that this module has dependencies to
|
||||
|
@@ -424,14 +424,6 @@ func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.
|
||||
// Generate the framework profile rule
|
||||
bootFrameworkProfileRule(ctx, imageConfig)
|
||||
|
||||
// If always using prebuilt sdks then do not generate the updatable-bcp-packages.txt file as it
|
||||
// will break because the prebuilts do not yet specify a permitted_packages property.
|
||||
// TODO(b/193889859): Remove when the prebuilts have been updated.
|
||||
if !ctx.Config().AlwaysUsePrebuiltSdks() {
|
||||
// Generate the updatable bootclasspath packages rule.
|
||||
generateUpdatableBcpPackagesRule(ctx, imageConfig, apexModules)
|
||||
}
|
||||
|
||||
// Copy platform module dex jars to their predefined locations.
|
||||
platformBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, platformModules)
|
||||
copyBootJarsToPredefinedLocations(ctx, platformBootDexJarsByModule, imageConfig.dexPathsByModule)
|
||||
|
@@ -1911,7 +1911,6 @@ type sdkLibraryImportProperties struct {
|
||||
Compile_dex *bool
|
||||
|
||||
// If not empty, classes are restricted to the specified packages and their sub-packages.
|
||||
// This information is used to generate the updatable-bcp-packages.txt file.
|
||||
Permitted_packages []string
|
||||
}
|
||||
|
||||
|
@@ -539,12 +539,6 @@ sdk_snapshot {
|
||||
snapshot/hiddenapi/index.csv
|
||||
`, rule)
|
||||
|
||||
// Make sure that the permitted packages from the prebuilts end up in the
|
||||
// updatable-bcp-packages.txt file.
|
||||
rule = module.Output("updatable-bcp-packages.txt")
|
||||
expectedContents := `'mybootlib\nmyothersdklibrary\n'`
|
||||
android.AssertStringEquals(t, "updatable-bcp-packages.txt", expectedContents, rule.Args["content"])
|
||||
|
||||
rule = module.Output("out/soong/hiddenapi/hiddenapi-flags.csv.valid")
|
||||
android.AssertStringDoesContain(t, "verify-overlaps", rule.RuleParams.Command, " snapshot/hiddenapi/filtered-flags.csv:snapshot/hiddenapi/signature-patterns.csv ")
|
||||
}),
|
||||
|
Reference in New Issue
Block a user