buildSrc
is a separate build (not project), and I'm not aware of a way to influence its execution when triggering the main build. (Note that building buildSrc
is a prerequisite for evaluating the main build's build scripts.) Some solutions I can think of:
- Unconditionally disable
buildSrc
tests for as long as required (e.g. by settingtest.disabled = true
inbuildSrc/build.gradle
) - Factor out
buildSrc
into a separate build - Change tests so that they are insensitive to template changes
- Move tests that are sensitive to template changes into a separate
Test
task that's only triggered manually
PS: The easiest way to skip a build's tests from the command line is -x test
. The existence of a project property foo
can be detected with project.hasProperty("foo")
.