Merge "Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use it"
This commit is contained in:
@@ -504,6 +504,10 @@ func (c *config) IsPdkBuild() bool {
|
|||||||
return Bool(c.ProductVariables.Pdk)
|
return Bool(c.ProductVariables.Pdk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) MinimizeJavaDebugInfo() bool {
|
||||||
|
return Bool(c.ProductVariables.MinimizeJavaDebugInfo) && !Bool(c.ProductVariables.Eng)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *config) DevicePrefer32BitExecutables() bool {
|
func (c *config) DevicePrefer32BitExecutables() bool {
|
||||||
return Bool(c.ProductVariables.DevicePrefer32BitExecutables)
|
return Bool(c.ProductVariables.DevicePrefer32BitExecutables)
|
||||||
}
|
}
|
||||||
|
@@ -158,6 +158,7 @@ type productVariables struct {
|
|||||||
Treble *bool `json:",omitempty"`
|
Treble *bool `json:",omitempty"`
|
||||||
Pdk *bool `json:",omitempty"`
|
Pdk *bool `json:",omitempty"`
|
||||||
Uml *bool `json:",omitempty"`
|
Uml *bool `json:",omitempty"`
|
||||||
|
MinimizeJavaDebugInfo *bool `json:",omitempty"`
|
||||||
|
|
||||||
IntegerOverflowExcludePaths *[]string `json:",omitempty"`
|
IntegerOverflowExcludePaths *[]string `json:",omitempty"`
|
||||||
|
|
||||||
|
@@ -466,6 +466,11 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB
|
|||||||
if ctx.AConfig().TargetOpenJDK9() {
|
if ctx.AConfig().TargetOpenJDK9() {
|
||||||
javacFlags = append(javacFlags, j.properties.Openjdk9.Javacflags...)
|
javacFlags = append(javacFlags, j.properties.Openjdk9.Javacflags...)
|
||||||
}
|
}
|
||||||
|
if ctx.AConfig().MinimizeJavaDebugInfo() {
|
||||||
|
// Override the -g flag passed globally to remove local variable debug info to reduce
|
||||||
|
// disk and memory usage.
|
||||||
|
javacFlags = append(javacFlags, "-g:source,lines")
|
||||||
|
}
|
||||||
if len(javacFlags) > 0 {
|
if len(javacFlags) > 0 {
|
||||||
// optimization.
|
// optimization.
|
||||||
ctx.Variable(pctx, "javacFlags", strings.Join(javacFlags, " "))
|
ctx.Variable(pctx, "javacFlags", strings.Join(javacFlags, " "))
|
||||||
|
Reference in New Issue
Block a user