Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8a698a0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topics "rbe-deps-dexpreopt-images", "rbe-deps-system-modules"

* changes:
  Expand the dexpreopt image dependencies to entire image
  Depend on all the files from system modules
parents 4b1f4fe1 0f41678d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ type ModuleConfig struct {

	Archs               []android.ArchType
	DexPreoptImages     []android.Path
	DexPreoptImagesDeps []android.Paths

	PreoptBootClassPathDexFiles     android.Paths // file paths of boot class path files
	PreoptBootClassPathDexLocations []string      // virtual locations of boot class path files
@@ -257,6 +258,9 @@ func LoadModuleConfig(ctx android.PathContext, path string) (ModuleConfig, error
	config.ModuleConfig.StripInputPath = constructPath(ctx, config.StripInputPath)
	config.ModuleConfig.StripOutputPath = constructWritablePath(ctx, config.StripOutputPath)

	// This needs to exist, but dependencies are already handled in Make, so we don't need to pass them through JSON.
	config.ModuleConfig.DexPreoptImagesDeps = make([]android.Paths, len(config.ModuleConfig.DexPreoptImages))

	return config.ModuleConfig, nil
}

+4 −3
Original line number Diff line number Diff line
@@ -125,7 +125,8 @@ func GenerateDexpreoptRule(ctx android.PathContext,

			for i, arch := range module.Archs {
				image := module.DexPreoptImages[i]
				dexpreoptCommand(ctx, global, module, rule, arch, profile, image, appImage, generateDM)
				imageDeps := module.DexPreoptImagesDeps[i]
				dexpreoptCommand(ctx, global, module, rule, arch, profile, image, imageDeps, appImage, generateDM)
			}
		}
	}
@@ -190,7 +191,7 @@ func profileCommand(ctx android.PathContext, global GlobalConfig, module ModuleC
}

func dexpreoptCommand(ctx android.PathContext, global GlobalConfig, module ModuleConfig, rule *android.RuleBuilder,
	arch android.ArchType, profile, bootImage android.Path, appImage, generateDM bool) {
	arch android.ArchType, profile, bootImage android.Path, bootImageDeps android.Paths, appImage, generateDM bool) {

	// HACK: make soname in Soong-generated .odex files match Make.
	base := filepath.Base(module.DexLocation)
@@ -353,7 +354,7 @@ func dexpreoptCommand(ctx android.PathContext, global GlobalConfig, module Modul
		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).
		FlagWithArg("--boot-image=", bootImageLocation).Implicits(bootImageDeps).
		FlagWithInput("--dex-file=", module.DexPath).
		FlagWithArg("--dex-location=", dexLocationArg).
		FlagWithOutput("--oat-file=", odexPath).ImplicitOutput(vdexPath).
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ func testModuleConfig(ctx android.PathContext) ModuleConfig {
		LibraryPaths:                    nil,
		Archs:                           []android.ArchType{android.Arm},
		DexPreoptImages:                 android.Paths{android.PathForTesting("system/framework/arm/boot.art")},
		DexPreoptImagesDeps:             []android.Paths{android.Paths{}},
		PreoptBootClassPathDexFiles:     nil,
		PreoptBootClassPathDexLocations: nil,
		PreoptExtractedApk:              false,
+12 −11
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ type javaBuilderFlags struct {
	processorPath     classpath
	processor         string
	systemModules     classpath
	systemModulesDeps android.Paths
	aidlFlags         string
	aidlDeps          android.Paths
	javaVersion       string
@@ -248,7 +249,7 @@ func transformJavaToClasses(ctx android.ModuleContext, outputFile android.Writab

	var bootClasspath string
	if flags.javaVersion == "1.9" {
		deps = append(deps, flags.systemModules...)
		deps = append(deps, flags.systemModulesDeps...)
		bootClasspath = flags.systemModules.FormJavaSystemModulesPath("--system=", ctx.Device())
	} else {
		deps = append(deps, flags.bootClasspath...)
@@ -430,7 +431,7 @@ func (x *classpath) FormJavaSystemModulesPath(optName string, forceEmpty bool) s
	if len(*x) > 1 {
		panic("more than one system module")
	} else if len(*x) == 1 {
		return optName + strings.TrimSuffix((*x)[0].String(), "lib/modules")
		return optName + (*x)[0].String()
	} else if forceEmpty {
		return optName + "none"
	} else {
+5 −2
Original line number Diff line number Diff line
@@ -132,8 +132,10 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
	}

	var images android.Paths
	var imagesDeps []android.Paths
	for _, arch := range archs {
		images = append(images, bootImage.images[arch])
		imagesDeps = append(imagesDeps, bootImage.imagesDeps[arch])
	}

	dexLocation := android.InstallPathToOnDevicePath(ctx, d.installPath)
@@ -175,6 +177,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo

		Archs:               archs,
		DexPreoptImages:     images,
		DexPreoptImagesDeps: imagesDeps,

		// We use the dex paths and dex locations of the default boot image, as it
		// contains the full dexpreopt boot classpath. Other images may just contain a subset of
Loading