summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2019-02-15 10:39:37 -0800
committer Colin Cross <ccross@android.com> 2019-02-20 22:06:09 -0800
commit69f59a33271bc0646282f698754384f6bfe90624 (patch)
treeabee22cf22276b0a14eb5133239596d34d7e9f10 /java/hiddenapi_singleton.go
parent501d7e594ab483932c7785ff9f7e3c46f985ee6f (diff)
Make RuleBuilder methods take Paths
There are no more Make paths being used in Soong now that dexpreopting and hiddenapi are in Soong. Use the Path types in the inputs to RuleBuilder, and fix all users of RuleBuilder. This reapplies I886f803d9a3419a43b2cae412537645f94c5dfbf with fixes to disable preopt for Soong-only builds when the global dexpreopt.config doesn't exist. Test: all soong tests Test: m checkbuild Change-Id: I4dae9ecd5de22f062f9478ec8f0747f099cf8190
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go50
1 files changed, 25 insertions, 25 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index adbd35679..ba8b3e1f3 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -170,14 +170,14 @@ func stubFlagsRule(ctx android.SingletonContext) {
rule.MissingDeps(missingDeps)
rule.Command().
- Tool(pctx.HostBinToolPath(ctx, "hiddenapi").String()).
+ Tool(pctx.HostBinToolPath(ctx, "hiddenapi")).
Text("list").
- FlagForEachInput("--boot-dex=", bootDexJars.Strings()).
- FlagWithInputList("--public-stub-classpath=", publicStubPaths.Strings(), ":").
- FlagWithInputList("--public-stub-classpath=", systemStubPaths.Strings(), ":").
- FlagWithInputList("--public-stub-classpath=", testStubPaths.Strings(), ":").
- FlagWithInputList("--core-platform-stub-classpath=", corePlatformStubPaths.Strings(), ":").
- FlagWithOutput("--out-api-flags=", tempPath.String())
+ FlagForEachInput("--boot-dex=", bootDexJars).
+ FlagWithInputList("--public-stub-classpath=", publicStubPaths, ":").
+ FlagWithInputList("--public-stub-classpath=", systemStubPaths, ":").
+ FlagWithInputList("--public-stub-classpath=", testStubPaths, ":").
+ FlagWithInputList("--core-platform-stub-classpath=", corePlatformStubPaths, ":").
+ FlagWithOutput("--out-api-flags=", tempPath)
commitChangeForRestat(rule, tempPath, outputPath)
@@ -214,20 +214,20 @@ func flagsRule(ctx android.SingletonContext) android.Path {
stubFlags := hiddenAPISingletonPaths(ctx).stubFlags
rule.Command().
- Tool(android.PathForSource(ctx, "frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py").String()).
- FlagWithInput("--csv ", stubFlags.String()).
- Inputs(flagsCSV.Strings()).
+ Tool(android.PathForSource(ctx, "frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py")).
+ FlagWithInput("--csv ", stubFlags).
+ Inputs(flagsCSV).
FlagWithInput("--greylist ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist.txt").String()).
+ android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist.txt")).
FlagWithInput("--greylist-ignore-conflicts ",
- greylistIgnoreConflicts.String()).
+ greylistIgnoreConflicts).
FlagWithInput("--greylist-max-p ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-p.txt").String()).
+ android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-p.txt")).
FlagWithInput("--greylist-max-o-ignore-conflicts ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-o.txt").String()).
+ android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-o.txt")).
FlagWithInput("--blacklist ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-force-blacklist.txt").String()).
- FlagWithOutput("--output ", tempPath.String())
+ android.PathForSource(ctx, "frameworks/base/config/hiddenapi-force-blacklist.txt")).
+ FlagWithOutput("--output ", tempPath)
commitChangeForRestat(rule, tempPath, outputPath)
@@ -243,8 +243,8 @@ func emptyFlagsRule(ctx android.SingletonContext) android.Path {
outputPath := hiddenAPISingletonPaths(ctx).flags
- rule.Command().Text("rm").Flag("-f").Output(outputPath.String())
- rule.Command().Text("touch").Output(outputPath.String())
+ rule.Command().Text("rm").Flag("-f").Output(outputPath)
+ rule.Command().Text("touch").Output(outputPath)
rule.Build(pctx, ctx, "emptyHiddenAPIFlagsFile", "empty hiddenapi flags")
@@ -269,10 +269,10 @@ func metadataRule(ctx android.SingletonContext) android.Path {
outputPath := hiddenAPISingletonPaths(ctx).metadata
rule.Command().
- Tool(android.PathForSource(ctx, "frameworks/base/tools/hiddenapi/merge_csv.py").String()).
- Inputs(metadataCSV.Strings()).
+ Tool(android.PathForSource(ctx, "frameworks/base/tools/hiddenapi/merge_csv.py")).
+ Inputs(metadataCSV).
Text(">").
- Output(outputPath.String())
+ Output(outputPath)
rule.Build(pctx, ctx, "hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata")
@@ -284,15 +284,15 @@ func metadataRule(ctx android.SingletonContext) android.Path {
// the rule.
func commitChangeForRestat(rule *android.RuleBuilder, tempPath, outputPath android.WritablePath) {
rule.Restat()
- rule.Temporary(tempPath.String())
+ rule.Temporary(tempPath)
rule.Command().
Text("(").
Text("if").
- Text("cmp -s").Input(tempPath.String()).Output(outputPath.String()).Text(";").
+ Text("cmp -s").Input(tempPath).Output(outputPath).Text(";").
Text("then").
- Text("rm").Input(tempPath.String()).Text(";").
+ Text("rm").Input(tempPath).Text(";").
Text("else").
- Text("mv").Input(tempPath.String()).Output(outputPath.String()).Text(";").
+ Text("mv").Input(tempPath).Output(outputPath).Text(";").
Text("fi").
Text(")")
}