Skip errorprone on non-nightlies. (#45)

This commit is contained in:
Dawid Weiss 2021-03-26 21:42:15 +01:00 committed by GitHub
parent 48715fe898
commit f02799c511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -15,12 +15,21 @@
* limitations under the License.
*/
def skipErrorProne = rootProject.runtimeJavaVersion > JavaVersion.VERSION_15;
if (skipErrorProne) {
def skipReason
if (rootProject.runtimeJavaVersion > JavaVersion.VERSION_15) {
skipReason = "won't work with JDK ${rootProject.runtimeJavaVersion}"
}
if (!Boolean.parseBoolean(propertyOrDefault("tests.nightly", "false"))) {
skipReason = "skipped on non-nightly runs"
}
if (skipReason) {
configure(rootProject) {
task errorProneSkipped() {
doFirst {
logger.warn("WARNING: errorprone disabled (won't work with JDK ${rootProject.runtimeJavaVersion})")
logger.warn("WARNING: errorprone disabled (${skipReason})")
}
}
}
@ -31,7 +40,7 @@ allprojects { prj ->
// LUCENE-9650: Errorprone on master/gradle does not work with JDK-16+
// this is a hack to keep the dependency (so that palantir's version check doesn't complain)
// but don't include the plugin (which fails on JDK16+).
if (skipErrorProne) {
if (skipReason) {
tasks.withType(JavaCompile) { task -> task.dependsOn ":errorProneSkipped" }
configurations {
errorprone