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
This commit is contained in:
Colin Cross
2016-08-29 16:14:13 -07:00
parent 3cfaba1654
commit 9d45bb78c5
11 changed files with 74 additions and 34 deletions

View File

@@ -37,7 +37,7 @@ var (
// 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 @@ var (
},
"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 @@ var (
},
"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 @@ var (
},
"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 @@ var (
},
"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 && ` +