Skip to content

Commit

Permalink
Upgrade to Gradle 8.1 (#783)
Browse files Browse the repository at this point in the history
The changes in gradle-wrapper.jar, gradle-wrapper.properties and gradlew
are the result of running this command twice:
./gradlew wrapper --gradle-version 8.1 --gradle-distribution-sha256-sum
a62c5f99585dd9e1f95dab7b9415a0e698fa9dd1e6c38537faa81ac078f4d23e

This commit also includes:

 * making use of simple property assignment in Kotlin DSL scripts, see
   https://docs.gradle.org/8.1/release-notes.html#kotlin-assign

 * removing no longer needed @Suppress("DSL_SCOPE_VIOLATION") for using
   version catalog in the plugins {} block, see
   https://docs.gradle.org/8.1/userguide/upgrading_version_8.html#kotlin_dsl_plugins_catalogs_workaround

---------

Co-authored-by: Lukellmann <[email protected]>
  • Loading branch information
DRSchlaubi and lukellmann authored Apr 12, 2023
1 parent 8c77dd9 commit c466993
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 29 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/Compiler.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import kotlinx.atomicfu.plugin.gradle.AtomicFUPluginExtension
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
Expand All @@ -26,7 +27,7 @@ object Jvm {

fun KotlinCommonCompilerOptions.applyKordCompilerOptions() {
// TODO: set to true again once https://github.com/Kotlin/kotlinx-atomicfu/issues/289 is fixed
allWarningsAsErrors.set(false)
allWarningsAsErrors = false
freeCompilerArgs.add("-progressive")
}

Expand Down
17 changes: 9 additions & 8 deletions buildSrc/src/main/kotlin/Documentation.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import org.gradle.kotlin.dsl.assign
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import java.net.URL

fun AbstractDokkaLeafTask.applyKordDokkaOptions() {
failOnWarning.set(true)
failOnWarning = true

dokkaSourceSets.configureEach {

jdkVersion.set(Jvm.target)
jdkVersion = Jvm.target

suppressGeneratedFiles.set(false)
suppressGeneratedFiles = false

sourceLink {
localDirectory.set(project.projectDir)
remoteUrl.set(URL("https://github.com/kordlib/kord/blob/${Library.commitHashOrDefault("0.9.x")}/${project.name}"))
remoteLineSuffix.set("#L")
localDirectory = project.projectDir
remoteUrl = URL("https://github.com/kordlib/kord/blob/${Library.commitHashOrDefault("0.9.x")}/${project.name}")
remoteLineSuffix = "#L"
}

externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/")
Expand All @@ -26,8 +27,8 @@ fun AbstractDokkaLeafTask.applyKordDokkaOptions() {

// don't list `TweetNaclFast` in docs
perPackageOption {
matchingRegex.set("""com\.iwebpp\.crypto""")
suppress.set(true)
matchingRegex = """com\.iwebpp\.crypto"""
suppress = true
}
}
}
28 changes: 14 additions & 14 deletions buildSrc/src/main/kotlin/kord-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

val dokkaJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
archiveClassifier = "javadoc"
from(tasks.named("dokkaHtml"))
}

Expand All @@ -19,37 +19,37 @@ publishing {
version = Library.version

pom {
name.set(Library.name)
description.set(Library.description)
url.set(Library.projectUrl)
name = Library.name
description = Library.description
url = Library.projectUrl

organization {
name.set("Kord")
url.set("https://github.com/kordlib")
name = "Kord"
url = "https://github.com/kordlib"
}

developers {
developer {
name.set("The Kord Team")
name = "The Kord Team"
}
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/kordlib/kord/issues")
system = "GitHub"
url = "https://github.com/kordlib/kord/issues"
}

licenses {
license {
name.set("MIT")
url.set("http://opensource.org/licenses/MIT")
name = "MIT"
url = "http://opensource.org/licenses/MIT"
}
}

scm {
connection.set("scm:git:ssh://github.com/kordlib/kord.git")
developerConnection.set("scm:git:ssh://[email protected]:kordlib/kord.git")
url.set(Library.projectUrl)
connection = "scm:git:ssh://github.com/kordlib/kord.git"
developerConnection = "scm:git:ssh://[email protected]:kordlib/kord.git"
url = Library.projectUrl
}
}
}
Expand Down
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@Suppress("DSL_SCOPE_VIOLATION") // false positive for `libs` in IntelliJ
plugins {
`kord-multiplatform-module`
`kord-publishing`
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#dokka will run out of memory with the default meta space
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m
org.gradle.parallel=true
systemProp.org.gradle.unsafe.kotlin.assignment=true
kotlin.code.style=official

# https://github.com/Kotlin/kotlinx-atomicfu#atomicfu-compiler-plugin
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionSha256Sum=a62c5f99585dd9e1f95dab7b9415a0e698fa9dd1e6c38537faa81ac078f4d23e
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 4 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down

0 comments on commit c466993

Please sign in to comment.