Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main
This commit is contained in:
11
apex/apex.go
11
apex/apex.go
@@ -699,6 +699,8 @@ type dependencyTag struct {
|
|||||||
// If not-nil and an APEX is a member of an SDK then dependencies of that APEX with this tag will
|
// If not-nil and an APEX is a member of an SDK then dependencies of that APEX with this tag will
|
||||||
// also be added as exported members of that SDK.
|
// also be added as exported members of that SDK.
|
||||||
memberType android.SdkMemberType
|
memberType android.SdkMemberType
|
||||||
|
|
||||||
|
installable bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *dependencyTag) SdkMemberType(_ android.Module) android.SdkMemberType {
|
func (d *dependencyTag) SdkMemberType(_ android.Module) android.SdkMemberType {
|
||||||
@@ -717,6 +719,10 @@ func (d *dependencyTag) ReplaceSourceWithPrebuilt() bool {
|
|||||||
return !d.sourceOnly
|
return !d.sourceOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *dependencyTag) InstallDepNeeded() bool {
|
||||||
|
return d.installable
|
||||||
|
}
|
||||||
|
|
||||||
var _ android.ReplaceSourceWithPrebuilt = &dependencyTag{}
|
var _ android.ReplaceSourceWithPrebuilt = &dependencyTag{}
|
||||||
var _ android.SdkMemberDependencyTag = &dependencyTag{}
|
var _ android.SdkMemberDependencyTag = &dependencyTag{}
|
||||||
|
|
||||||
@@ -728,7 +734,8 @@ var (
|
|||||||
executableTag = &dependencyTag{name: "executable", payload: true}
|
executableTag = &dependencyTag{name: "executable", payload: true}
|
||||||
fsTag = &dependencyTag{name: "filesystem", payload: true}
|
fsTag = &dependencyTag{name: "filesystem", payload: true}
|
||||||
bcpfTag = &dependencyTag{name: "bootclasspathFragment", payload: true, sourceOnly: true, memberType: java.BootclasspathFragmentSdkMemberType}
|
bcpfTag = &dependencyTag{name: "bootclasspathFragment", payload: true, sourceOnly: true, memberType: java.BootclasspathFragmentSdkMemberType}
|
||||||
sscpfTag = &dependencyTag{name: "systemserverclasspathFragment", payload: true, sourceOnly: true, memberType: java.SystemServerClasspathFragmentSdkMemberType}
|
// The dexpreopt artifacts of apex system server jars are installed onto system image.
|
||||||
|
sscpfTag = &dependencyTag{name: "systemserverclasspathFragment", payload: true, sourceOnly: true, memberType: java.SystemServerClasspathFragmentSdkMemberType, installable: true}
|
||||||
compatConfigTag = &dependencyTag{name: "compatConfig", payload: true, sourceOnly: true, memberType: java.CompatConfigSdkMemberType}
|
compatConfigTag = &dependencyTag{name: "compatConfig", payload: true, sourceOnly: true, memberType: java.CompatConfigSdkMemberType}
|
||||||
javaLibTag = &dependencyTag{name: "javaLib", payload: true}
|
javaLibTag = &dependencyTag{name: "javaLib", payload: true}
|
||||||
jniLibTag = &dependencyTag{name: "jniLib", payload: true}
|
jniLibTag = &dependencyTag{name: "jniLib", payload: true}
|
||||||
@@ -1686,12 +1693,10 @@ func apexFileForJavaModuleWithFile(ctx android.ModuleContext, module javaModule,
|
|||||||
if sdkLib, ok := module.(*java.SdkLibrary); ok {
|
if sdkLib, ok := module.(*java.SdkLibrary); ok {
|
||||||
for _, install := range sdkLib.BuiltInstalledForApex() {
|
for _, install := range sdkLib.BuiltInstalledForApex() {
|
||||||
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
|
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
|
||||||
install.PackageFile(ctx)
|
|
||||||
}
|
}
|
||||||
} else if dexpreopter, ok := module.(java.DexpreopterInterface); ok {
|
} else if dexpreopter, ok := module.(java.DexpreopterInterface); ok {
|
||||||
for _, install := range dexpreopter.DexpreoptBuiltInstalledForApex() {
|
for _, install := range dexpreopter.DexpreoptBuiltInstalledForApex() {
|
||||||
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
|
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
|
||||||
install.PackageFile(ctx)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return af
|
return af
|
||||||
|
@@ -195,7 +195,6 @@ func (p *prebuiltCommon) initApexFilesForAndroidMk(ctx android.ModuleContext) {
|
|||||||
// If this apex contains a system server jar, then the dexpreopt artifacts should be added as required
|
// If this apex contains a system server jar, then the dexpreopt artifacts should be added as required
|
||||||
for _, install := range p.Dexpreopter.DexpreoptBuiltInstalledForApex() {
|
for _, install := range p.Dexpreopter.DexpreoptBuiltInstalledForApex() {
|
||||||
p.requiredModuleNames = append(p.requiredModuleNames, install.FullModuleName())
|
p.requiredModuleNames = append(p.requiredModuleNames, install.FullModuleName())
|
||||||
install.PackageFile(ctx)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,18 +88,11 @@ func (install dexpreopterInstall) ToMakeEntries() android.AndroidMkEntries {
|
|||||||
entries.SetString("LOCAL_MODULE_PATH", install.installDirOnDevice.String())
|
entries.SetString("LOCAL_MODULE_PATH", install.installDirOnDevice.String())
|
||||||
entries.SetString("LOCAL_INSTALLED_MODULE_STEM", install.installFileOnDevice)
|
entries.SetString("LOCAL_INSTALLED_MODULE_STEM", install.installFileOnDevice)
|
||||||
entries.SetString("LOCAL_NOT_AVAILABLE_FOR_PLATFORM", "false")
|
entries.SetString("LOCAL_NOT_AVAILABLE_FOR_PLATFORM", "false")
|
||||||
// Unset LOCAL_SOONG_INSTALLED_MODULE so that this does not default to the primary .apex file
|
|
||||||
// Without this, installation of the dexpreopt artifacts get skipped
|
|
||||||
entries.SetString("LOCAL_SOONG_INSTALLED_MODULE", "")
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (install dexpreopterInstall) PackageFile(ctx android.ModuleContext) android.PackagingSpec {
|
|
||||||
return ctx.PackageFile(install.installDirOnDevice, install.installFileOnDevice, install.outputPathOnHost)
|
|
||||||
}
|
|
||||||
|
|
||||||
type Dexpreopter struct {
|
type Dexpreopter struct {
|
||||||
dexpreopter
|
dexpreopter
|
||||||
}
|
}
|
||||||
@@ -583,13 +576,16 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, libName string, dexJa
|
|||||||
// Preopting of boot classpath jars in the ART APEX are handled in
|
// Preopting of boot classpath jars in the ART APEX are handled in
|
||||||
// java/dexpreopt_bootjars.go, and other APEX jars are not preopted.
|
// java/dexpreopt_bootjars.go, and other APEX jars are not preopted.
|
||||||
// The installs will be handled by Make as sub-modules of the java library.
|
// The installs will be handled by Make as sub-modules of the java library.
|
||||||
d.builtInstalledForApex = append(d.builtInstalledForApex, dexpreopterInstall{
|
di := dexpreopterInstall{
|
||||||
name: arch + "-" + installBase,
|
name: arch + "-" + installBase,
|
||||||
moduleName: libName,
|
moduleName: libName,
|
||||||
outputPathOnHost: install.From,
|
outputPathOnHost: install.From,
|
||||||
installDirOnDevice: installPath,
|
installDirOnDevice: installPath,
|
||||||
installFileOnDevice: installBase,
|
installFileOnDevice: installBase,
|
||||||
})
|
}
|
||||||
|
ctx.InstallFile(di.installDirOnDevice, di.installFileOnDevice, di.outputPathOnHost)
|
||||||
|
d.builtInstalledForApex = append(d.builtInstalledForApex, di)
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if !d.preventInstall {
|
} else if !d.preventInstall {
|
||||||
ctx.InstallFile(installPath, installBase, install.From)
|
ctx.InstallFile(installPath, installBase, install.From)
|
||||||
|
@@ -216,6 +216,11 @@ func IsSystemServerClasspathFragmentContentDepTag(tag blueprint.DependencyTag) b
|
|||||||
return tag == systemServerClasspathFragmentContentDepTag
|
return tag == systemServerClasspathFragmentContentDepTag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The dexpreopt artifacts of apex system server jars are installed onto system image.
|
||||||
|
func (s systemServerClasspathFragmentContentDependencyTag) InstallDepNeeded() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (s *SystemServerClasspathModule) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
|
func (s *SystemServerClasspathModule) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
module := ctx.Module()
|
module := ctx.Module()
|
||||||
_, isSourceModule := module.(*SystemServerClasspathModule)
|
_, isSourceModule := module.(*SystemServerClasspathModule)
|
||||||
|
Reference in New Issue
Block a user