[Refactoring] Moved library version management to libs.versions.toml file

This commit is contained in:
hartie95 2024-01-30 12:58:03 +01:00
parent d41ac53643
commit 6c013a7557
7 changed files with 128 additions and 49 deletions

View File

@ -1,14 +1,15 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("java-library") `version-catalog`
`java-library`
kotlin("jvm") kotlin("jvm")
kotlin("plugin.lombok") version "1.9.22" alias(libs.plugins.kotlin.lombok)
id("io.freefair.lombok") version "8.1.0" alias(libs.plugins.lombok)
} }
group = "org.anime_game_servers.lua" group = "org.anime_game_servers.lua"
version = "0.1" version = libs.versions.anime.game.lua.get()
repositories { repositories {
mavenCentral() mavenCentral()
@ -16,16 +17,15 @@ repositories {
} }
dependencies { dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation(platform("org.junit:junit-bom:${libs.versions.junit}"))
testImplementation("org.junit.jupiter:junit-jupiter") testImplementation(libs.junit)
implementation("org.anime_game_servers.lua:base-jvm:0.1") implementation(libs.jvm.kotlin.stdlib)
api("org.anime_game_servers.core:gi:0.1") api(libs.bundles.jvm.ags.lua.gi)
implementation("com.google.code.findbugs:jsr305:3.0.2") implementation(libs.findbugs.jsr305)
implementation(kotlin("stdlib-jdk8")) implementation(libs.jvm.logging)
compileOnly("org.projectlombok:lombok:1.18.30") compileOnly(libs.jvm.lombok)
annotationProcessor("org.projectlombok:lombok:1.18.30") annotationProcessor(libs.jvm.lombok)
implementation("com.github.davidmoten:rtree-multi:0.1") implementation(libs.jvm.rtree.multi)
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0")
} }
tasks.withType<KotlinCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach {
compilerOptions { compilerOptions {

View File

@ -1,28 +1,29 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("java-library") `version-catalog`
`java-library`
kotlin("jvm") kotlin("jvm")
} }
group = "org.anime_game_servers.lua" group = "org.anime_game_servers.lua"
version = "0.1" version = libs.versions.anime.game.lua.get()
repositories { repositories {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation(platform("org.junit:junit-bom:${libs.versions.junit}"))
testImplementation("org.junit.jupiter:junit-jupiter") testImplementation(libs.junit)
implementation("org.anime_game_servers.lua:base-jvm:0.1") implementation(libs.jvm.kotlin.stdlib)
implementation("com.google.code.findbugs:jsr305:3.0.2") api(libs.bundles.jvm.ags.lua.engine)
implementation("org.anime_game_servers:JNLua_GC:0.1.0") implementation(libs.findbugs.jsr305)
implementation(kotlin("stdlib-jdk8")) implementation(libs.jvm.jnlua)
compileOnly("org.projectlombok:lombok:1.18.30") compileOnly(libs.jvm.lombok)
annotationProcessor("org.projectlombok:lombok:1.18.30") annotationProcessor(libs.jvm.lombok)
implementation("com.esotericsoftware:reflectasm:1.11.9") implementation(libs.bundles.jvm.reflection)
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0") implementation(libs.jvm.logging)
} }
tasks.test { tasks.test {
@ -37,6 +38,11 @@ compileTestKotlin.kotlinOptions {
jvmTarget = "17" jvmTarget = "17"
} }
java {
withSourcesJar()
withJavadocJar()
}
publishing { publishing {
publications { publications {
create<MavenPublication>("maven") { create<MavenPublication>("maven") {

View File

@ -1,34 +1,40 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("java-library") `version-catalog`
`java-library`
kotlin("jvm") kotlin("jvm")
} }
group = "org.anime_game_servers.lua" group = "org.anime_game_servers.lua"
version = "0.1" version = libs.versions.anime.game.lua.get()
repositories { repositories {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation(platform("org.junit:junit-bom:${libs.versions.junit}"))
testImplementation("org.junit.jupiter:junit-jupiter") testImplementation(libs.junit)
implementation("org.anime_game_servers.lua:base-jvm:0.1") implementation(libs.jvm.kotlin.stdlib)
implementation("com.google.code.findbugs:jsr305:3.0.2") api(libs.bundles.jvm.ags.lua.engine)
implementation("org.anime_game_servers:luaj:3.0.3") implementation(libs.findbugs.jsr305)
compileOnly("org.projectlombok:lombok:1.18.30") implementation(libs.jvm.luaj)
annotationProcessor("org.projectlombok:lombok:1.18.30") compileOnly(libs.jvm.lombok)
implementation("com.esotericsoftware:reflectasm:1.11.9") annotationProcessor(libs.jvm.lombok)
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0") implementation(libs.bundles.jvm.reflection)
implementation(kotlin("stdlib-jdk8")) implementation(libs.jvm.logging)
} }
tasks.test { tasks.test {
useJUnitPlatform() useJUnitPlatform()
} }
java {
withSourcesJar()
withJavadocJar()
}
publishing { publishing {
publications { publications {
create<MavenPublication>("maven") { create<MavenPublication>("maven") {

View File

@ -1,9 +1,10 @@
plugins { plugins {
`version-catalog`
kotlin("multiplatform") kotlin("multiplatform")
} }
group = "org.anime_game_servers.lua" group = "org.anime_game_servers.lua"
version = "0.1" version = libs.versions.anime.game.lua.get()
kotlin { kotlin {
jvm { jvm {
@ -43,20 +44,19 @@ kotlin {
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
api("org.anime_game_servers.core:base:0.1") implementation(libs.ags.core.base)
implementation(kotlin("reflect")) implementation(libs.kotlin.reflect)
implementation(libs.logging)
} }
} }
val commonTest by getting { val commonTest by getting {
} }
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
api("org.anime_game_servers.core:base-jvm:0.1") implementation(libs.jvm.ags.core.base)
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0") implementation(libs.bundles.jvm.reflection)
implementation("com.esotericsoftware:reflectasm:1.11.9") implementation(libs.findbugs.jsr305)
implementation("com.google.code.findbugs:jsr305:3.0.2") implementation(libs.jvm.logging)
implementation(kotlin("reflect"))
implementation ("org.reflections:reflections:0.10.2")
} }
} }
val jvmTest by getting val jvmTest by getting

View File

@ -1,13 +1,14 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
`version-catalog`
id("java") id("java")
id("maven-publish") id("maven-publish")
kotlin("multiplatform") version "1.9.22" apply false alias(libs.plugins.kotlin.multiplatform) apply false
} }
group = "org.anime_game_servers" group = "org.anime_game_servers"
version = "0.1" version = libs.versions.anime.game.lua
repositories { repositories {
mavenCentral() mavenCentral()

66
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,66 @@
[versions]
# https://kotlinlang.org/docs/releases.html#release-details
kotlin = "1.9.22"
# https://github.com/Kotlin/kotlinx-io/releases
kx_io = "0.3.0"
# https://github.com/oshai/kotlin-logging/releases
logger = "6.0.3"
# https://mvnrepository.com/artifact/com.esotericsoftware/reflectasm/1.11.9 // TODO not maintained anymore
reflectasm = "1.11.9"
# https://github.com/ronmamo/reflections/releases // TODO not maintained anymore
reflections = "0.10.2"
# https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305
jsr305 = "3.0.2"
# https://projectlombok.org/download
lombok_libs = "1.18.30"
# https://plugins.gradle.org/plugin/io.freefair.lombok
lombok_plugin = "8.4"
# https://github.com/davidmoten/rtree-multi/releases
rtree_multi = "0.1"
## testing libs
# https://github.com/junit-team/junit5/releases
junit = "5.10.1"
## ags libs
# https://github.com/Hartie95/JNLua_GC
luaEngine_jnlua = "0.1.0"
# https://github.com/Hartie95/luaj
luaEngine_luaj = "3.0.3"
# https://github.com/Hartie95/Core
ags_core = "0.1"
anime_game_lua = "0.1"
[libraries]
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
jvm-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kx_io" }
logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logger" }
jvm-logging = { module = "io.github.oshai:kotlin-logging-jvm", version.ref = "logger" }
reflectasm = { module = "com.esotericsoftware:reflectasm", version.ref = "reflectasm" }
reflections = { module = "org.reflections:reflections", version.ref = "reflections" }
findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" }
jvm-lombok = { module = "org.projectlombok:lombok", version.ref = "lombok_libs" }
jvm-rtree-multi = { module = "com.github.davidmoten:rtree-multi", version.ref = "rtree_multi" }
junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
jvm-jnlua = { module = "org.anime_game_servers:JNLua_GC", version.ref = "luaEngine_jnlua" }
jvm-luaj = { module = "org.anime_game_servers:luaj", version.ref = "luaEngine_luaj" }
ags-core-base = { module = "org.anime_game_servers.core:base", version.ref = "ags_core" }
jvm-ags-core-base = { module = "org.anime_game_servers.core:base-jvm", version.ref = "ags_core" }
ags-core-gi = { module = "org.anime_game_servers.core:gi", version.ref = "ags_core" }
jvm-ags-core-gi = { module = "org.anime_game_servers.core:gi-jvm", version.ref = "ags_core" }
jvm-ags-lua-base = { module = "org.anime_game_servers.lua:base-jvm", version.ref = "anime_game_lua" }
[bundles]
jvm-reflection = ["kotlin-reflect", "reflectasm", "reflections"]
jvm-ags-lua-gi = ["jvm-ags-core-base", "jvm-ags-core-gi", "jvm-ags-lua-base"]
jvm-ags-lua-engine = ["jvm-ags-core-base", "jvm-ags-core-gi", "jvm-ags-lua-base"]
[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-lombok = { id = "org.jetbrains.kotlin.plugin.lombok", version.ref = "kotlin" }
lombok = { id = "io.freefair.lombok", version.ref = "lombok_plugin" }

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.