diff options
author | mstaib <mstaib@google.com> | 2018-08-02 08:42:02 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-02 08:43:33 -0700 |
commit | f29f78d19288f6d6e7aea6bc65e6bfa01b2531ad (patch) | |
tree | 80874e57d51e6f3b60c272fee9d4c7229145249c /src/main/java/com/google/devtools/build/lib/rules | |
parent | ca59cf38088e25a13fa244d8cd30d8a7197779a3 (diff) |
Keep the analysis cache between builds when only trimmed test options change.
When --trim_test_configuration is on and the only options which have changed
are from the (trimmed) TestOptions (not counting trim_test_configuration itself),
preserve the analysis cache rather than dropping it all.
This means that as long as no non-test options change, non-test rules will
not need to be reanalyzed. This also applies to test rules which were
analyzed with this configuration since the last time non-test options changed.
For example:
--test_arg=A //test (//test and its dependencies are analyzed)
--test_arg=B //test (only //test is reanalyzed)
--test_arg=A //test (no reanalysis needed)
--test_arg=A --define=Test=A //test (full reanalysis)
--test_arg=A //test (full reanalysis)
RELNOTES: None.
PiperOrigin-RevId: 207105915
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/core/CoreRules.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/core/CoreRules.java b/src/main/java/com/google/devtools/build/lib/rules/core/CoreRules.java index a89b3c5f1d..dc09c10b4b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/core/CoreRules.java +++ b/src/main/java/com/google/devtools/build/lib/rules/core/CoreRules.java @@ -30,6 +30,8 @@ public final class CoreRules implements RuleSet { @Override public void init(ConfiguredRuleClassProvider.Builder builder) { + builder.setShouldInvalidateCacheForDiff( + TestConfiguration.HAVE_OPTIONS_AFFECTING_NON_TEST_TARGETS_CHANGED); builder.addConfig(TestConfiguration.TestOptions.class, new TestConfiguration.Loader()); builder.addTrimmingTransitionFactory(new TestTrimmingTransitionFactory()); builder.addRuleDefinition(new BaseRuleClasses.RootRule()); |