Skip to content

Gradle7 #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 42 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -38,7 +38,7 @@ pluginBundle {
tags = ['coverage', 'scala', 'scoverage']
}

apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'groovy'

sourceCompatibility = '1.8'
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public static Collection<Object[]> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Original file line number Diff line number Diff line change
@@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
testRuntime group: 'org.junit.vintage', name: 'junit-vintage-engine'
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
compile project(":common")
implementation project(":common")
}
Loading