summaryrefslogtreecommitdiff
path: root/android/config.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-05 21:29:32 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-03-05 21:29:32 -0800
commit88c42cdcc4da8d6edcbeb7f473c35c65ca614dc3 (patch)
tree1858268343fbe1d3a829dbc459c0eb38afbd3c86 /android/config.go
parentfec2fa1eebe5fe862574f6ac59badbf7d3ef51db (diff)
parent1b713f1a016af20c14b3f98ccf04bd18273e060e (diff)
Merge "More partial compile optimizations" into main am: e52331db53 am: 1b713f1a01
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3527573 Change-Id: I19d1f411df99808a48ad26d41a9f3ec720f38638 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'android/config.go')
-rw-r--r--android/config.go40
1 files changed, 30 insertions, 10 deletions
diff --git a/android/config.go b/android/config.go
index ded452964..9f14e3767 100644
--- a/android/config.go
+++ b/android/config.go
@@ -385,24 +385,28 @@ type config struct {
}
type partialCompileFlags struct {
- // Is partial compilation enabled at all?
- Enabled bool
-
// Whether to use d8 instead of r8
Use_d8 bool
+ // Whether to disable stub validation. This is slightly more surgical
+ // than DISABLE_STUB_VALIDATION, in that it only applies to partial
+ // compile builds.
+ Disable_stub_validation bool
+
+ // Whether to disable api lint.
+ Disable_api_lint bool
+
// Add others as needed.
}
// These are the flags when `SOONG_PARTIAL_COMPILE` is empty or not set.
-var defaultPartialCompileFlags = partialCompileFlags{
- Enabled: false,
-}
+var defaultPartialCompileFlags = partialCompileFlags{}
// These are the flags when `SOONG_PARTIAL_COMPILE=true`.
var enabledPartialCompileFlags = partialCompileFlags{
- Enabled: true,
- Use_d8: true,
+ Use_d8: true,
+ Disable_stub_validation: false,
+ Disable_api_lint: false,
}
type deviceConfig struct {
@@ -477,13 +481,29 @@ func (c *config) parsePartialCompileFlags(isEngBuild bool) (partialCompileFlags,
state = "+"
}
switch tok {
+ case "all":
+ // Turn on **all** of the flags.
+ ret = partialCompileFlags{
+ Use_d8: true,
+ Disable_stub_validation: true,
+ Disable_api_lint: true,
+ }
case "true":
ret = enabledPartialCompileFlags
case "false":
// Set everything to false.
ret = partialCompileFlags{}
- case "enabled":
- ret.Enabled = makeVal(state, defaultPartialCompileFlags.Enabled)
+
+ case "api_lint", "enable_api_lint":
+ ret.Disable_api_lint = !makeVal(state, !defaultPartialCompileFlags.Disable_api_lint)
+ case "disable_api_lint":
+ ret.Disable_api_lint = makeVal(state, defaultPartialCompileFlags.Disable_api_lint)
+
+ case "stub_validation", "enable_stub_validation":
+ ret.Disable_stub_validation = !makeVal(state, !defaultPartialCompileFlags.Disable_stub_validation)
+ case "disable_stub_validation":
+ ret.Disable_stub_validation = makeVal(state, defaultPartialCompileFlags.Disable_stub_validation)
+
case "use_d8":
ret.Use_d8 = makeVal(state, defaultPartialCompileFlags.Use_d8)
default: