Merge "Prep D8 default instead of CompatDX in build/soong"

This commit is contained in:
Alan Leung 2017-12-20 02:00:45 +00:00 committed by Gerrit Code Review
commit 731c8dac6d
4 changed files with 9 additions and 3 deletions

View file

@ -584,6 +584,10 @@ func (c *config) Android64() bool {
return false
}
func (c *config) UseD8Desugar() bool {
return c.IsEnvTrue("USE_D8_DESUGAR")
}
func (c *config) UseGoma() bool {
return Bool(c.ProductVariables.UseGoma)
}

View file

@ -441,7 +441,7 @@ func TransformClassesJarToDexJar(ctx android.ModuleContext, outputFile android.W
rule := dx
desc := "dx"
if ctx.AConfig().IsEnvTrue("USE_D8_DESUGAR") {
if ctx.Config().UseD8Desugar() {
rule = d8
desc = "d8"
}

View file

@ -46,12 +46,14 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("JAVADOC", "${JavadocCmd}")
ctx.Strict("COMMON_JDK_FLAGS", "${CommonJdkFlags}")
if ctx.Config().IsEnvTrue("USE_D8_DESUGAR") {
if ctx.Config().UseD8Desugar() {
ctx.Strict("DX", "${D8Cmd}")
ctx.Strict("DX_COMMAND", "${D8Cmd} -JXms16M -JXmx2048M")
ctx.Strict("USE_D8_DESUGAR", "true")
} else {
ctx.Strict("DX", "${DxCmd}")
ctx.Strict("DX_COMMAND", "${DxCmd} -JXms16M -JXmx2048M")
ctx.Strict("USE_D8_DESUGAR", "false")
}
ctx.Strict("TURBINE", "${TurbineJar}")

View file

@ -677,7 +677,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
// Store the list of .java files that was passed to javac
j.compiledJavaSrcs = uniqueSrcFiles
j.compiledSrcJars = srcJars
fullD8 := ctx.AConfig().IsEnvTrue("USE_D8_DESUGAR")
fullD8 := ctx.Config().UseD8Desugar()
enable_sharding := false
if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") {