Merge "Don't minimize debug information if module explicitly asks for it" into main am: 4efd3365cc
am: cfb87f5968
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2803327 Change-Id: I48571eb1a7e9525b35615058d573f4d4847edaa1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
10
java/base.go
10
java/base.go
@@ -1014,8 +1014,16 @@ func (j *Module) collectJavacFlags(
|
|||||||
ctx android.ModuleContext, flags javaBuilderFlags, srcFiles android.Paths) javaBuilderFlags {
|
ctx android.ModuleContext, flags javaBuilderFlags, srcFiles android.Paths) javaBuilderFlags {
|
||||||
// javac flags.
|
// javac flags.
|
||||||
javacFlags := j.properties.Javacflags
|
javacFlags := j.properties.Javacflags
|
||||||
|
var needsDebugInfo bool
|
||||||
|
|
||||||
if ctx.Config().MinimizeJavaDebugInfo() && !ctx.Host() {
|
needsDebugInfo = false
|
||||||
|
for _, flag := range javacFlags {
|
||||||
|
if strings.HasPrefix(flag, "-g") {
|
||||||
|
needsDebugInfo = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ctx.Config().MinimizeJavaDebugInfo() && !ctx.Host() && !needsDebugInfo {
|
||||||
// For non-host binaries, override the -g flag passed globally to remove
|
// For non-host binaries, override the -g flag passed globally to remove
|
||||||
// local variable debug info to reduce disk and memory usage.
|
// local variable debug info to reduce disk and memory usage.
|
||||||
javacFlags = append(javacFlags, "-g:source,lines")
|
javacFlags = append(javacFlags, "-g:source,lines")
|
||||||
|
Reference in New Issue
Block a user