Optimize CPU time when running d8 and r8 am: 6db4d4e613
am: f334ea833f
am: e6c2c1313c
Change-Id: I3a6b7ec5ca04250ec7e0e333ef64d9cfe6133553
This commit is contained in:
commit
148a568ad9
|
@ -62,6 +62,7 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("JavacHeapSize", "2048M")
|
||||
pctx.StaticVariable("JavacHeapFlags", "-J-Xmx${JavacHeapSize}")
|
||||
pctx.StaticVariable("DexFlags", "-JXX:+TieredCompilation -JXX:TieredStopAtLevel=1")
|
||||
|
||||
pctx.StaticVariable("CommonJdkFlags", strings.Join([]string{
|
||||
`-Xmaxerrs 9999999`,
|
||||
|
|
|
@ -81,4 +81,6 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
|||
|
||||
ctx.Strict("CLASS2GREYLIST", "${Class2Greylist}")
|
||||
ctx.Strict("HIDDENAPI", "${HiddenAPI}")
|
||||
|
||||
ctx.Strict("DEX_FLAGS", "${DexFlags}")
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import (
|
|||
var d8 = pctx.AndroidStaticRule("d8",
|
||||
blueprint.RuleParams{
|
||||
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
||||
`${config.D8Cmd} --output $outDir $d8Flags $in && ` +
|
||||
`${config.D8Cmd} ${config.DexFlags} --output $outDir $d8Flags $in && ` +
|
||||
`${config.SoongZipCmd} $zipFlags -o $outDir/classes.dex.jar -C $outDir -f "$outDir/classes*.dex" && ` +
|
||||
`${config.MergeZipsCmd} -D -stripFile "**/*.class" $out $outDir/classes.dex.jar $in`,
|
||||
CommandDeps: []string{
|
||||
|
@ -40,7 +40,7 @@ var r8 = pctx.AndroidStaticRule("r8",
|
|||
blueprint.RuleParams{
|
||||
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
||||
`rm -f "$outDict" && ` +
|
||||
`${config.R8Cmd} -injars $in --output $outDir ` +
|
||||
`${config.R8Cmd} ${config.DexFlags} -injars $in --output $outDir ` +
|
||||
`--force-proguard-compatibility ` +
|
||||
`--no-data-resources ` +
|
||||
`-printmapping $outDict ` +
|
||||
|
|
Loading…
Reference in New Issue