Rename UpdatableBootJars to ApexBootJars.
Note that ART apex boot jars and core-icu4j are exceptions here as they are not part of ApexBootJars. ART apex boot jars are defined in their own variable, while core-icu4j is treated as a regular non-updatable boot jar. Bug: 191127295 Test: atest CtsClasspathsTestCases Change-Id: I3cea3d82ef521655a1a5ffa8cae2258ab9d08bfc
This commit is contained in:
@@ -1847,16 +1847,16 @@ var earlyBootJarsKey = NewOnceKey("earlyBootJars")
|
||||
func (c *config) BootJars() []string {
|
||||
return c.Once(earlyBootJarsKey, func() interface{} {
|
||||
list := c.productVariables.BootJars.CopyOfJars()
|
||||
return append(list, c.productVariables.UpdatableBootJars.CopyOfJars()...)
|
||||
return append(list, c.productVariables.ApexBootJars.CopyOfJars()...)
|
||||
}).([]string)
|
||||
}
|
||||
|
||||
func (c *config) NonUpdatableBootJars() ConfiguredJarList {
|
||||
func (c *config) NonApexBootJars() ConfiguredJarList {
|
||||
return c.productVariables.BootJars
|
||||
}
|
||||
|
||||
func (c *config) UpdatableBootJars() ConfiguredJarList {
|
||||
return c.productVariables.UpdatableBootJars
|
||||
func (c *config) ApexBootJars() ConfiguredJarList {
|
||||
return c.productVariables.ApexBootJars
|
||||
}
|
||||
|
||||
func (c *config) RBEWrapper() string {
|
||||
|
@@ -253,7 +253,7 @@ type productVariables struct {
|
||||
ModulesLoadedByPrivilegedModules []string `json:",omitempty"`
|
||||
|
||||
BootJars ConfiguredJarList `json:",omitempty"`
|
||||
UpdatableBootJars ConfiguredJarList `json:",omitempty"`
|
||||
ApexBootJars ConfiguredJarList `json:",omitempty"`
|
||||
|
||||
IntegerOverflowExcludePaths []string `json:",omitempty"`
|
||||
|
||||
@@ -443,7 +443,7 @@ func (v *productVariables) SetDefaultConfig() {
|
||||
Safestack: boolPtr(false),
|
||||
|
||||
BootJars: ConfiguredJarList{apexes: []string{}, jars: []string{}},
|
||||
UpdatableBootJars: ConfiguredJarList{apexes: []string{}, jars: []string{}},
|
||||
ApexBootJars: ConfiguredJarList{apexes: []string{}, jars: []string{}},
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
|
@@ -7194,7 +7194,7 @@ func TestDexpreoptAccessDexFilesFromPrebuiltApex(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func testApexPermittedPackagesRules(t *testing.T, errmsg, bp string, apexBootJars []string, rules []android.Rule) {
|
||||
func testApexPermittedPackagesRules(t *testing.T, errmsg, bp string, bootJars []string, rules []android.Rule) {
|
||||
t.Helper()
|
||||
bp += `
|
||||
apex_key {
|
||||
@@ -7219,11 +7219,11 @@ func testApexPermittedPackagesRules(t *testing.T, errmsg, bp string, apexBootJar
|
||||
PrepareForTestWithApexBuildComponents,
|
||||
android.PrepareForTestWithNeverallowRules(rules),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
updatableBootJars := make([]string, 0, len(apexBootJars))
|
||||
for _, apexBootJar := range apexBootJars {
|
||||
updatableBootJars = append(updatableBootJars, "myapex:"+apexBootJar)
|
||||
apexBootJars := make([]string, 0, len(bootJars))
|
||||
for _, apexBootJar := range bootJars {
|
||||
apexBootJars = append(apexBootJars, "myapex:"+apexBootJar)
|
||||
}
|
||||
variables.UpdatableBootJars = android.CreateTestConfiguredJarList(updatableBootJars)
|
||||
variables.ApexBootJars = android.CreateTestConfiguredJarList(apexBootJars)
|
||||
}),
|
||||
fs.AddToFixture(),
|
||||
).
|
||||
|
@@ -734,7 +734,7 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
|
||||
prepareForTestWithMyapex,
|
||||
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:foo", "myapex:bar"),
|
||||
java.FixtureConfigureApexBootJars("myapex:foo", "myapex:bar"),
|
||||
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
||||
// is disabled.
|
||||
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
||||
|
@@ -173,7 +173,7 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
||||
prepareForTestWithMyapex,
|
||||
// Configure some libraries in the art and framework boot images.
|
||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "platform:foo"),
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:bar"),
|
||||
java.FixtureConfigureApexBootJars("myapex:bar"),
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("foo"),
|
||||
).RunTestWithBp(t, `
|
||||
@@ -288,7 +288,7 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
||||
"com.android.art:quuz",
|
||||
"platform:foo",
|
||||
|
||||
// The configured contents of UpdatableBootJars.
|
||||
// The configured contents of ApexBootJars.
|
||||
"myapex:bar",
|
||||
})
|
||||
|
||||
@@ -313,7 +313,7 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
||||
`com.android.art:quuz`,
|
||||
`platform:foo`,
|
||||
|
||||
// The configured contents of UpdatableBootJars.
|
||||
// The configured contents of ApexBootJars.
|
||||
`myapex:bar`,
|
||||
|
||||
// The fragments.
|
||||
@@ -348,7 +348,7 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) {
|
||||
// if the dependency on myapex:foo is filtered out because of either of those conditions then
|
||||
// the dependencies resolved by the platform_bootclasspath will not match the configured list
|
||||
// and so will fail the test.
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:foo", "myapex:bar"),
|
||||
java.FixtureConfigureApexBootJars("myapex:foo", "myapex:bar"),
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
|
||||
@@ -490,7 +490,7 @@ func TestPlatformBootclasspath_IncludesRemainingApexJars(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForTestWithPlatformBootclasspath,
|
||||
prepareForTestWithMyapex,
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:foo"),
|
||||
java.FixtureConfigureApexBootJars("myapex:foo"),
|
||||
android.FixtureWithRootAndroidBp(`
|
||||
platform_bootclasspath {
|
||||
name: "platform-bootclasspath",
|
||||
|
@@ -45,7 +45,7 @@ type GlobalConfig struct {
|
||||
ProfileDir string // directory to find profiles in
|
||||
|
||||
BootJars android.ConfiguredJarList // modules for jars that form the boot class path
|
||||
UpdatableBootJars android.ConfiguredJarList // jars within apex that form the boot class path
|
||||
ApexBootJars android.ConfiguredJarList // jars within apex that form the boot class path
|
||||
|
||||
ArtApexJars android.ConfiguredJarList // modules for jars that are in the ART APEX
|
||||
|
||||
@@ -531,7 +531,7 @@ func ParseGlobalSoongConfig(ctx android.PathContext, data []byte) (*GlobalSoongC
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// checkBootJarsConfigConsistency checks the consistency of BootJars and UpdatableBootJars fields in
|
||||
// checkBootJarsConfigConsistency checks the consistency of BootJars and ApexBootJars fields in
|
||||
// DexpreoptGlobalConfig and Config.productVariables.
|
||||
func checkBootJarsConfigConsistency(ctx android.SingletonContext, dexpreoptConfig *GlobalConfig, config android.Config) {
|
||||
compareBootJars := func(property string, dexpreoptJars, variableJars android.ConfiguredJarList) {
|
||||
@@ -545,8 +545,8 @@ func checkBootJarsConfigConsistency(ctx android.SingletonContext, dexpreoptConfi
|
||||
}
|
||||
}
|
||||
|
||||
compareBootJars("BootJars", dexpreoptConfig.BootJars, config.NonUpdatableBootJars())
|
||||
compareBootJars("UpdatableBootJars", dexpreoptConfig.UpdatableBootJars, config.UpdatableBootJars())
|
||||
compareBootJars("BootJars", dexpreoptConfig.BootJars, config.NonApexBootJars())
|
||||
compareBootJars("ApexBootJars", dexpreoptConfig.ApexBootJars, config.ApexBootJars())
|
||||
}
|
||||
|
||||
func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
@@ -614,7 +614,7 @@ func GlobalConfigForTests(ctx android.PathContext) *GlobalConfig {
|
||||
DisableGenerateProfile: false,
|
||||
ProfileDir: "",
|
||||
BootJars: android.EmptyConfiguredJarList(),
|
||||
UpdatableBootJars: android.EmptyConfiguredJarList(),
|
||||
ApexBootJars: android.EmptyConfiguredJarList(),
|
||||
ArtApexJars: android.EmptyConfiguredJarList(),
|
||||
SystemServerJars: android.EmptyConfiguredJarList(),
|
||||
SystemServerApps: nil,
|
||||
|
@@ -118,10 +118,10 @@ func FixtureSetBootJars(bootJars ...string) android.FixturePreparer {
|
||||
})
|
||||
}
|
||||
|
||||
// FixtureSetUpdatableBootJars sets the UpdatableBootJars property in the global config.
|
||||
func FixtureSetUpdatableBootJars(bootJars ...string) android.FixturePreparer {
|
||||
// FixtureSetApexBootJars sets the ApexBootJars property in the global config.
|
||||
func FixtureSetApexBootJars(bootJars ...string) android.FixturePreparer {
|
||||
return FixtureModifyGlobalConfig(func(dexpreoptConfig *GlobalConfig) {
|
||||
dexpreoptConfig.UpdatableBootJars = android.CreateTestConfiguredJarList(bootJars)
|
||||
dexpreoptConfig.ApexBootJars = android.CreateTestConfiguredJarList(bootJars)
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -2471,7 +2471,7 @@ func TestDexpreoptBcp(t *testing.T) {
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("runtime-library", "foo", "bar"),
|
||||
dexpreopt.FixtureSetBootJars("platform:foo"),
|
||||
dexpreopt.FixtureSetUpdatableBootJars("platform:bar"),
|
||||
dexpreopt.FixtureSetApexBootJars("platform:bar"),
|
||||
dexpreopt.FixtureSetPreoptWithUpdatableBcp(test.with),
|
||||
).RunTestWithBp(t, bp)
|
||||
|
||||
|
@@ -537,15 +537,11 @@ func (b *BootclasspathFragmentModule) configuredJars(ctx android.ModuleContext)
|
||||
|
||||
global := dexpreopt.GetGlobalConfig(ctx)
|
||||
|
||||
possibleUpdatableModules := gatherPossibleUpdatableModuleNamesAndStems(ctx, b.properties.Contents, bootclasspathFragmentContentDepTag)
|
||||
|
||||
// Only create configs for updatable boot jars. Non-updatable boot jars must be part of the
|
||||
// platform_bootclasspath's classpath proto config to guarantee that they come before any
|
||||
// updatable jars at runtime.
|
||||
jars := global.UpdatableBootJars.Filter(possibleUpdatableModules)
|
||||
possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, b.properties.Contents, bootclasspathFragmentContentDepTag)
|
||||
jars := global.ApexBootJars.Filter(possibleUpdatableModules)
|
||||
|
||||
// TODO(satayev): for apex_test we want to include all contents unconditionally to classpaths
|
||||
// config. However, any test specific jars would not be present in UpdatableBootJars. Instead,
|
||||
// config. However, any test specific jars would not be present in ApexBootJars. Instead,
|
||||
// we should check if we are creating a config for apex_test via ApexInfo and amend the values.
|
||||
// This is an exception to support end-to-end test for SdkExtensions, until such support exists.
|
||||
if android.InList("test_framework-sdkextensions", possibleUpdatableModules) {
|
||||
|
@@ -91,8 +91,8 @@ type classpathJar struct {
|
||||
maxSdkVersion int32
|
||||
}
|
||||
|
||||
// gatherPossibleUpdatableModuleNamesAndStems returns a set of module and stem names from the
|
||||
// supplied contents that may be in the updatable boot jars.
|
||||
// gatherPossibleApexModuleNamesAndStems returns a set of module and stem names from the
|
||||
// supplied contents that may be in the apex boot jars.
|
||||
//
|
||||
// The module names are included because sometimes the stem is set to just change the name of
|
||||
// the installed file and it expects the configuration to still use the actual module name.
|
||||
@@ -100,7 +100,7 @@ type classpathJar struct {
|
||||
// The stem names are included because sometimes the stem is set to change the effective name of the
|
||||
// module that is used in the configuration as well,e .g. when a test library is overriding an
|
||||
// actual boot jar
|
||||
func gatherPossibleUpdatableModuleNamesAndStems(ctx android.ModuleContext, contents []string, tag blueprint.DependencyTag) []string {
|
||||
func gatherPossibleApexModuleNamesAndStems(ctx android.ModuleContext, contents []string, tag blueprint.DependencyTag) []string {
|
||||
set := map[string]struct{}{}
|
||||
for _, name := range contents {
|
||||
dep := ctx.GetDirectDepWithTag(name, tag)
|
||||
|
@@ -167,10 +167,10 @@ import (
|
||||
// regardless which APEX goes into the product. See also android.ApexInfo.ApexVariationName and
|
||||
// apex.apexBundleProperties.Apex_name.
|
||||
//
|
||||
// A related variable PRODUCT_UPDATABLE_BOOT_JARS contains bootclasspath libraries that are in
|
||||
// APEXes. They are not included in the boot image. The only exception here is core-icu4j.jar that
|
||||
// has been historically part of the boot image and is now in a non updatable apex; it is treated
|
||||
// as being part of PRODUCT_BOOT_JARS and is in the boot image.
|
||||
// A related variable PRODUCT_APEX_BOOT_JARS contains bootclasspath libraries that are in APEXes.
|
||||
// They are not included in the boot image. The only exception here are ART jars and core-icu4j.jar
|
||||
// that have been historically part of the boot image and are now in apexes; they are in boot images
|
||||
// and core-icu4j.jar is generally treated as being part of PRODUCT_BOOT_JARS.
|
||||
//
|
||||
// One exception to the above rules are "coverage" builds (a special build flavor which requires
|
||||
// setting environment variable EMMA_INSTRUMENT_FRAMEWORK=true). In coverage builds the Java code in
|
||||
@@ -810,10 +810,10 @@ func bootFrameworkProfileRule(ctx android.ModuleContext, image *bootImageConfig)
|
||||
|
||||
// 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, updatableModules []android.Module) android.WritablePath {
|
||||
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 updatableModules {
|
||||
for _, module := range apexModules {
|
||||
if j, ok := module.(PermittedPackagesForUpdatableBootJars); ok {
|
||||
pp := j.PermittedPackagesForUpdatableBootJars()
|
||||
if len(pp) > 0 {
|
||||
|
@@ -142,14 +142,14 @@ func defaultBootImageConfig(ctx android.PathContext) *bootImageConfig {
|
||||
return genBootImageConfigs(ctx)[frameworkBootImageName]
|
||||
}
|
||||
|
||||
// Updatable boot config allows to access build/install paths of updatable boot jars without going
|
||||
// Apex boot config allows to access build/install paths of apex boot jars without going
|
||||
// through the usual trouble of registering dependencies on those modules and extracting build paths
|
||||
// from those dependencies.
|
||||
type updatableBootConfig struct {
|
||||
// A list of updatable boot jars.
|
||||
type apexBootConfig struct {
|
||||
// A list of apex boot jars.
|
||||
modules android.ConfiguredJarList
|
||||
|
||||
// A list of predefined build paths to updatable boot jars. They are configured very early,
|
||||
// A list of predefined build paths to apex boot jars. They are configured very early,
|
||||
// before the modules for these jars are processed and the actual paths are generated, and
|
||||
// later on a singleton adds commands to copy actual jars to the predefined paths.
|
||||
dexPaths android.WritablePaths
|
||||
@@ -161,21 +161,21 @@ type updatableBootConfig struct {
|
||||
dexLocations []string
|
||||
}
|
||||
|
||||
var updatableBootConfigKey = android.NewOnceKey("updatableBootConfig")
|
||||
var updatableBootConfigKey = android.NewOnceKey("apexBootConfig")
|
||||
|
||||
// Returns updatable boot config.
|
||||
func GetUpdatableBootConfig(ctx android.PathContext) updatableBootConfig {
|
||||
// Returns apex boot config.
|
||||
func GetApexBootConfig(ctx android.PathContext) apexBootConfig {
|
||||
return ctx.Config().Once(updatableBootConfigKey, func() interface{} {
|
||||
updatableBootJars := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
|
||||
apexBootJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars
|
||||
|
||||
dir := android.PathForOutput(ctx, ctx.Config().DeviceName(), "updatable_bootjars")
|
||||
dexPaths := updatableBootJars.BuildPaths(ctx, dir)
|
||||
dexPathsByModuleName := updatableBootJars.BuildPathsByModule(ctx, dir)
|
||||
dir := android.PathForOutput(ctx, ctx.Config().DeviceName(), "apex_bootjars")
|
||||
dexPaths := apexBootJars.BuildPaths(ctx, dir)
|
||||
dexPathsByModuleName := apexBootJars.BuildPathsByModule(ctx, dir)
|
||||
|
||||
dexLocations := updatableBootJars.DevicePaths(ctx.Config(), android.Android)
|
||||
dexLocations := apexBootJars.DevicePaths(ctx.Config(), android.Android)
|
||||
|
||||
return updatableBootConfig{updatableBootJars, dexPaths, dexPathsByModuleName, dexLocations}
|
||||
}).(updatableBootConfig)
|
||||
return apexBootConfig{apexBootJars, dexPaths, dexPathsByModuleName, dexLocations}
|
||||
}).(apexBootConfig)
|
||||
}
|
||||
|
||||
// Returns a list of paths and a list of locations for the boot jars used in dexpreopt (to be
|
||||
@@ -188,10 +188,10 @@ func bcpForDexpreopt(ctx android.PathContext, withUpdatable bool) (android.Writa
|
||||
dexLocations := bootImage.getAnyAndroidVariant().dexLocationsDeps
|
||||
|
||||
if withUpdatable {
|
||||
// Updatable boot jars (they are used only in dexpreopt, but not in the boot image).
|
||||
updBootConfig := GetUpdatableBootConfig(ctx)
|
||||
dexPaths = append(dexPaths, updBootConfig.dexPaths...)
|
||||
dexLocations = append(dexLocations, updBootConfig.dexLocations...)
|
||||
// Apex boot jars (they are used only in dexpreopt, but not in the boot image).
|
||||
apexBootConfig := GetApexBootConfig(ctx)
|
||||
dexPaths = append(dexPaths, apexBootConfig.dexPaths...)
|
||||
dexLocations = append(dexLocations, apexBootConfig.dexLocations...)
|
||||
}
|
||||
|
||||
return dexPaths, dexLocations
|
||||
|
@@ -118,11 +118,11 @@ func (h *hiddenAPI) initHiddenAPI(ctx android.ModuleContext, dexJar, classesJar
|
||||
}
|
||||
|
||||
func isModuleInBootClassPath(ctx android.BaseModuleContext, module android.Module) bool {
|
||||
// Get the configured non-updatable and updatable boot jars.
|
||||
nonUpdatableBootJars := ctx.Config().NonUpdatableBootJars()
|
||||
updatableBootJars := ctx.Config().UpdatableBootJars()
|
||||
active := isModuleInConfiguredList(ctx, module, nonUpdatableBootJars) ||
|
||||
isModuleInConfiguredList(ctx, module, updatableBootJars)
|
||||
// Get the configured platform and apex boot jars.
|
||||
nonApexBootJars := ctx.Config().NonApexBootJars()
|
||||
apexBootJars := ctx.Config().ApexBootJars()
|
||||
active := isModuleInConfiguredList(ctx, module, nonApexBootJars) ||
|
||||
isModuleInConfiguredList(ctx, module, apexBootJars)
|
||||
return active
|
||||
}
|
||||
|
||||
|
@@ -457,7 +457,7 @@ type Library struct {
|
||||
|
||||
var _ android.ApexModule = (*Library)(nil)
|
||||
|
||||
// Provides access to the list of permitted packages from updatable boot jars.
|
||||
// Provides access to the list of permitted packages from apex boot jars.
|
||||
type PermittedPackagesForUpdatableBootJars interface {
|
||||
PermittedPackagesForUpdatableBootJars() []string
|
||||
}
|
||||
|
@@ -33,8 +33,8 @@ func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContex
|
||||
// jars.
|
||||
var (
|
||||
platformBootclasspathArtBootJarDepTag = bootclasspathDependencyTag{name: "art-boot-jar"}
|
||||
platformBootclasspathNonUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "non-updatable-boot-jar"}
|
||||
platformBootclasspathUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "updatable-boot-jar"}
|
||||
platformBootclasspathBootJarDepTag = bootclasspathDependencyTag{name: "platform-boot-jar"}
|
||||
platformBootclasspathApexBootJarDepTag = bootclasspathDependencyTag{name: "apex-boot-jar"}
|
||||
)
|
||||
|
||||
type platformBootclasspathModule struct {
|
||||
@@ -131,11 +131,11 @@ func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.Botto
|
||||
// Add dependencies on all the non-updatable module configured in the "boot" boot image. That does
|
||||
// not include modules configured in the "art" boot image.
|
||||
bootImageConfig := b.getImageConfig(ctx)
|
||||
addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules, platformBootclasspathNonUpdatableBootJarDepTag)
|
||||
addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules, platformBootclasspathBootJarDepTag)
|
||||
|
||||
// Add dependencies on all the updatable modules.
|
||||
updatableModules := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
|
||||
addDependenciesOntoBootImageModules(ctx, updatableModules, platformBootclasspathUpdatableBootJarDepTag)
|
||||
// Add dependencies on all the apex jars.
|
||||
apexJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars
|
||||
addDependenciesOntoBootImageModules(ctx, apexJars, platformBootclasspathApexBootJarDepTag)
|
||||
|
||||
// Add dependencies on all the fragments.
|
||||
b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx)
|
||||
@@ -163,16 +163,16 @@ func (d *platformBootclasspathModule) MakeVars(ctx android.MakeVarsContext) {
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
// Gather all the dependencies from the art, updatable and non-updatable boot jars.
|
||||
// Gather all the dependencies from the art, platform, and apex boot jars.
|
||||
artModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathArtBootJarDepTag)
|
||||
nonUpdatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathNonUpdatableBootJarDepTag)
|
||||
updatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathUpdatableBootJarDepTag)
|
||||
platformModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathBootJarDepTag)
|
||||
apexModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathApexBootJarDepTag)
|
||||
|
||||
// Concatenate them all, in order as they would appear on the bootclasspath.
|
||||
var allModules []android.Module
|
||||
allModules = append(allModules, artModules...)
|
||||
allModules = append(allModules, nonUpdatableModules...)
|
||||
allModules = append(allModules, updatableModules...)
|
||||
allModules = append(allModules, platformModules...)
|
||||
allModules = append(allModules, apexModules...)
|
||||
b.configuredModules = allModules
|
||||
|
||||
// Gather all the fragments dependencies.
|
||||
@@ -180,8 +180,8 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
|
||||
// Check the configuration of the boot modules.
|
||||
// ART modules are checked by the art-bootclasspath-fragment.
|
||||
b.checkNonUpdatableModules(ctx, nonUpdatableModules)
|
||||
b.checkUpdatableModules(ctx, updatableModules)
|
||||
b.checkPlatformModules(ctx, platformModules)
|
||||
b.checkApexModules(ctx, apexModules)
|
||||
|
||||
b.generateClasspathProtoBuildActions(ctx)
|
||||
|
||||
@@ -193,7 +193,7 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
return
|
||||
}
|
||||
|
||||
b.generateBootImageBuildActions(ctx, nonUpdatableModules, updatableModules)
|
||||
b.generateBootImageBuildActions(ctx, platformModules, apexModules)
|
||||
}
|
||||
|
||||
// Generate classpaths.proto config
|
||||
@@ -209,7 +209,7 @@ func (b *platformBootclasspathModule) configuredJars(ctx android.ModuleContext)
|
||||
jars := b.getImageConfig(ctx).modules
|
||||
|
||||
// Include jars from APEXes that don't populate their classpath proto config.
|
||||
remainingJars := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
|
||||
remainingJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars
|
||||
for _, fragment := range b.fragments {
|
||||
info := ctx.OtherModuleProvider(fragment, ClasspathFragmentProtoContentInfoProvider).(ClasspathFragmentProtoContentInfo)
|
||||
if info.ClasspathFragmentProtoGenerated {
|
||||
@@ -223,9 +223,10 @@ func (b *platformBootclasspathModule) configuredJars(ctx android.ModuleContext)
|
||||
return jars
|
||||
}
|
||||
|
||||
// checkNonUpdatableModules ensures that the non-updatable modules supplied are not part of an
|
||||
// updatable module.
|
||||
func (b *platformBootclasspathModule) checkNonUpdatableModules(ctx android.ModuleContext, modules []android.Module) {
|
||||
// checkPlatformModules ensures that the non-updatable modules supplied are not part of an
|
||||
// apex module.
|
||||
func (b *platformBootclasspathModule) checkPlatformModules(ctx android.ModuleContext, modules []android.Module) {
|
||||
// TODO(satayev): change this check to only allow core-icu4j, all apex jars should not be here.
|
||||
for _, m := range modules {
|
||||
apexInfo := ctx.OtherModuleProvider(m, android.ApexInfoProvider).(android.ApexInfo)
|
||||
fromUpdatableApex := apexInfo.Updatable
|
||||
@@ -238,8 +239,8 @@ func (b *platformBootclasspathModule) checkNonUpdatableModules(ctx android.Modul
|
||||
}
|
||||
}
|
||||
|
||||
// checkUpdatableModules ensures that the updatable modules supplied are not from the platform.
|
||||
func (b *platformBootclasspathModule) checkUpdatableModules(ctx android.ModuleContext, modules []android.Module) {
|
||||
// checkApexModules ensures that the apex modules supplied are not from the platform.
|
||||
func (b *platformBootclasspathModule) checkApexModules(ctx android.ModuleContext, modules []android.Module) {
|
||||
for _, m := range modules {
|
||||
apexInfo := ctx.OtherModuleProvider(m, android.ApexInfoProvider).(android.ApexInfo)
|
||||
fromUpdatableApex := apexInfo.Updatable
|
||||
@@ -255,12 +256,12 @@ func (b *platformBootclasspathModule) checkUpdatableModules(ctx android.ModuleCo
|
||||
// modules is complete.
|
||||
if !ctx.Config().AlwaysUsePrebuiltSdks() {
|
||||
// error: this jar is part of the platform
|
||||
ctx.ModuleErrorf("module %q from platform is not allowed in the updatable boot jars list", name)
|
||||
ctx.ModuleErrorf("module %q from platform is not allowed in the apex boot jars list", name)
|
||||
}
|
||||
} else {
|
||||
// TODO(b/177892522): Treat this as an error.
|
||||
// Cannot do that at the moment because framework-wifi and framework-tethering are in the
|
||||
// PRODUCT_UPDATABLE_BOOT_JARS but not marked as updatable in AOSP.
|
||||
// PRODUCT_APEX_BOOT_JARS but not marked as updatable in AOSP.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,7 +406,7 @@ func (b *platformBootclasspathModule) generateHiddenApiMakeVars(ctx android.Make
|
||||
}
|
||||
|
||||
// generateBootImageBuildActions generates ninja rules related to the boot image creation.
|
||||
func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.ModuleContext, nonUpdatableModules, updatableModules []android.Module) {
|
||||
func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.ModuleContext, platformModules, apexModules []android.Module) {
|
||||
// Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars
|
||||
// GenerateSingletonBuildActions method as it cannot create it for itself.
|
||||
dexpreopt.GetGlobalSoongConfig(ctx)
|
||||
@@ -428,17 +429,17 @@ func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.
|
||||
// TODO(b/193889859): Remove when the prebuilts have been updated.
|
||||
if !ctx.Config().AlwaysUsePrebuiltSdks() {
|
||||
// Generate the updatable bootclasspath packages rule.
|
||||
generateUpdatableBcpPackagesRule(ctx, imageConfig, updatableModules)
|
||||
generateUpdatableBcpPackagesRule(ctx, imageConfig, apexModules)
|
||||
}
|
||||
|
||||
// Copy non-updatable module dex jars to their predefined locations.
|
||||
nonUpdatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, nonUpdatableModules)
|
||||
copyBootJarsToPredefinedLocations(ctx, nonUpdatableBootDexJarsByModule, imageConfig.dexPathsByModule)
|
||||
// Copy platform module dex jars to their predefined locations.
|
||||
platformBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, platformModules)
|
||||
copyBootJarsToPredefinedLocations(ctx, platformBootDexJarsByModule, imageConfig.dexPathsByModule)
|
||||
|
||||
// Copy updatable module dex jars to their predefined locations.
|
||||
config := GetUpdatableBootConfig(ctx)
|
||||
updatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, updatableModules)
|
||||
copyBootJarsToPredefinedLocations(ctx, updatableBootDexJarsByModule, config.dexPathsByModule)
|
||||
// Copy apex module dex jars to their predefined locations.
|
||||
config := GetApexBootConfig(ctx)
|
||||
apexBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, apexModules)
|
||||
copyBootJarsToPredefinedLocations(ctx, apexBootDexJarsByModule, config.dexPathsByModule)
|
||||
|
||||
// Build a profile for the image config and then use that to build the boot image.
|
||||
profile := bootImageProfileRule(ctx, imageConfig)
|
||||
|
@@ -106,11 +106,7 @@ func (s *SystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
func (s *SystemServerClasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
|
||||
global := dexpreopt.GetGlobalConfig(ctx)
|
||||
|
||||
possibleUpdatableModules := gatherPossibleUpdatableModuleNamesAndStems(ctx, s.properties.Contents, systemServerClasspathFragmentContentDepTag)
|
||||
|
||||
// Only create configs for updatable boot jars. Non-updatable system server jars must be part of the
|
||||
// platform_systemserverclasspath's classpath proto config to guarantee that they come before any
|
||||
// updatable jars at runtime.
|
||||
possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, s.properties.Contents, systemServerClasspathFragmentContentDepTag)
|
||||
return global.UpdatableSystemServerJars.Filter(possibleUpdatableModules)
|
||||
}
|
||||
|
||||
|
@@ -214,15 +214,15 @@ func FixtureConfigureBootJars(bootJars ...string) android.FixturePreparer {
|
||||
)
|
||||
}
|
||||
|
||||
// FixtureConfigureUpdatableBootJars configures the updatable boot jars in both the
|
||||
// FixtureConfigureApexBootJars configures the apex boot jars in both the
|
||||
// dexpreopt.GlobalConfig and Config.productVariables structs. As a side effect that enables
|
||||
// dexpreopt.
|
||||
func FixtureConfigureUpdatableBootJars(bootJars ...string) android.FixturePreparer {
|
||||
func FixtureConfigureApexBootJars(bootJars ...string) android.FixturePreparer {
|
||||
return android.GroupFixturePreparers(
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.UpdatableBootJars = android.CreateTestConfiguredJarList(bootJars)
|
||||
variables.ApexBootJars = android.CreateTestConfiguredJarList(bootJars)
|
||||
}),
|
||||
dexpreopt.FixtureSetUpdatableBootJars(bootJars...),
|
||||
dexpreopt.FixtureSetApexBootJars(bootJars...),
|
||||
|
||||
// Add a fake dex2oatd module.
|
||||
dexpreopt.PrepareForTestWithFakeDex2oatd,
|
||||
|
@@ -224,7 +224,7 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
|
||||
java.PrepareForTestWithJavaDefaultModules,
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:mybootlib", "myapex:myothersdklibrary"),
|
||||
java.FixtureConfigureApexBootJars("myapex:mybootlib", "myapex:myothersdklibrary"),
|
||||
prepareForSdkTestWithApex,
|
||||
|
||||
// Add a platform_bootclasspath that depends on the fragment.
|
||||
@@ -728,7 +728,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
|
||||
java.PrepareForTestWithJavaDefaultModules,
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("mysdklibrary"),
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:mybootlib"),
|
||||
java.FixtureConfigureApexBootJars("myapex:mybootlib"),
|
||||
prepareForSdkTestWithApex,
|
||||
|
||||
// Add a platform_bootclasspath that depends on the fragment.
|
||||
|
Reference in New Issue
Block a user