diff options
author | 2025-03-07 09:15:25 -0800 | |
---|---|---|
committer | 2025-03-07 09:15:25 -0800 | |
commit | 487fd7cedcb7b81f27aff3addd81521f19ca5715 (patch) | |
tree | c4b6655c4a57cba0c45ad31a63a5ae3cd8c5af46 /java | |
parent | a6e03a81250a410003231bf55676e948acc7f0f5 (diff) | |
parent | d30afaded26ae565329f4836b3f840fcc8e9e07e (diff) |
Merge "Add support for R8 partial compilation in soong" into main am: d30afaded2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3513210
Change-Id: I954e99b0a10678b52419f4155daf11c73b2a410b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'java')
-rw-r--r-- | java/dex.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/dex.go b/java/dex.go index ed2df2103..b32d5aee0 100644 --- a/java/dex.go +++ b/java/dex.go @@ -103,6 +103,19 @@ type DexProperties struct { // If true, transitive reverse dependencies of this module will have this // module's proguard spec appended to their optimization action Export_proguard_flags_files *bool + + // Path to a file containing a list of class names that should not be compiled using R8. + // These classes will be compiled by D8 similar to when Optimize.Enabled is false. + // + // Example: + // + // r8.exclude: + // com.example.Foo + // com.example.Bar + // com.example.Bar$Baz + // + // By default all classes are compiled using R8 when Optimize.Enabled is set. + Exclude *string `android:"path"` } // Keep the data uncompressed. We always need uncompressed dex for execution, @@ -528,6 +541,11 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams, r8Flags = append(r8Flags, "--store-store-fence-constructor-inlining") } + if opt.Exclude != nil { + r8Flags = append(r8Flags, "--exclude", *opt.Exclude) + r8Deps = append(r8Deps, android.PathForModuleSrc(ctx, *opt.Exclude)) + } + return r8Flags, r8Deps, artProfileOutput } |