diff options
| author | 2021-11-02 15:37:06 +0100 | |
|---|---|---|
| committer | 2022-01-10 08:56:19 +0100 | |
| commit | fc7df6124f28361b75b0589f67948b5651c71a80 (patch) | |
| tree | 02eaabc92d57a94a945c3f2ebac3afe260acaa14 | |
| parent | 789e5026b445360c059dfb91fd0f7f2e01c845c7 (diff) | |
Add mapping id to source file information for R8 full-mode builds.
Bug: 204293621
Test: atest --host r8retrace-check-retraced-stacktrace
Change-Id: I09703cfaab72350efe67217be9e2d37988218f4d
| -rw-r--r-- | java/dex.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/dex.go b/java/dex.go index 8045b5cc6..c59c3396d 100644 --- a/java/dex.go +++ b/java/dex.go @@ -254,6 +254,15 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, flags javaBuilderFlags) (r8Fl if BoolDefault(opt.Proguard_compatibility, true) { r8Flags = append(r8Flags, "--force-proguard-compatibility") + } else { + // TODO(b/213833843): Allow configuration of the prefix via a build variable. + var sourceFilePrefix = "go/retraceme " + var sourceFileTemplate = "\"" + sourceFilePrefix + "%MAP_ID\"" + // TODO(b/200967150): Also tag the source file in compat builds. + if Bool(opt.Optimize) || Bool(opt.Obfuscate) { + r8Flags = append(r8Flags, "--map-id-template", "%MAP_HASH") + r8Flags = append(r8Flags, "--source-file-template", sourceFileTemplate) + } } // TODO(ccross): Don't shrink app instrumentation tests by default. |