Allow setting RUN_ERROR_PRONE=inline
This will replace RUN_ERROR_PRONE_INLINE, it's easier if there's only
one variable that can take on 3 different states.
Bug: 383626679
Test: Presubmits
Change-Id: I37dd26c14387ae127e08e94c4cc77705735200d9
diff --git a/android/config.go b/android/config.go
index a660baa..e3be0a0 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1321,11 +1321,16 @@
}
func (c *config) RunErrorProne() bool {
- return c.IsEnvTrue("RUN_ERROR_PRONE")
+ return c.IsEnvTrue("RUN_ERROR_PRONE") || c.RunErrorProneInline()
}
+// Returns if the errorprone build should be run "inline", that is, using errorprone as part
+// of the main javac compilation instead of its own separate compilation. This is good for CI
+// but bad for local development, because if you toggle errorprone+inline on/off it will repeatedly
+// clobber java files from the old configuration.
func (c *config) RunErrorProneInline() bool {
- return c.IsEnvTrue("RUN_ERROR_PRONE_INLINE")
+ value := strings.ToLower(c.Getenv("RUN_ERROR_PRONE"))
+ return c.IsEnvTrue("RUN_ERROR_PRONE_INLINE") || value == "inline"
}
// XrefCorpusName returns the Kythe cross-reference corpus name.