Define granular build profile
This change introduces six conditions to the module-info.json build and
the regular build step; they are:
- clean out dir
- Android.bp/Android.mk files had changed
- Build-related environment had changed
- source files had changed
- other reasons that trigger renewal of out/build.ninja
- incremental build
Bug: 271654778
Test: atest_unittests
Change-Id: Ic46525f3ec0c0aa02f1df2a8bb8659faf415c055
diff --git a/atest/atest_enum.py b/atest/atest_enum.py
index 6c9d794..88a0ffd 100644
--- a/atest/atest_enum.py
+++ b/atest/atest_enum.py
@@ -21,7 +21,7 @@
@unique
class DetectType(IntEnum):
"""An Enum class for local_detect_event."""
- # Detect type for local_detect_event; next expansion: 29
+ # Detect type for local_detect_event; next expansion: 42
BUG_DETECTED = 0
ACLOUD_CREATE = 1
FIND_BUILD = 2
@@ -58,6 +58,25 @@
FOUND_TARGET_ARTIFACTS = 27
FIND_TEST_IN_DEPS=28
FULL_GENERATE_BAZEL_WORKSPACE_TIME = 29
+ # Below detect types are used for determine build conditions:
+ # 1. *_CLEAN_OUT: when out/ dir is empty or does not exist.
+ # 2. *_BPMK_CHANGE: when any Android.bp/Android.mk has changed.
+ # 3. *_ENV_CHANGE: when build-related variable has changed.
+ # 4. *_SRC_CHANGE: when source code has changed.
+ # 5. *_OTHER: none of above reasons that triggers renewal of ninja file.
+ # 6. *_INCREMENTAL: the build doesn't need to renew ninja file.
+ MODULE_INFO_CLEAN_OUT = 30
+ MODULE_INFO_BPMK_CHANGE = 31
+ MODULE_INFO_ENV_CHANGE = 32
+ MODULE_INFO_SRC_CHANGE = 33
+ MODULE_INFO_OTHER = 34
+ MODULE_INFO_INCREMENTAL = 35
+ BUILD_CLEAN_OUT = 36
+ BUILD_BPMK_CHANGE = 37
+ BUILD_ENV_CHANGE = 38
+ BUILD_SRC_CHANGE = 39
+ BUILD_OTHER = 40
+ BUILD_INCREMENTAL = 41
@unique
class ExitCode(IntEnum):