diff --git a/build.gradle b/build.gradle index 42d6f7e2787..980bb34bec3 100644 --- a/build.gradle +++ b/build.gradle @@ -144,13 +144,24 @@ task verifyVersions { * the enabled state of every bwc task. It should be set back to true * after the backport of the backcompat code is complete. */ -allprojects { - ext.bwc_tests_enabled = true +final boolean bwc_tests_enabled = true +final String bwc_tests_disabled_issue = "" /* place a PR link here when commiting bwc changes */ +if (bwc_tests_enabled == false) { + if (bwc_tests_disabled_issue.isEmpty()) { + throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false") + } + println "========================= WARNING =========================" + println " Backwards compatibility tests are disabled!" + println "See ${bwc_tests_disabled_issue}" + println "===========================================================" +} +subprojects { + ext.bwc_tests_enabled = bwc_tests_enabled } task verifyBwcTestsEnabled { doLast { - if (project.bwc_tests_enabled == false) { + if (bwc_tests_enabled == false) { throw new GradleException('Bwc tests are disabled. They must be re-enabled after completing backcompat behavior backporting.') } }