Skip to content

Commit

Permalink
Upgrade to Gradle 8.0 RC3
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.0-rc-3
--gradle-distribution-sha256-sum
e0585a36e56b8ddd86cfe5358d7329f633063af85d6aab190428f3e0cb47b1f0

Right now Dokka is broken, see
Kotlin/dokka#2796
  • Loading branch information
lukellmann committed Feb 6, 2023
1 parent ca0462d commit 1f0bf98
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
1 change: 0 additions & 1 deletion buildSrc/settings.gradle.kts
@@ -1,7 +1,6 @@
rootProject.name = "buildSrc"

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
Expand Down
21 changes: 12 additions & 9 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
@@ -1,3 +1,4 @@
import com.google.devtools.ksp.gradle.KspTask
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
Expand Down Expand Up @@ -34,6 +35,9 @@ atomicfu {
dependenciesVersion = libs.findVersion("kotlinx-atomicfu").get().requiredVersion
}

// the kspKotlin Task is created very late and isn't available via tasks.findByName("kspKotlin")
val kspKotlin get() = tasks.withType<KspTask>().matching { it.name == "kspKotlin" }

tasks {
withType<JavaCompile> {
sourceCompatibility = Jvm.targetString
Expand Down Expand Up @@ -63,8 +67,8 @@ tasks {
withType<AbstractDokkaLeafTask> {
// see https://kotlin.github.io/dokka/<dokka version>/user_guide/gradle/usage/#configuration-options

// make sure ksp generates files before building docs
dependsOn(compileKotlin)
// include documentation generated by ksp
dependsOn(kspKotlin)

failOnWarning.set(true)

Expand Down Expand Up @@ -106,27 +110,26 @@ tasks {
}
}

val sourcesJar by registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val dokkaJar by registering(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(dokkaHtml)
dependsOn(dokkaHtml)
}

withType<PublishToMavenRepository>().configureEach {
doFirst { require(!Library.isUndefined) { "No release/snapshot version found." } }
}

kotlinSourcesJar {
// include sources generated by ksp
dependsOn(kspKotlin)
}

publishing {
publications.withType<MavenPublication> {
from(components["java"])
artifact(sourcesJar.get())
artifact(kotlinSourcesJar.get())
artifact(dokkaJar.get())
}
}
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Expand Up @@ -6,7 +6,3 @@ kotlin.code.style=official
# https://github.com/Kotlin/kotlinx-atomicfu#atomicfu-compiler-plugin
kotlinx.atomicfu.enableJvmIrTransformation=true
kotlinx.atomicfu.enableJsIrTransformation=true

# remove when upgrading to gradle 8.0
# https://docs.gradle.org/7.6/userguide/upgrading_version_7.html#strict-kotlin-dsl-precompiled-scripts-accessors
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=312eb12875e1747e05c2f81a4789902d7e4ec5defbd1eefeaccc08acf096505d
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionSha256Sum=e0585a36e56b8ddd86cfe5358d7329f633063af85d6aab190428f3e0cb47b1f0
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-rc-3-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Expand Up @@ -144,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down

0 comments on commit 1f0bf98

Please sign in to comment.