diff options
author | 2025-03-07 09:39:49 -0800 | |
---|---|---|
committer | 2025-03-07 09:39:49 -0800 | |
commit | 91a5806e1a5e2aa0e7dc8ad17dfae5931c74e131 (patch) | |
tree | 2ef0d1b78fe7a94a2606b71e14df4d8f6c8a8ec7 /java | |
parent | c34a121d5707ad64f8b492aa2890846beeec0885 (diff) | |
parent | 487fd7cedcb7b81f27aff3addd81521f19ca5715 (diff) |
Merge "Add support for R8 partial compilation in soong" into main am: d30afaded2 am: 487fd7cedc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3513210
Change-Id: I1f913b4a8878c7fbb4848d532594c6a0d15ba7b1
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 } |