Skip to content

Commit 8d325ce

Browse files
authored
Upgrade to kotlin 2 (#117)
* Upgrade to gradle 8.7 * Use kotlin 2.1.0 * CI: use JDK 21
1 parent e283031 commit 8d325ce

File tree

21 files changed

+274
-186
lines changed

21 files changed

+274
-186
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ jobs:
7878
if: matrix.os == 'macOS-latest'
7979
run: |
8080
echo "skip.android=true" > local.properties
81-
- name: Set up JDK 11
81+
- name: Set up JDK 21
8282
uses: actions/setup-java@v4
8383
with:
84-
java-version: 17
84+
java-version: 21
8585
distribution: 'adopt'
8686
- name: Check JVM
8787
if: matrix.os != 'windows-latest'

.github/workflows/snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ jobs:
8787
if: matrix.os == 'macOS-latest'
8888
run: |
8989
echo "skip.android=true" > local.properties
90-
- name: Set up JDK 11
90+
- name: Set up JDK 21
9191
uses: actions/setup-java@v4
9292
with:
93-
java-version: 17
93+
java-version: 21
9494
distribution: 'adopt'
9595
- name: Check JVM
9696
if: matrix.os != 'windows-latest'

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ jobs:
9393
if: matrix.os == 'macOS-latest'
9494
run: |
9595
echo "skip.android=true" > local.properties
96-
- name: Set up JDK 11
96+
- name: Set up JDK 21
9797
uses: actions/setup-java@v4
9898
with:
99-
java-version: 17
99+
java-version: 21
100100
distribution: 'adopt'
101101
- name: Check JVM
102102
if: matrix.os != 'windows-latest'

build.gradle.kts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import org.gradle.internal.os.OperatingSystem
22
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
33
import org.jetbrains.dokka.Platform
4+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
5+
import java.util.*
46

57
plugins {
6-
kotlin("multiplatform") version "1.9.22"
7-
id("org.jetbrains.dokka") version "1.9.10"
8+
kotlin("multiplatform") version "2.1.10"
9+
id("org.jetbrains.dokka") version "1.9.20"
810
`maven-publish`
911
}
1012

@@ -15,14 +17,13 @@ buildscript {
1517
}
1618

1719
dependencies {
18-
classpath("com.android.tools.build:gradle:7.3.1")
19-
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
20+
classpath("com.android.tools.build:gradle:8.2.2")
2021
}
2122
}
2223

2324
allprojects {
2425
group = "fr.acinq.secp256k1"
25-
version = "0.16.0"
26+
version = "0.17.0-SNAPSHOT"
2627

2728
repositories {
2829
google()
@@ -38,16 +39,16 @@ kotlin {
3839
val commonMain by sourceSets.getting
3940

4041
jvm {
41-
compilations.all {
42-
kotlinOptions.jvmTarget = "1.8"
42+
compilerOptions {
43+
jvmTarget.set(JvmTarget.JVM_1_8)
4344
}
4445
}
4546

4647
fun KotlinNativeTarget.secp256k1CInterop(target: String) {
4748
compilations["main"].cinterops {
4849
val libsecp256k1 by creating {
4950
includeDirs.headerFilterOnly(project.file("native/secp256k1/include/"))
50-
tasks[interopProcessingTaskName].dependsOn(":native:buildSecp256k1${target.capitalize()}")
51+
tasks[interopProcessingTaskName].dependsOn(":native:buildSecp256k1${target.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}")
5152
}
5253
}
5354
}
@@ -98,10 +99,14 @@ allprojects {
9899
configure(targets) {
99100
compilations.all {
100101
cinterops.all { tasks[interopProcessingTaskName].enabled = false }
101-
compileKotlinTask.enabled = false
102+
compileTaskProvider { enabled = false }
102103
tasks[processResourcesTaskName].enabled = false
103104
}
104-
binaries.all { linkTask.enabled = false }
105+
binaries.all {
106+
linkTaskProvider.configure {
107+
enabled = false
108+
}
109+
}
105110

106111
mavenPublication {
107112
val publicationToDisable = this
@@ -156,7 +161,7 @@ allprojects {
156161

157162
if (project.name !in listOf("native", "tests")) {
158163
afterEvaluate {
159-
val dokkaOutputDir = buildDir.resolve("dokka")
164+
val dokkaOutputDir = layout.buildDirectory.dir("dokka").get().asFile
160165

161166
tasks.dokkaHtml {
162167
outputDirectory.set(file(dokkaOutputDir))
@@ -168,6 +173,7 @@ allprojects {
168173
Platform.native -> "native"
169174
Platform.common -> "common"
170175
Platform.wasm -> "wasm"
176+
else -> error("invalid platform ${platform.get()}")
171177
}
172178
displayName.set(platformName)
173179

gradle/wrapper/gradle-wrapper.jar

-15.4 KB
Binary file not shown.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4-
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)