Skip to content

Commit

Permalink
Migrate to Version Catalog, bump to Kotlin 1.9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelydaniel committed Sep 9, 2023
1 parent 2352723 commit 8d57afe
Show file tree
Hide file tree
Showing 8 changed files with 331 additions and 253 deletions.
6 changes: 2 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
classpath("com.android.tools.build:gradle:7.3.1")
classpath(libs.org.jetbrains.kotlin.gradle.plugin)
classpath(libs.com.android.tools.build.gradle)
}
}

val versionInfo = versionInfo()
println("Version:${versionInfo.versionName}, Type:${versionInfo.type}")

rootProject.ext["kotlin_version"] = "1.7.21"

allprojects {
repositories {
maven("https://plugins.gradle.org/m2/")
Expand Down
18 changes: 18 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[versions]
android-gradle-plugin = "7.3.1"
jogl = "2.3.2"
kotlin = "1.9.10"
lwjgl = "3.3.0"

[libraries]
com-android-tools-build-gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
org-jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
org-jetbrains-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
org-jogamp-jogl-all = { module = "org.jogamp.jogl:jogl-all", version.ref = "jogl" }
org-jogamp-gluegen-rt = { module = "org.jogamp.gluegen:gluegen-rt", version.ref = "jogl" }
org-lwjgl = { module = "org.lwjgl:lwjgl", version.ref = "lwjgl" }
org-lwjgl-assimp = { module = "org.lwjgl:lwjgl-assimp", version.ref = "lwjgl" }
org-lwjgl-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl" }
org-lwjgl-glfw = { module = "org.lwjgl:lwjgl-glfw", version.ref = "lwjgl" }
org-lwjgl-stb = { module = "org.lwjgl:lwjgl-stb", version.ref = "lwjgl" }
org-lwjgl-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl" }
4 changes: 1 addition & 3 deletions kgl-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ android {
}
}

val kotlinVersion = rootProject.ext["kotlin_version"] as String

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation(libs.org.jetbrains.kotlin.stdlib)

implementation(project(":kgl"))
}
Expand Down
4 changes: 4 additions & 0 deletions kgl-ios/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ kotlin {
iosArm64Main.dependsOn(this)
iosX64Main.dependsOn(this)
}

all {
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions kgl-jogl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repositories {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")

implementation("org.jogamp.gluegen:gluegen-rt:2.3.2")
implementation("org.jogamp.jogl:jogl-all:2.3.2")
implementation(libs.org.jogamp.gluegen.rt)
implementation(libs.org.jogamp.jogl.all)

implementation(project(":kgl"))
}
Expand Down
19 changes: 8 additions & 11 deletions kgl-lwjgl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ repositories {
mavenCentral()
}

val lwjglVersion = "3.3.0"
val kotlinVersion = rootProject.ext["kotlin_version"] as String

version = currentVersion

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")

implementation("org.lwjgl:lwjgl:$lwjglVersion")
implementation("org.lwjgl:lwjgl-assimp:$lwjglVersion")
implementation("org.lwjgl:lwjgl-glfw:$lwjglVersion")
implementation("org.lwjgl:lwjgl-openal:$lwjglVersion")
implementation("org.lwjgl:lwjgl-opengl:$lwjglVersion")
implementation("org.lwjgl:lwjgl-stb:$lwjglVersion")
implementation(libs.org.jetbrains.kotlin.stdlib)

implementation(libs.org.lwjgl)
implementation(libs.org.lwjgl.assimp)
implementation(libs.org.lwjgl.glfw)
implementation(libs.org.lwjgl.openal)
implementation(libs.org.lwjgl.opengl)
implementation(libs.org.lwjgl.stb)

implementation(project(":kgl"))
}
Expand Down
8 changes: 6 additions & 2 deletions kgl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.jetbrains.kotlin.multiplatform")
kotlin("multiplatform")
id("maven-publish")
}

Expand All @@ -13,7 +13,7 @@ version = currentVersion
kotlin {
jvm()

js(BOTH) {
js {
browser {
testTask {} // To run tests with browser.
}
Expand Down Expand Up @@ -84,6 +84,10 @@ kotlin {

appleOnlySourceSets.forEach { it.dependsOn(this) }
}

all {
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}
}

Expand Down
Loading

0 comments on commit 8d57afe

Please sign in to comment.