Enable goma in soong

When the UseGoma flag is set, put all rules except the C compilation
rule in an externally defined local_pool, which will have been created
by kati.  The gomacc wrapper will already be in the CC_WRAPPER
environment variable.

Bug: 31142427
Change-Id: I699d4edff2e302eee398dad8692ceb14721a628c
diff --git a/java/builder.go b/java/builder.go
index f674f98..a9da0fc 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -37,7 +37,7 @@
 	// this, all java rules write into separate directories and then a post-processing step lists
 	// the files in the the directory into a list file that later rules depend on (and sometimes
 	// read from directly using @<listfile>)
-	javac = pctx.StaticRule("javac",
+	javac = pctx.AndroidStaticRule("javac",
 		blueprint.RuleParams{
 			Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
 				`$javacCmd -encoding UTF-8 $javacFlags $bootClasspath $classpath ` +
@@ -49,7 +49,7 @@
 		},
 		"javacCmd", "javacFlags", "bootClasspath", "classpath", "outDir")
 
-	jar = pctx.StaticRule("jar",
+	jar = pctx.AndroidStaticRule("jar",
 		blueprint.RuleParams{
 			Command:     `$jarCmd -o $out $jarArgs`,
 			CommandDeps: []string{"$jarCmd"},
@@ -57,7 +57,7 @@
 		},
 		"jarCmd", "jarArgs")
 
-	dx = pctx.StaticRule("dx",
+	dx = pctx.AndroidStaticRule("dx",
 		blueprint.RuleParams{
 			Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
 				`$dxCmd --dex --output=$outDir $dxFlags $in || ( rm -rf "$outDir"; exit 41 ) && ` +
@@ -67,7 +67,7 @@
 		},
 		"outDir", "dxFlags")
 
-	jarjar = pctx.StaticRule("jarjar",
+	jarjar = pctx.AndroidStaticRule("jarjar",
 		blueprint.RuleParams{
 			Command:     "java -jar $jarjarCmd process $rulesFile $in $out",
 			CommandDeps: []string{"$jarjarCmd", "$rulesFile"},
@@ -75,7 +75,7 @@
 		},
 		"rulesFile")
 
-	extractPrebuilt = pctx.StaticRule("extractPrebuilt",
+	extractPrebuilt = pctx.AndroidStaticRule("extractPrebuilt",
 		blueprint.RuleParams{
 			Command: `rm -rf $outDir && unzip -qo $in -d $outDir && ` +
 				`find $outDir -name "*.class" > $classFile && ` +