Revert "Make RuleBuilder methods take Paths"

This reverts commit acdd6940719125104dfd2f692990c99682f95f05.

Reason for revert: broke ndk build

Change-Id: I5655e48c15eb8f5f0267afdd853fbc25765b8623
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index b53e9c4..0a56529 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -86,28 +86,18 @@
 }
 
 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 @@
 		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 @@
 		}
 	}
 
+	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 @@
 		Archs:           archs,
 		DexPreoptImages: images,
 
-		PreoptBootClassPathDexFiles:     info.preoptBootDex.Paths(),
+		PreoptBootClassPathDexFiles:     info.preoptBootDex.Strings(),
 		PreoptBootClassPathDexLocations: info.preoptBootLocations,
 
 		PreoptExtractedApk: false,
@@ -194,11 +190,11 @@
 		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