diff options
author | Colin Cross <ccross@android.com> | 2019-02-21 05:03:00 +0000 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-02-21 05:03:00 +0000 |
commit | ab898dc4a4645166c469e5409d2f42282a72d777 (patch) | |
tree | 0f0f62f25cb4a546543d4faddd084fb18df8d09b /java/dexpreopt.go | |
parent | acdd6940719125104dfd2f692990c99682f95f05 (diff) | |
download | build_soong-ab898dc4a4645166c469e5409d2f42282a72d777.tar.gz build_soong-ab898dc4a4645166c469e5409d2f42282a72d777.tar.bz2 build_soong-ab898dc4a4645166c469e5409d2f42282a72d777.zip |
Revert "Make RuleBuilder methods take Paths"
This reverts commit acdd6940719125104dfd2f692990c99682f95f05.
Reason for revert: broke ndk build
Change-Id: I5655e48c15eb8f5f0267afdd853fbc25765b8623
Diffstat (limited to 'java/dexpreopt.go')
-rw-r--r-- | java/dexpreopt.go | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/java/dexpreopt.go b/java/dexpreopt.go index b53e9c47..0a565297 100644 --- a/java/dexpreopt.go +++ b/java/dexpreopt.go @@ -86,28 +86,18 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.ModuleContext) bool { } var dexpreoptGlobalConfigKey = android.NewOnceKey("DexpreoptGlobalConfig") -var dexpreoptTestGlobalConfigKey = android.NewOnceKey("TestDexpreoptGlobalConfig") - -func setDexpreoptGlobalConfig(config android.Config, globalConfig dexpreopt.GlobalConfig) { - config.Once(dexpreoptTestGlobalConfigKey, func() interface{} { return globalConfig }) -} func dexpreoptGlobalConfig(ctx android.PathContext) dexpreopt.GlobalConfig { return ctx.Config().Once(dexpreoptGlobalConfigKey, func() interface{} { if f := ctx.Config().DexpreoptGlobalConfig(); f != "" { ctx.AddNinjaFileDeps(f) - globalConfig, err := dexpreopt.LoadGlobalConfig(ctx, f) + globalConfig, err := dexpreopt.LoadGlobalConfig(f) if err != nil { panic(err) } return globalConfig } - - // No global config filename set, see if there is a test config set - return ctx.Config().Once(dexpreoptTestGlobalConfigKey, func() interface{} { - // Nope, return an empty config - return dexpreopt.GlobalConfig{} - }) + return dexpreopt.GlobalConfig{} }).(dexpreopt.GlobalConfig) } @@ -141,15 +131,17 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo archs = archs[:1] } - var images android.Paths + var images []string for _, arch := range archs { - images = append(images, info.images[arch]) + images = append(images, info.images[arch].String()) } dexLocation := android.InstallPathToOnDevicePath(ctx, d.installPath) strippedDexJarFile := android.PathForModuleOut(ctx, "dexpreopt", dexJarFile.Base()) + deps := android.Paths{dexJarFile} + var profileClassListing android.OptionalPath profileIsTextListing := false if BoolDefault(d.dexpreoptProperties.Dex_preopt.Profile_guided, true) { @@ -165,16 +157,20 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo } } + if profileClassListing.Valid() { + deps = append(deps, profileClassListing.Path()) + } + dexpreoptConfig := dexpreopt.ModuleConfig{ Name: ctx.ModuleName(), DexLocation: dexLocation, - BuildPath: android.PathForModuleOut(ctx, "dexpreopt", ctx.ModuleName()+".jar").OutputPath, - DexPath: dexJarFile, + BuildPath: android.PathForModuleOut(ctx, "dexpreopt", ctx.ModuleName()+".jar").String(), + DexPath: dexJarFile.String(), UncompressedDex: d.uncompressedDex, HasApkLibraries: false, PreoptFlags: nil, - ProfileClassListing: profileClassListing, + ProfileClassListing: profileClassListing.String(), ProfileIsTextListing: profileIsTextListing, EnforceUsesLibraries: false, @@ -185,7 +181,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo Archs: archs, DexPreoptImages: images, - PreoptBootClassPathDexFiles: info.preoptBootDex.Paths(), + PreoptBootClassPathDexFiles: info.preoptBootDex.Strings(), PreoptBootClassPathDexLocations: info.preoptBootLocations, PreoptExtractedApk: false, @@ -194,11 +190,11 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo ForceCreateAppImage: BoolDefault(d.dexpreoptProperties.Dex_preopt.App_image, false), NoStripping: Bool(d.dexpreoptProperties.Dex_preopt.No_stripping), - StripInputPath: dexJarFile, - StripOutputPath: strippedDexJarFile.OutputPath, + StripInputPath: dexJarFile.String(), + StripOutputPath: strippedDexJarFile.String(), } - dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(ctx, info.global, dexpreoptConfig) + dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(info.global, dexpreoptConfig) if err != nil { ctx.ModuleErrorf("error generating dexpreopt rule: %s", err.Error()) return dexJarFile |