Skip to content

Commit

Permalink
Update dependencies (Kotlin 1.7.10), move into versions.toml file (#78)
Browse files Browse the repository at this point in the history
* Update dependencies (Kotlin 1.7.10), move into versions.toml file

* Update workflows
  • Loading branch information
0ffz authored Sep 28, 2022
1 parent b16a258 commit a5283ce
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 147 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/gradle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- '**.md'
pull_request:

concurrency:
cancel-in-progress: true
group: ci-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -23,9 +27,3 @@ jobs:

- name: Build
run: gradle build

# - name: Upload build
# uses: actions/upload-artifact@v1
# with:
# name: build
# path: build/libs
7 changes: 7 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
java-version: 17
cache: gradle

- name: Set env variable from latest maven version
run: >
echo "RELEASE_VERSION=$( \
curl https://repo.mineinabyss.com/releases/com/mineinabyss/geary-core/maven-metadata.xml | \
grep -oP '(?!<latest>)[\d\.]*(?=</latest>)' \
)" >> $GITHUB_ENV
- name: Run gradle build and publish
run: >
gradle build publish dokkaHtmlMultiModule
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
java
kotlin("multiplatform") apply false
id("org.jetbrains.dokka")
id("com.mineinabyss.conventions.autoversion")
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import org.gradle.accessors.dm.LibrariesForLibs

val libs = the<LibrariesForLibs>()
val idofrontVersion: String by project

plugins {
id("com.mineinabyss.conventions.kotlin")
Expand All @@ -22,5 +21,9 @@ dependencies {
exclude(group = "org.jetbrains.kotlin")
}

implementation(libs.idofront.core)
implementation(libs.bundles.idofront.core)
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
}
34 changes: 13 additions & 21 deletions geary-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ plugins {
}

buildscript {
val atomicfuVersion = "0.17.1"

dependencies {
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfuVersion")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${mylibs.versions.atomicfu.get()}")
}
}

Expand Down Expand Up @@ -61,46 +59,40 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:atomicfu:0.17.1")
implementation("com.benasher44:uuid:0.4.0")
implementation(mylibs.atomicfu)
implementation(mylibs.uuid)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.serialization.cbor)
// implementation(gearylibs.bitvector)
// api(libs.kotlinx.coroutines)
api("com.squareup.okio:okio:3.0.0")
api(libs.koin.core)// { isTransitive = false }
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")

api(mylibs.okio)
api(mylibs.kds)
api(libs.koin.core)
api(libs.kotlinx.coroutines)
api(libs.kotlinx.serialization.json)
api("com.soywiz.korlibs.kds:kds:2.2.1")
// implementation(libs.koin.test.junit5)
// implementation("io.kotest:kotest-runner-junit5:5.2.3")
}

}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(libs.koin.core)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1")
implementation("io.kotest:kotest-assertions-core:5.2.3")
implementation("io.kotest:kotest-property:5.2.3")

// implementation("io.insert-koin:koin-test:3.1.5")
// implementation(libs.koin.test)
implementation(libs.kotlinx.coroutines.test)
implementation(libs.kotest.assertions)
implementation(libs.kotest.property)
}
}

val jvmMain by getting {
dependencies {
implementation(libs.kotlinx.serialization.kaml)
implementation("org.roaringbitmap:RoaringBitmap:0.9.25")
implementation(mylibs.roaringbitmap)
}
}
val jvmTest by getting

// val jsMain by getting {
// dependencies {
// api(gearylibs.bitvector.js)
// api(mylibs.bitvector.js)
// }
// }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Serializers {
private val serialName2Component: MutableMap<String, KClass<out Component>> = mutableMapOf()
private val component2serialName: MutableMap<KClass<out Component>, String> = mutableMapOf()
public val module: SerializersModule by lazy {
addonToModuleMap.values.fold(EmptySerializersModule) { acc, module ->
addonToModuleMap.values.fold(EmptySerializersModule()) { acc, module ->
acc.overwriteWith(module)
}
}
Expand Down Expand Up @@ -52,7 +52,7 @@ public class Serializers {

public fun addSerializersModule(namespace: String, module: SerializersModule) {
addonToModuleMap[namespace] =
addonToModuleMap.getOrElse(namespace) { EmptySerializersModule }.overwriteWith(module)
addonToModuleMap.getOrElse(namespace) { EmptySerializersModule() }.overwriteWith(module)
}

public fun clearSerializerModule(addonName: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ public abstract class IndexedAccessor<out T>(
override fun ArchetypeCacheScope.calculate(): T = operation()
}.also { _cached += it }

@Suppress("UNCHECKED_CAST") // Internal logic ensures cast always succeeds
override fun access(scope: ResultScope): T = scope.data[index] as T
}
2 changes: 1 addition & 1 deletion geary-prefabs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
repositories {
}
dependencies {
compileOnly(gearyLibs.fastutil)
compileOnly(libs.fastutil)

compileOnly(project(":geary-core"))
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
group=com.mineinabyss
version=0.20
version=0.21
# Workaround for dokka builds failing on CI, see https://github.com/Kotlin/dokka/issues/1405
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
idofrontVersion=0.12.112
kotlinVersion=1.6.10
idofrontVersion=0.14.3
kotlinVersion=1.7.10
serverVersion=1.19.2-R0.1-SNAPSHOT
dokkaVersion=1.6.10
dokkaVersion=1.7.10
kotlin.mpp.stability.nowarn=true
addRunNumber=false
5 changes: 0 additions & 5 deletions gradle/gearyLibs.versions.toml

This file was deleted.

10 changes: 10 additions & 0 deletions gradle/mylibs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[versions]
atomicfu = "0.18.3"

[libraries]
atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" }
plugman = "com.rylinaux:PlugMan:2.2.5"
uuid = "com.benasher44:uuid:0.5.0"
okio = "com.squareup.okio:okio:3.2.0"
kds = "com.soywiz.korlibs.kds:kds:3.1.0"
roaringbitmap = "org.roaringbitmap:RoaringBitmap:0.9.32"
2 changes: 1 addition & 1 deletion platforms/papermc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations {
excludeDep(libs.koin.core)
excludeDep(libs.fastutil)
excludeDep(libs.kotlin.reflect)
excludeDep(libs.kotlinx.coroutines)
excludeDep(libs.kotlinx.coroutines.asProvider())
excludeDep(libs.reflections)
exclude("org.jetbrains.kotlinx")
exclude("org.jetbrains.kotlin")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.mineinabyss.geary.papermc.store.loadComponentsFrom
import com.mineinabyss.geary.systems.GearyListener
import com.mineinabyss.geary.systems.accessors.EventScope
import com.mineinabyss.geary.systems.accessors.TargetScope
import com.mineinabyss.idofront.plugin.registerEvents
import com.mineinabyss.idofront.plugin.listeners
import com.mineinabyss.idofront.typealiases.BukkitEntity
import it.unimi.dsi.fastutil.ints.Int2LongOpenHashMap
import org.bukkit.entity.Player
Expand All @@ -32,7 +32,7 @@ class BukkitEntity2Geary : Listener, GearyMCContext by GearyMCContextKoin() {
private val entityMap = Int2LongOpenHashMap().apply { defaultReturnValue(-1) }

fun startTracking() {
geary.registerEvents(this)
geary.listeners(this)
systems(Register(), Unregister())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.github.shynixn.mccoroutine.bukkit.minecraftDispatcher
import com.mineinabyss.geary.engine.archetypes.ArchetypeEngine
import com.mineinabyss.geary.systems.GearySystem
import com.mineinabyss.geary.systems.RepeatingSystem
import com.mineinabyss.idofront.plugin.registerEvents
import com.mineinabyss.idofront.plugin.listeners
import com.mineinabyss.idofront.time.ticks
import kotlinx.coroutines.launch
import kotlinx.coroutines.yield
Expand All @@ -32,7 +32,7 @@ class PaperMCEngine(private val plugin: Plugin) : ArchetypeEngine(tickDuration =
super.addSystem(system)

if (system is Listener)
plugin.registerEvents(system)
plugin.listeners(system)
}

override fun scheduleSystemTicking() {
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion platforms/papermc/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies {
api(project(":geary-papermc-core"))

// Other plugins
compileOnly(gearyLibs.plugman)
compileOnly(mylibs.plugman)
}
Loading

0 comments on commit a5283ce

Please sign in to comment.