diff options
| author | Colin Cross <ccross@android.com> | 2019-02-11 14:21:24 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2019-02-15 16:16:25 -0800 |
| commit | 800fe13146c98a8b1ed06df33d5ab50a8c4b688e (patch) | |
| tree | fb5669e135a769298a9a0d96d754c17857515335 /dexpreopt | |
| parent | 25397f52ff20778cb83902239e07534f717c7d44 (diff) | |
| download | build_soong-800fe13146c98a8b1ed06df33d5ab50a8c4b688e.tar.gz build_soong-800fe13146c98a8b1ed06df33d5ab50a8c4b688e.tar.bz2 build_soong-800fe13146c98a8b1ed06df33d5ab50a8c4b688e.zip | |
Move dexpreopting of boot jars into Soong
Implement the dexpreopting of boot jars in singleton rules in
Soong.
Test: m checkbuild
Change-Id: Ic02ce941fa5e238b839b3eb4c06a3e10c62d98ff
Diffstat (limited to 'dexpreopt')
| -rw-r--r-- | dexpreopt/config.go | 25 | ||||
| -rw-r--r-- | dexpreopt/dexpreopt.go | 8 | ||||
| -rw-r--r-- | dexpreopt/dexpreopt_test.go | 56 |
3 files changed, 53 insertions, 36 deletions
diff --git a/dexpreopt/config.go b/dexpreopt/config.go index c7f06387..0eb162dc 100644 --- a/dexpreopt/config.go +++ b/dexpreopt/config.go @@ -34,11 +34,12 @@ type GlobalConfig struct { DisableGenerateProfile bool // don't generate profiles - PreoptBootClassPathDexFiles []string // file paths of boot class path files - PreoptBootClassPathDexLocations []string // virtual locations of boot class path files + BootJars []string // modules for jars that form the boot class path + + TargetCoreJars []string // modules for jars that are in the runtime apex + ProductUpdatableBootModules []string + ProductUpdatableBootLocations []string - BootJars []string // modules for jars that form the boot class path - PreoptBootJars []string // modules for jars that form the boot image SystemServerJars []string // jars that form the system server SystemServerApps []string // apps that are loaded into system server SpeedApps []string // apps that should be speed optimized @@ -64,15 +65,22 @@ type GlobalConfig struct { DefaultAppImages bool // build app images (TODO: .art files?) by default - Dex2oatXmx string // max heap size - Dex2oatXms string // initial heap size + Dex2oatXmx string // max heap size for dex2oat + Dex2oatXms string // initial heap size for dex2oat EmptyDirectory string // path to an empty directory - DefaultDexPreoptImage map[android.ArchType]string // default boot image location for each architecture CpuVariant map[android.ArchType]string // cpu variant for each architecture InstructionSetFeatures map[android.ArchType]string // instruction set for each architecture + // Only used for boot image + DirtyImageObjects string // path to a dirty-image-objects file + PreloadedClasses string // path to a preloaded-classes file + BootImageProfiles []string // path to a boot-image-profile.txt file + BootFlags string // extra flags to pass to dex2oat for the boot image + Dex2oatImageXmx string // max heap size for dex2oat for the boot image + Dex2oatImageXms string // initial heap size for dex2oat for the boot image + Tools Tools // paths to tools possibly used by the generated commands } @@ -109,6 +117,9 @@ type ModuleConfig struct { Archs []android.ArchType DexPreoptImages []string + PreoptBootClassPathDexFiles []string // file paths of boot class path files + PreoptBootClassPathDexLocations []string // virtual locations of boot class path files + PreoptExtractedApk bool // Overrides OnlyPreoptModules NoCreateAppImage bool diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 68bd3ea6..eacb86a4 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -199,9 +199,6 @@ func dexpreoptCommand(global GlobalConfig, module ModuleConfig, rule *android.Ru pathtools.ReplaceExtension(filepath.Base(path), "odex")) } - bcp := strings.Join(global.PreoptBootClassPathDexFiles, ":") - bcp_locations := strings.Join(global.PreoptBootClassPathDexLocations, ":") - odexPath := toOdexPath(filepath.Join(filepath.Dir(module.BuildPath), base)) odexInstallPath := toOdexPath(module.DexLocation) if odexOnSystemOther(module, global) { @@ -320,9 +317,8 @@ func dexpreoptCommand(global GlobalConfig, module ModuleConfig, rule *android.Ru FlagWithOutput("--write-invocation-to=", invocationPath).ImplicitOutput(invocationPath). Flag("--runtime-arg").FlagWithArg("-Xms", global.Dex2oatXms). Flag("--runtime-arg").FlagWithArg("-Xmx", global.Dex2oatXmx). - Flag("--runtime-arg").FlagWithArg("-Xbootclasspath:", bcp). - Implicits(global.PreoptBootClassPathDexFiles). - Flag("--runtime-arg").FlagWithArg("-Xbootclasspath-locations:", bcp_locations). + Flag("--runtime-arg").FlagWithInputList("-Xbootclasspath:", module.PreoptBootClassPathDexFiles, ":"). + Flag("--runtime-arg").FlagWithList("-Xbootclasspath-locations:", module.PreoptBootClassPathDexLocations, ":"). Flag("${class_loader_context_arg}"). Flag("${stored_class_loader_context_arg}"). FlagWithArg("--boot-image=", bootImageLocation).Implicit(bootImage). diff --git a/dexpreopt/dexpreopt_test.go b/dexpreopt/dexpreopt_test.go index 40c694f1..a2c6f776 100644 --- a/dexpreopt/dexpreopt_test.go +++ b/dexpreopt/dexpreopt_test.go @@ -29,6 +29,9 @@ var testGlobalConfig = GlobalConfig{ PatternsOnSystemOther: nil, DisableGenerateProfile: false, BootJars: nil, + TargetCoreJars: nil, + ProductUpdatableBootModules: nil, + ProductUpdatableBootLocations: nil, SystemServerJars: nil, SystemServerApps: nil, SpeedApps: nil, @@ -49,9 +52,14 @@ var testGlobalConfig = GlobalConfig{ Dex2oatXmx: "", Dex2oatXms: "", EmptyDirectory: "", - DefaultDexPreoptImage: nil, CpuVariant: nil, InstructionSetFeatures: nil, + DirtyImageObjects: "", + PreloadedClasses: "", + BootImageProfiles: nil, + BootFlags: "", + Dex2oatImageXmx: "", + Dex2oatImageXms: "", Tools: Tools{ Profman: "profman", Dex2oat: "dex2oat", @@ -64,28 +72,30 @@ var testGlobalConfig = GlobalConfig{ } var testModuleConfig = ModuleConfig{ - Name: "", - DexLocation: "", - BuildPath: "", - DexPath: "", - UncompressedDex: false, - HasApkLibraries: false, - PreoptFlags: nil, - ProfileClassListing: "", - ProfileIsTextListing: false, - EnforceUsesLibraries: false, - OptionalUsesLibraries: nil, - UsesLibraries: nil, - LibraryPaths: nil, - Archs: []android.ArchType{android.Arm}, - DexPreoptImages: []string{"system/framework/arm/boot.art"}, - PreoptExtractedApk: false, - NoCreateAppImage: false, - ForceCreateAppImage: false, - PresignedPrebuilt: false, - NoStripping: false, - StripInputPath: "", - StripOutputPath: "", + Name: "", + DexLocation: "", + BuildPath: "", + DexPath: "", + UncompressedDex: false, + HasApkLibraries: false, + PreoptFlags: nil, + ProfileClassListing: "", + ProfileIsTextListing: false, + EnforceUsesLibraries: false, + OptionalUsesLibraries: nil, + UsesLibraries: nil, + LibraryPaths: nil, + Archs: []android.ArchType{android.Arm}, + DexPreoptImages: []string{"system/framework/arm/boot.art"}, + PreoptBootClassPathDexFiles: nil, + PreoptBootClassPathDexLocations: nil, + PreoptExtractedApk: false, + NoCreateAppImage: false, + ForceCreateAppImage: false, + PresignedPrebuilt: false, + NoStripping: false, + StripInputPath: "", + StripOutputPath: "", } func TestDexPreopt(t *testing.T) { |
