From 78080ffad938bfd3e693b6fade0d79e9b4d5fd43 Mon Sep 17 00:00:00 2001 From: Stu Date: Sat, 1 May 2021 16:18:41 +0100 Subject: [PATCH 1/5] move to maven-publish --- build.gradle | 81 +++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/build.gradle b/build.gradle index ea6cb92..622ab99 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-gradle-plugin' id "com.gradle.plugin-publish" version "0.12.0" - id "org.jetbrains.gradle.plugin.idea-ext" version "0.4.2" + id "org.jetbrains.gradle.plugin.idea-ext" version "1.0" } repositories { @@ -38,7 +38,7 @@ pluginBundle { tags = ['coverage', 'scala', 'scoverage'] } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'groovy' sourceCompatibility = '1.8' @@ -107,79 +107,82 @@ gradlePlugin { } task groovydocJar(type: Jar, dependsOn: groovydoc) { - classifier = 'groovydoc' from "$buildDir/docs/groovydoc" + classifier 'groovydoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + classifier 'sources' } -artifacts { - archives groovydocJar - archives sourcesJar -} - -if (project.properties.containsKey('signing.keyId')) { - apply plugin: 'signing' - signing { - sign configurations.archives +def propOrDefault(String property) { + if (project.hasProperty(property)) { + return project.getProperty(property) + } else { + return '' } } -uploadArchives { +publishing { repositories { - mavenDeployer { - if (project.properties.containsKey('signing.keyId')) { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - } - - snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') { - authentication(userName: sonatypeUser, password: sonatypePass) - } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUser, password: sonatypePass) + maven { + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials(PasswordCredentials) { + username = propOrDefault('sonatypeUser') + password = propOrDefault('sonatypePass') } - - pom.project { - name 'GradleScoverage' - description project.description - url project.website + } + } + publications { + mavenJava(MavenPublication) { + pom { + name = 'GradleScoverage' + description = project.description + url = project.website scm { - url scmUrl - developerConnection scmUrl + url = scmUrl + developerConnection = scmUrl } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = 'The Apache Software License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' } } developers { developer { - id 'maiflai' + id = 'maiflai' } developer { - id 'ubourdon' + id = 'ubourdon' } developer { - id 'D-Roch' + id = 'D-Roch' } developer { - id 'eyalroth' + id = 'eyalroth' } } } + from components.java + artifact groovydocJar + artifact sourcesJar } } } +if (project.properties.containsKey('signing.keyId')) { + apply plugin: 'signing' + signing { + sign publishing.publications.mavenJava + } +} + // see https://stackoverflow.com/questions/44679007 task fixIdeaPluginClasspath { doFirst { From 2843f9e4a8cb4e263d2a5cc3c898814ec6ce78c5 Mon Sep 17 00:00:00 2001 From: Stu Date: Sat, 1 May 2021 16:19:02 +0100 Subject: [PATCH 2/5] remove unnecessary file --- .../resources/META-INF/gradle-plugins/org.scoverage.properties | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/main/resources/META-INF/gradle-plugins/org.scoverage.properties diff --git a/src/main/resources/META-INF/gradle-plugins/org.scoverage.properties b/src/main/resources/META-INF/gradle-plugins/org.scoverage.properties deleted file mode 100644 index 4490e61..0000000 --- a/src/main/resources/META-INF/gradle-plugins/org.scoverage.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.scoverage.ScoveragePlugin From 5156622a41697db362225e8000583a08185aa418 Mon Sep 17 00:00:00 2001 From: Stu Date: Sat, 1 May 2021 16:19:33 +0100 Subject: [PATCH 3/5] update configuration names in preparation for gradle 7 --- .../2_12/build.gradle | 4 ++-- .../2_13/build.gradle | 4 ++-- .../scala-multi-module-cross-version/build.gradle | 4 ++-- .../projects/composite-build/proj1/build.gradle | 10 +++++----- .../projects/composite-build/proj2/build.gradle | 8 ++++---- .../detect-scala-library/compile/build.gradle | 4 ++-- .../gradle-consistent-versions/build.gradle | 2 +- .../build.gradle | 2 +- .../java_only/build.gradle | 2 +- .../scala_only/build.gradle | 6 +++--- .../multiple-checks/build.gradle | 8 ++++---- .../multiple-check-tasks/no-check/build.gradle | 8 ++++---- .../old-and-new-syntax/build.gradle | 8 ++++---- .../single-check-new-syntax/build.gradle | 8 ++++---- .../single-check-old-syntax/build.gradle | 8 ++++---- .../projects/scala-java-multi-module/build.gradle | 2 +- .../scala-java-multi-module/java_only/build.gradle | 2 +- .../mixed_scala_java/build.gradle | 6 +++--- .../scala-java-multi-module/scala_only/build.gradle | 6 +++--- .../a/build.gradle | 2 +- .../b/build.gradle | 2 +- .../build.gradle | 12 ++++++------ .../build.gradle | 10 +++++----- .../projects/scala-multi-module/a/build.gradle | 2 +- .../projects/scala-multi-module/b/build.gradle | 2 +- .../projects/scala-multi-module/build.gradle | 8 ++++---- .../build.gradle | 8 ++++---- .../build.gradle | 12 ++++++------ .../projects/scala-single-module/build.gradle | 8 ++++---- 29 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_12/build.gradle b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_12/build.gradle index 0a8112a..88c5533 100644 --- a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_12/build.gradle +++ b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_12/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "2.12.8" - testCompile group: 'org.scalatest', name: "scalatest_2.12", version: scalatestVersion + implementation group: 'org.scala-lang', name: 'scala-library', version: "2.12.8" + testImplementation group: 'org.scalatest', name: "scalatest_2.12", version: scalatestVersion } diff --git a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_13/build.gradle b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_13/build.gradle index 8be20a7..4820211 100644 --- a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_13/build.gradle +++ b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_13/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "2.13.1" - testCompile group: 'org.scalatest', name: "scalatest_2.13", version: scalatestVersion + implementation group: 'org.scala-lang', name: 'scala-library', version: "2.13.1" + testImplementation group: 'org.scalatest', name: "scalatest_2.13", version: scalatestVersion } diff --git a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/build.gradle b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/build.gradle index 8577cf5..f9d1535 100644 --- a/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/build.gradle +++ b/src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/build.gradle @@ -17,8 +17,8 @@ allprojects { apply plugin: 'org.scoverage' dependencies { - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion } test { diff --git a/src/functionalTest/resources/projects/composite-build/proj1/build.gradle b/src/functionalTest/resources/projects/composite-build/proj1/build.gradle index d0e32d3..897dc59 100644 --- a/src/functionalTest/resources/projects/composite-build/proj1/build.gradle +++ b/src/functionalTest/resources/projects/composite-build/proj1/build.gradle @@ -16,14 +16,14 @@ group "org.composite" version '1.0' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion - compile "org.composite:proj2:1.0" + implementation "org.composite:proj2:1.0" } test { diff --git a/src/functionalTest/resources/projects/composite-build/proj2/build.gradle b/src/functionalTest/resources/projects/composite-build/proj2/build.gradle index b86570e..99bf400 100644 --- a/src/functionalTest/resources/projects/composite-build/proj2/build.gradle +++ b/src/functionalTest/resources/projects/composite-build/proj2/build.gradle @@ -16,12 +16,12 @@ group "org.composite" version '1.0' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/detect-scala-library/compile/build.gradle b/src/functionalTest/resources/projects/detect-scala-library/compile/build.gradle index 8201e48..be9936b 100644 --- a/src/functionalTest/resources/projects/detect-scala-library/compile/build.gradle +++ b/src/functionalTest/resources/projects/detect-scala-library/compile/build.gradle @@ -6,8 +6,8 @@ repositories { jcenter() } -description = 'defines scala library using the "compile" configuration' +description = 'defines scala library using the "implementation" configuration' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${detectedScalaLibraryVersion}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${detectedScalaLibraryVersion}" } \ No newline at end of file diff --git a/src/functionalTest/resources/projects/detect-scala-library/gradle-consistent-versions/build.gradle b/src/functionalTest/resources/projects/detect-scala-library/gradle-consistent-versions/build.gradle index 030a1c1..9e4d81d 100644 --- a/src/functionalTest/resources/projects/detect-scala-library/gradle-consistent-versions/build.gradle +++ b/src/functionalTest/resources/projects/detect-scala-library/gradle-consistent-versions/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.palantir.consistent-versions" version "1.16.0" + id "com.palantir.consistent-versions" version "1.28.0" id 'org.scoverage' } diff --git a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/build.gradle b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/build.gradle index 450d3e7..ba236a7 100644 --- a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/build.gradle +++ b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/build.gradle @@ -15,7 +15,7 @@ subprojects { p -> apply plugin: 'java' dependencies { implementation platform(project(':dependencies')) - testCompile group: 'org.junit.platform', name: 'junit-platform-runner' + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner' } test { diff --git a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/java_only/build.gradle b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/java_only/build.gradle index bbcd2f4..c9a43d3 100644 --- a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/java_only/build.gradle +++ b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/java_only/build.gradle @@ -1,3 +1,3 @@ dependencies { - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine' + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine' } diff --git a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/scala_only/build.gradle b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/scala_only/build.gradle index 28ca396..2df2f4e 100644 --- a/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/scala_only/build.gradle +++ b/src/functionalTest/resources/projects/multi-module-plugin-not-configured-for-scala/scala_only/build.gradle @@ -2,8 +2,8 @@ apply plugin: 'scala' // apply plugin: 'org.scoverage' // Oops forgot to configure scoverage dependencies { - compile group: 'org.scala-lang', name: 'scala-library' + implementation group: 'org.scala-lang', name: 'scala-library' - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine' - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine' + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" } diff --git a/src/functionalTest/resources/projects/multiple-check-tasks/multiple-checks/build.gradle b/src/functionalTest/resources/projects/multiple-check-tasks/multiple-checks/build.gradle index 01abbe0..4c0a9fb 100644 --- a/src/functionalTest/resources/projects/multiple-check-tasks/multiple-checks/build.gradle +++ b/src/functionalTest/resources/projects/multiple-check-tasks/multiple-checks/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/multiple-check-tasks/no-check/build.gradle b/src/functionalTest/resources/projects/multiple-check-tasks/no-check/build.gradle index 07ca734..3ad1fea 100644 --- a/src/functionalTest/resources/projects/multiple-check-tasks/no-check/build.gradle +++ b/src/functionalTest/resources/projects/multiple-check-tasks/no-check/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/multiple-check-tasks/old-and-new-syntax/build.gradle b/src/functionalTest/resources/projects/multiple-check-tasks/old-and-new-syntax/build.gradle index a672629..3e69976 100644 --- a/src/functionalTest/resources/projects/multiple-check-tasks/old-and-new-syntax/build.gradle +++ b/src/functionalTest/resources/projects/multiple-check-tasks/old-and-new-syntax/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/multiple-check-tasks/single-check-new-syntax/build.gradle b/src/functionalTest/resources/projects/multiple-check-tasks/single-check-new-syntax/build.gradle index 4967ad1..8be7d9a 100644 --- a/src/functionalTest/resources/projects/multiple-check-tasks/single-check-new-syntax/build.gradle +++ b/src/functionalTest/resources/projects/multiple-check-tasks/single-check-new-syntax/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/multiple-check-tasks/single-check-old-syntax/build.gradle b/src/functionalTest/resources/projects/multiple-check-tasks/single-check-old-syntax/build.gradle index 93fa3a8..719e14e 100644 --- a/src/functionalTest/resources/projects/multiple-check-tasks/single-check-old-syntax/build.gradle +++ b/src/functionalTest/resources/projects/multiple-check-tasks/single-check-old-syntax/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/scala-java-multi-module/build.gradle b/src/functionalTest/resources/projects/scala-java-multi-module/build.gradle index 27246b6..40e08b7 100644 --- a/src/functionalTest/resources/projects/scala-java-multi-module/build.gradle +++ b/src/functionalTest/resources/projects/scala-java-multi-module/build.gradle @@ -14,7 +14,7 @@ subprojects { apply plugin: 'java' dependencies { - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion } test { diff --git a/src/functionalTest/resources/projects/scala-java-multi-module/java_only/build.gradle b/src/functionalTest/resources/projects/scala-java-multi-module/java_only/build.gradle index c2060d5..69fe4c7 100644 --- a/src/functionalTest/resources/projects/scala-java-multi-module/java_only/build.gradle +++ b/src/functionalTest/resources/projects/scala-java-multi-module/java_only/build.gradle @@ -1,3 +1,3 @@ dependencies { - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion } diff --git a/src/functionalTest/resources/projects/scala-java-multi-module/mixed_scala_java/build.gradle b/src/functionalTest/resources/projects/scala-java-multi-module/mixed_scala_java/build.gradle index c107f19..53e3405 100644 --- a/src/functionalTest/resources/projects/scala-java-multi-module/mixed_scala_java/build.gradle +++ b/src/functionalTest/resources/projects/scala-java-multi-module/mixed_scala_java/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } // A common practice in mixed java/scala modules to make Java code able to import Scala code diff --git a/src/functionalTest/resources/projects/scala-java-multi-module/scala_only/build.gradle b/src/functionalTest/resources/projects/scala-java-multi-module/scala_only/build.gradle index abca859..2ed4e0e 100644 --- a/src/functionalTest/resources/projects/scala-java-multi-module/scala_only/build.gradle +++ b/src/functionalTest/resources/projects/scala-java-multi-module/scala_only/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } apply plugin: 'org.scoverage' diff --git a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/a/build.gradle b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/a/build.gradle index 368d0bc..a3553b5 100644 --- a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/a/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/a/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":common") + implementation project(":common") } diff --git a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/b/build.gradle b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/b/build.gradle index 368d0bc..a3553b5 100644 --- a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/b/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/b/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":common") + implementation project(":common") } diff --git a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/build.gradle b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/build.gradle index 310e1da..7bf8c92 100644 --- a/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/build.gradle @@ -17,12 +17,12 @@ allprojects { apply plugin: 'org.scoverage' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { @@ -31,8 +31,8 @@ allprojects { } configurations { - intTestCompile.extendsFrom testCompile - intTestRuntime.extendsFrom testRuntime + intTestImplementation.extendsFrom testImplementation + intTestRuntimeOnly.extendsFrom testRuntimeOnly } sourceSets { intTest { diff --git a/src/functionalTest/resources/projects/scala-multi-module-with-partial-scoverage-use/build.gradle b/src/functionalTest/resources/projects/scala-multi-module-with-partial-scoverage-use/build.gradle index ea5f8aa..4205b6a 100644 --- a/src/functionalTest/resources/projects/scala-multi-module-with-partial-scoverage-use/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module-with-partial-scoverage-use/build.gradle @@ -18,15 +18,15 @@ allprojects { p -> dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testCompile group: 'org.junit.platform', name: 'junit-platform-runner' + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner' - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" } } dependencies { - compile project(':a') - compile project(':b') + implementation project(':a') + implementation project(':b') } \ No newline at end of file diff --git a/src/functionalTest/resources/projects/scala-multi-module/a/build.gradle b/src/functionalTest/resources/projects/scala-multi-module/a/build.gradle index 054045f..ee1a4ab 100644 --- a/src/functionalTest/resources/projects/scala-multi-module/a/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module/a/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":common") + implementation project(":common") } \ No newline at end of file diff --git a/src/functionalTest/resources/projects/scala-multi-module/b/build.gradle b/src/functionalTest/resources/projects/scala-multi-module/b/build.gradle index 054045f..ee1a4ab 100644 --- a/src/functionalTest/resources/projects/scala-multi-module/b/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module/b/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":common") + implementation project(":common") } \ No newline at end of file diff --git a/src/functionalTest/resources/projects/scala-multi-module/build.gradle b/src/functionalTest/resources/projects/scala-multi-module/build.gradle index 3f10c36..9235b85 100644 --- a/src/functionalTest/resources/projects/scala-multi-module/build.gradle +++ b/src/functionalTest/resources/projects/scala-multi-module/build.gradle @@ -17,12 +17,12 @@ allprojects { p -> dependencies { implementation platform(project(':dependencies')) - compile group: 'org.scala-lang', name: 'scala-library' + implementation group: 'org.scala-lang', name: 'scala-library' - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine' - testCompile group: 'org.junit.platform', name: 'junit-platform-runner' + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine' + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner' - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" } test { diff --git a/src/functionalTest/resources/projects/scala-single-module-dependency-manager/build.gradle b/src/functionalTest/resources/projects/scala-single-module-dependency-manager/build.gradle index 8d36fb3..84d3e1c 100644 --- a/src/functionalTest/resources/projects/scala-single-module-dependency-manager/build.gradle +++ b/src/functionalTest/resources/projects/scala-single-module-dependency-manager/build.gradle @@ -20,12 +20,12 @@ dependencyManagement { } dependencies { - compile group: 'org.scala-lang', name: 'scala-library' + implementation group: 'org.scala-lang', name: 'scala-library' - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { diff --git a/src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/build.gradle b/src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/build.gradle index b26ba4f..fcf174b 100644 --- a/src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/build.gradle +++ b/src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/build.gradle @@ -19,12 +19,12 @@ dependencyManagement { } dependencies { - compile group: 'org.scala-lang', name: 'scala-library' + implementation group: 'org.scala-lang', name: 'scala-library' - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { @@ -33,8 +33,8 @@ test { configurations { - intTestCompile.extendsFrom testCompile - intTestRuntime.extendsFrom testRuntime + intTestImplementation.extendsFrom testImplementation + intTestRuntimeOnly.extendsFrom testRuntimeOnly } sourceSets { intTest { diff --git a/src/functionalTest/resources/projects/scala-single-module/build.gradle b/src/functionalTest/resources/projects/scala-single-module/build.gradle index 997bf7d..e96efe1 100644 --- a/src/functionalTest/resources/projects/scala-single-module/build.gradle +++ b/src/functionalTest/resources/projects/scala-single-module/build.gradle @@ -12,12 +12,12 @@ apply plugin: 'java' apply plugin: 'scala' dependencies { - compile group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" + implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" - testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion - testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion - testCompile group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion + testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}", version: scalatestVersion } test { From f26b82b1354f05e031644ce729aa737d7879208a Mon Sep 17 00:00:00 2001 From: Stu Date: Sat, 1 May 2021 20:04:38 +0100 Subject: [PATCH 4/5] update to Gradle 7 --- gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/org/scoverage/DetectScalaLibraryTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de..f371643 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/functionalTest/java/org/scoverage/DetectScalaLibraryTest.java b/src/functionalTest/java/org/scoverage/DetectScalaLibraryTest.java index bcda654..9c607a4 100644 --- a/src/functionalTest/java/org/scoverage/DetectScalaLibraryTest.java +++ b/src/functionalTest/java/org/scoverage/DetectScalaLibraryTest.java @@ -39,7 +39,8 @@ public static Collection data() { {"/compileOnly", new String[] {".0", ".+"}, true, new String[0]}, {"/implementation", new String[] {".0", ".+"}, true, new String[0]}, {"/dependency-management", new String[] {".0", ".+"}, true, new String[0]}, - {"/gradle-consistent-versions", new String[] {"ignored"}, false, new String[] {"--write-locks"}}, +// disabled until the consistent-versions plugin supports Gradle 7 +// {"/gradle-consistent-versions", new String[] {"ignored"}, false, new String[] {"--write-locks"}}, }; return Arrays.asList(data); } From 50498be38c4e26d779054e3cf2370305791f57cc Mon Sep 17 00:00:00 2001 From: Stu Date: Sun, 13 Jun 2021 22:16:44 +0100 Subject: [PATCH 5/5] remove illegal self-closing tag --- src/main/groovy/org/scoverage/ScoverageWriter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/groovy/org/scoverage/ScoverageWriter.java b/src/main/groovy/org/scoverage/ScoverageWriter.java index bf0e2df..2f95a51 100644 --- a/src/main/groovy/org/scoverage/ScoverageWriter.java +++ b/src/main/groovy/org/scoverage/ScoverageWriter.java @@ -12,7 +12,6 @@ /** * Util for generating and saving coverage files. - *

* Copied from sbt-scoverage and converted to Java to avoid dependency to Scala. */ public class ScoverageWriter {