diff --git a/build.gradle b/build.gradle index 3c5480e7..b5835339 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,11 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile + plugins { id 'org.jetbrains.kotlin.jvm' version '2.0.0' apply false id 'org.jetbrains.dokka' version '1.8.10' apply false id 'org.jlleitschuh.gradle.ktlint' version '12.1.1' apply false + id 'com.gradle.plugin-publish' version '0.21.0' apply false id 'java-gradle-plugin' id 'java-library' id 'groovy' @@ -39,9 +43,9 @@ subprojects { } } - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + tasks.withType(KotlinJvmCompile).configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) } } diff --git a/gradle-versions-plugin/build.gradle b/gradle-versions-plugin/build.gradle index a408ae35..56f990ae 100644 --- a/gradle-versions-plugin/build.gradle +++ b/gradle-versions-plugin/build.gradle @@ -2,7 +2,7 @@ plugins { id 'org.jetbrains.kotlin.jvm' id 'org.jetbrains.dokka' id 'org.jlleitschuh.gradle.ktlint' - id 'com.gradle.plugin-publish' version '0.21.0' + id 'com.gradle.plugin-publish' id 'maven-publish' id 'java-gradle-plugin' id 'java-library' @@ -13,7 +13,7 @@ group = GROUP version = VERSION_NAME // Write the plugin's classpath to a file to share with the tests -task createClasspathManifest { +tasks.register('createClasspathManifest') { def outputDir = file("$buildDir/$name") inputs.files sourceSets.main.runtimeClasspath @@ -41,14 +41,16 @@ dependencies { testImplementation 'org.spockframework:spock-junit4:2.1-M2-groovy-3.0', { exclude module: 'groovy-all' } // Use localGroovy() } -task docsJar(type: Jar, dependsOn: dokkaHtml) { +tasks.register('docsJar', Jar) { + dependsOn dokkaHtml group = 'Publications' description = 'Create jar of documentation.' archiveClassifier = 'javadoc' from dokkaJavadoc.outputDirectory } -task sourcesJar(type: Jar, dependsOn: classes) { +tasks.register('sourcesJar', Jar) { + dependsOn classes group = 'Publications' description = 'Create jar of sources.' archiveClassifier = 'sources' diff --git a/gradle-versions-plugin/src/test/groovy/com/github/benmanes/gradle/versions/DependencyUpdatesSpec.groovy b/gradle-versions-plugin/src/test/groovy/com/github/benmanes/gradle/versions/DependencyUpdatesSpec.groovy index 990efbc1..7ed2b95d 100644 --- a/gradle-versions-plugin/src/test/groovy/com/github/benmanes/gradle/versions/DependencyUpdatesSpec.groovy +++ b/gradle-versions-plugin/src/test/groovy/com/github/benmanes/gradle/versions/DependencyUpdatesSpec.groovy @@ -145,7 +145,7 @@ final class DependencyUpdatesSpec extends Specification { def project = singleProject() addRepositoryTo(project) addDependenciesTo(project) - project.configurations.all { + project.configurations.configureEach { resolutionStrategy { failOnDynamicVersions() } @@ -189,6 +189,7 @@ final class DependencyUpdatesSpec extends Specification { @Unroll def 'Multi-project with dependencies on parent (#revision, #outputFormat)'() { given: + //noinspection GroovyUnusedAssignment def (rootProject, childProject) = multiProject() addRepositoryTo(rootProject) addDependenciesTo(rootProject) @@ -620,7 +621,7 @@ final class DependencyUpdatesSpec extends Specification { when: def reporter = evaluate(project, 'milestone', null, 'build', null, null, false, - "", RELEASE_CANDIDATE.id, {config -> config.name.equals("upgradesFound")}) + "", RELEASE_CANDIDATE.id, {config -> (config.name == "upgradesFound") }) reporter.write() then: