Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Oct 29, 2020
1 parent 65d133e commit 23b6bc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
23 changes: 5 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.util.GradleVersion

plugins {
id 'nebula.plugin-plugin' version '14.5.0'
Expand Down Expand Up @@ -167,23 +166,11 @@ tasks.withType(Test) {

// Kotlin compiles first, stubbing Java dependencies, however it can't stub Groovy and we need to call Groovy code from Kotlin. For details see:
// https://discuss.gradle.org/t/kotlin-groovy-and-java-compilation/14903/10
if (GradleVersion.version(project.gradle.gradleVersion) >= (GradleVersion.version('6.1'))) {
tasks.named('compileGroovy') {
// Groovy only needs the declared dependencies
// and not the output of compileJava
classpath = sourceSets.main.compileClasspath
}
tasks.named('compileKotlin') {
// Kotlin also depends on the result of Groovy compilation
// which automatically makes it depend of compileGroovy
classpath += files(sourceSets.main.groovy.classesDirectory)
}

} else {
compileGroovy.dependsOn = compileGroovy.taskDependencies.mutableValues - 'compileJava'
compileKotlin.dependsOn compileGroovy
compileKotlin.classpath += files(compileGroovy.destinationDir)
classes.dependsOn compileKotlin
tasks.named('compileGroovy') {
classpath = sourceSets.main.compileClasspath
}
tasks.named('compileKotlin') {
classpath += files(sourceSets.main.groovy.classesDirectory)
}

targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.netflix.nebula.lint.plugin

import com.netflix.nebula.lint.plugin.LintGradleTask
import com.netflix.nebula.lint.GradleLintViolationAction
import com.netflix.nebula.lint.GradleViolation
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down

0 comments on commit 23b6bc7

Please sign in to comment.