From 1d6eb68731d70c34c4c648d1185f16c613d366b7 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Thu, 29 Nov 2018 15:08:44 -0800 Subject: [PATCH] Use debug mode when running R8 for eng builds. Bug: 119601874 Test: Built for different variants. Change-Id: I2250587eb3e457ca15265eb9f8359872e9b08363 --- android/config.go | 4 ++++ java/dex.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/android/config.go b/android/config.go index abb07ce56..54c9da8b1 100644 --- a/android/config.go +++ b/android/config.go @@ -581,6 +581,10 @@ func (c *config) Debuggable() bool { return Bool(c.productVariables.Debuggable) } +func (c *config) Eng() bool { + return Bool(c.productVariables.Eng) +} + func (c *config) DevicePrefer32BitApps() bool { return Bool(c.productVariables.DevicePrefer32BitApps) } diff --git a/java/dex.go b/java/dex.go index 5cec3252e..a6d486ab5 100644 --- a/java/dex.go +++ b/java/dex.go @@ -160,6 +160,11 @@ func (j *Module) r8Flags(ctx android.ModuleContext, flags javaBuilderFlags) (r8F // TODO(ccross): if this is an instrumentation test of an obfuscated app, use the // dictionary of the app and move the app from libraryjars to injars. + // Don't strip out debug information for eng builds. + if ctx.Config().Eng() { + r8Flags = append(r8Flags, "--debug") + } + return r8Flags, r8Deps }