diff --git a/build.gradle b/build.gradle index 2345ee07..e7a5cf51 100644 --- a/build.gradle +++ b/build.gradle @@ -128,3 +128,7 @@ publishing { } } } + +tasks.withType(GroovyCompile).each { + it.groovyOptions.configurationScript = file("$rootDir/gradle/compiler-config.groovy") +} diff --git a/gradle/compiler-config.groovy b/gradle/compiler-config.groovy new file mode 100644 index 00000000..9196441d --- /dev/null +++ b/gradle/compiler-config.groovy @@ -0,0 +1,5 @@ +import groovy.transform.CompileStatic + +withConfig(configuration) { + ast(CompileStatic) +} \ No newline at end of file diff --git a/src/main/groovy/com/netflix/nebula/lint/rule/dependency/DuplicateDependencyClassRule.groovy b/src/main/groovy/com/netflix/nebula/lint/rule/dependency/DuplicateDependencyClassRule.groovy index f2a80c35..8ef4c6ee 100644 --- a/src/main/groovy/com/netflix/nebula/lint/rule/dependency/DuplicateDependencyClassRule.groovy +++ b/src/main/groovy/com/netflix/nebula/lint/rule/dependency/DuplicateDependencyClassRule.groovy @@ -70,8 +70,7 @@ abstract class AbstractDuplicateDependencyClassRule extends GradleLintRule imple if (!dependencyClasses) return - def dupeDependencyClasses = dependencyService.artifactsByClass(conf) - .findAll { + def dupeDependencyClasses = dependencyService.artifactsByClass(conf).findAll { // don't count artifacts that have the same ModuleIdentifier, which are different versions of the same // module coming from extended configurations that are ultimately conflict resolved away anyway Collection artifacts = it.value diff --git a/src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDepenencyClassRule.groovy b/src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDependencyClassRule.groovy similarity index 77% rename from src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDepenencyClassRule.groovy rename to src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDependencyClassRule.groovy index 25bc5593..3b6f4d02 100644 --- a/src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDepenencyClassRule.groovy +++ b/src/main/groovy/com/netflix/nebula/lint/rule/dependency/TransitiveDuplicateDependencyClassRule.groovy @@ -3,7 +3,7 @@ package com.netflix.nebula.lint.rule.dependency import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.ModuleVersionIdentifier -class TransitiveDuplicateDepenencyClassRule extends AbstractDuplicateDependencyClassRule { +class TransitiveDuplicateDependencyClassRule extends AbstractDuplicateDependencyClassRule { @Override protected List moduleIds(Configuration conf) { return transitiveModuleIds(conf) - firstOrderModuleIds(conf) diff --git a/src/main/resources/META-INF/lint-rules/transitive-duplicate-dependency-class.properties b/src/main/resources/META-INF/lint-rules/transitive-duplicate-dependency-class.properties index 5d96de5d..0d4213df 100644 --- a/src/main/resources/META-INF/lint-rules/transitive-duplicate-dependency-class.properties +++ b/src/main/resources/META-INF/lint-rules/transitive-duplicate-dependency-class.properties @@ -14,4 +14,4 @@ # limitations under the License. # -implementation-class=com.netflix.nebula.lint.rule.dependency.TransitiveDuplicateDepenencyClassRule \ No newline at end of file +implementation-class=com.netflix.nebula.lint.rule.dependency.TransitiveDuplicateDependencyClassRule \ No newline at end of file