Add JAVAC_WRAPPER support
To run javac with AndroidGomaStaticRule, let me make JAVAC_WRAPPER also show up to javac/builder.go. Test: USE_GOMA=true JAVAC_WRAPPER=gomacc m -j32 Bug: b/62334576 Change-Id: I19e1e4315f71d8706800da810b5212f5964171a4
This commit is contained in:
@@ -37,10 +37,11 @@ var (
|
|||||||
// this, all java rules write into separate directories and then a post-processing step lists
|
// 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
|
// the files in the the directory into a list file that later rules depend on (and sometimes
|
||||||
// read from directly using @<listfile>)
|
// read from directly using @<listfile>)
|
||||||
javac = pctx.AndroidStaticRule("javac",
|
javac = pctx.AndroidGomaStaticRule("javac",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
||||||
`$javacCmd -encoding UTF-8 $javacFlags $bootClasspath $classpath ` +
|
`${config.JavacWrapper}$javacCmd ` +
|
||||||
|
`-encoding UTF-8 $javacFlags $bootClasspath $classpath ` +
|
||||||
`-extdirs "" -d $outDir @$out.rsp || ( rm -rf "$outDir"; exit 41 ) && ` +
|
`-extdirs "" -d $outDir @$out.rsp || ( rm -rf "$outDir"; exit 41 ) && ` +
|
||||||
`find $outDir -name "*.class" > $out`,
|
`find $outDir -name "*.class" > $out`,
|
||||||
Rspfile: "$out.rsp",
|
Rspfile: "$out.rsp",
|
||||||
@@ -88,6 +89,13 @@ func init() {
|
|||||||
pctx.StaticVariable("jarCmd", filepath.Join("${bootstrap.ToolDir}", "soong_zip"))
|
pctx.StaticVariable("jarCmd", filepath.Join("${bootstrap.ToolDir}", "soong_zip"))
|
||||||
pctx.HostBinToolVariable("dxCmd", "dx")
|
pctx.HostBinToolVariable("dxCmd", "dx")
|
||||||
pctx.HostJavaToolVariable("jarjarCmd", "jarjar.jar")
|
pctx.HostJavaToolVariable("jarjarCmd", "jarjar.jar")
|
||||||
|
|
||||||
|
pctx.VariableFunc("JavacWrapper", func(config interface{}) (string, error) {
|
||||||
|
if override := config.(android.Config).Getenv("JAVAC_WRAPPER"); override != "" {
|
||||||
|
return override + " ", nil
|
||||||
|
}
|
||||||
|
return "", nil
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type javaBuilderFlags struct {
|
type javaBuilderFlags struct {
|
||||||
|
Reference in New Issue
Block a user