Skip to content

Commit

Permalink
Upgrade to Kotlin 1.9, api version 1.8 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoepelman committed Apr 1, 2024
1 parent 8c9e9ad commit 9d5b180
Show file tree
Hide file tree
Showing 5 changed files with 2,069 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin-js-store/yarn.lock linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 8
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ local.properties

# Javascript
node_modules/

# KotlinJS
kotlin-js-store/
103 changes: 72 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
import org.jetbrains.kotlin.config.JvmTarget

val projectVersion = "0.4.0"
val projectName = "konform"
val projectGroup = "io.konform"
val projectDesc = "Konform: Portable validations for Kotlin"
val projectHost = "github"
val projectOrg = "konform-kt"
val projectLicense = "MIT"
val projectLicenseUrl = "http://opensource.org/licenses/MIT"
val projectLicenseUrl = "https://opensource.org/licenses/MIT"
val projectScmUrl = "https://github.com/konform-kt/konform.git"
val projectDevelNick = "nlochschmidt"
val projectDevelName = "Niklas Lochschmidt"
val projectInceptionYear = 2018

val kotlinApiTarget = "1.7"
val jvmTarget = JvmTarget.JVM_1_8
val javaVersion = 8

plugins {
kotlin("multiplatform") version "1.7.10"
kotlin("multiplatform") version "1.9.23"
id("maven-publish")
id("signing")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
idea
}

repositories {
Expand All @@ -27,23 +35,51 @@ version = projectVersion
kotlin {
sourceSets.all {
languageSettings {
languageVersion = "1.5" // Change to 1.6 when switching to Kotlin 1.8
apiVersion = "1.5" // Change to 1.6 when switching to Kotlin 1.8
languageVersion = kotlinApiTarget
apiVersion = kotlinApiTarget
}
}
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = jvmTarget.toString()
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
js(IR) {
browser {}
nodejs {}
}
// linuxX64()
// linuxArm64()
// linuxArm32Hfp()
// linuxMips32()
// linuxMipsel32()
// ios()
// iosX64()
// iosArm64()
// iosSimulatorArm64()
// macosX64()
// macosArm64()
// tvos()
// tvosArm64()
// tvosSimulatorArm64()
// tvosX64()
// watchos()
// watchosArm32()
// watchosSimulatorArm64()
// watchosArm64()
// watchosX86()
// watchosX64()
// wasm()
// wasm32()
// mingwX86()
// mingwX64()
sourceSets {
val commonMain by getting {
dependencies {
Expand All @@ -63,37 +99,35 @@ kotlin {
}
}

tasks.create<Jar>("stubJavadoc") {
val javaDocJar = tasks.register<Jar>("stubJavadoc") {
archiveClassifier.set("javadoc")
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(tasks["stubJavadoc"])
pom {
name.set(projectName)
description.set(projectDesc)
url.set("https://github.com/konform-kt/konform")
licenses {
license {
name.set(projectLicense)
url.set(projectLicenseUrl)
distribution.set("repo")
}
}
developers {
developer {
id.set(projectDevelNick)
name.set(projectDevelName)
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
artifact(javaDocJar)
pom {
name.set(projectName)
description.set(projectDesc)
url.set("https://github.com/konform-kt/konform")
licenses {
license {
name.set(projectLicense)
url.set(projectLicenseUrl)
distribution.set("repo")
}
scm {
url.set("https://github.com/konform-kt/konform.git")
}
developers {
developer {
id.set(projectDevelNick)
name.set(projectDevelName)
}
}
scm {
url.set(projectScmUrl)
}
}
}
}
Expand All @@ -109,3 +143,10 @@ nexusPublishing {
sonatype()
}
}

idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}

0 comments on commit 9d5b180

Please sign in to comment.