From 3429e2ff68fd1ca87e913f119e4119137a5012d5 Mon Sep 17 00:00:00 2001 From: Robert Fink Date: Wed, 19 Oct 2016 17:01:34 -0400 Subject: [PATCH] BaselineCheckstyle checks java sourceCompatibility after project has been evaluated (#104) --- .../baseline/plugins/BaselineCheckstyle.groovy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineCheckstyle.groovy b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineCheckstyle.groovy index 4296e90b7..8910dfef8 100644 --- a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineCheckstyle.groovy +++ b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineCheckstyle.groovy @@ -40,13 +40,13 @@ class BaselineCheckstyle extends AbstractBaselinePlugin { project.afterEvaluate { Project p -> configureCheckstyle() configureCheckstyleForEclipse() - } - // We use the "JavadocMethod" module in our Checkstyle configuration, making - // Java 8+ new doclint compiler feature redundant. - if (project.sourceCompatibility.isJava8Compatible()) { - project.tasks.withType(Javadoc) { - options.addStringOption('Xdoclint:none', '-quiet') + // We use the "JavadocMethod" module in our Checkstyle configuration, making + // Java 8+ new doclint compiler feature redundant. + project.tasks.withType(Javadoc) { it -> + if (project.sourceCompatibility.isJava8Compatible()) { + it.options.addStringOption('Xdoclint:none', '-quiet') + } } } } @@ -78,7 +78,7 @@ class BaselineCheckstyle extends AbstractBaselinePlugin { // Make sure java files are still included. This should match list in etc/eclipse-template/.checkstyle. // Currently not enforced, but could be eventually. def includeExtensions = - ['java', 'cfg', 'coffee', 'erb', 'groovy', 'handlebars', 'json', 'less', 'pl', 'pp', 'sh', 'xml'] + ['java', 'cfg', 'coffee', 'erb', 'groovy', 'handlebars', 'json', 'less', 'pl', 'pp', 'sh', 'xml'] includeExtensions.each { extension -> task.include "**/*.$extension" }