Skip to content

Commit

Permalink
Bump korlibs to 6.0.0-alpha2 (#2233)
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz authored Jun 13, 2024
1 parent 46bf0a9 commit 6faab0a
Show file tree
Hide file tree
Showing 95 changed files with 881 additions and 535 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/TEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
matrix:
include:
- { outputKey: testIos, os: macos-11, testTask: iosX64Test, precompileTask: compileTestKotlinIosX64, enableKotlinNative: true }
- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmJsBrowserTest", buildTasks: "jsNodeTest jsBrowserTest", precompileTask: "wasmJsTestClasses jsTestClasses" }
- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmJsBrowserTest", buildTasks: "jsBrowserTest", precompileTask: "wasmJsTestClasses jsTestClasses" }
- { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true, precompileTask: "compileDebugAndroidTestSources" }
- { outputKey: testJvmMacos, os: macos-11, testTask: jvmTest, precompileTask: "compileTestKotlinJvm compileTestKotlin" }
- { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: "compileTestKotlinJvm compileTestKotlin", enableKotlinNative: true, enableSandbox: true, e2e: true }
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data class ASEInfo(
val tags = arrayListOf<AseTag>()

val fileSize = s.readS32LE()
if (s.length < fileSize) error("File too short")
if (s.length < fileSize) error("File too short s.length=${s.length} < fileSize=${fileSize}")
val headerMagic = s.readU16LE()
if (headerMagic != 0xA5E0) error("Not an Aseprite file : headerMagic=$headerMagic")
val numFrames = s.readU16LE()
Expand Down
1 change: 1 addition & 0 deletions e2e/e2e-test/src/commonMain/kotlin/RefMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import korlibs.io.lang.*
import korlibs.io.serialization.json.Json
import korlibs.math.geom.*
import korlibs.math.interpolation.*
import korlibs.io.file.jail

suspend fun main() = Korge(windowSize = Size(768, 512), backgroundColor = Colors["#2b2b2b"]) {
//println("StandardPaths.cwd=${korlibs.io.file.std.StandardPaths.cwd}")
Expand Down
28 changes: 6 additions & 22 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,21 @@ asm = "9.5"
jgit = "5.13.1.202206130422-r"

kotlin = "2.0.0"
kotlinx-coroutines = "1.8.0"
kotlinx-serialization = "1.6.2"
kotlinx-atomicfu = "0.23.1"
#kotlinx-coroutines = "1.8.1"
kotlinx-coroutines = "1.9.0-RC"
kotlinx-serialization = "1.7.0"
kotlinx-atomicfu = "0.24.0"

korlibs = "5.5.0-alpha3"

#maven { url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") }

# https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/org/jetbrains/kotlin/kotlin-stdlib/
#kotlin = "1.9.0-dev-6976"
#kotlin = "1.9.20-dev-2332"
#kotlin = "1.9.20-dev-2914"
# https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental/org/jetbrains/kotlinx/atomicfu/
# https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental/org/jetbrains/kotlinx/kotlinx-coroutines-core/
#kotlinx-coroutines = "1.7.2-wasm1"
#kotlinx-serialization = "1.6.0-wasm0"
korlibs = "6.0.0-alpha2"

kotlinx-benchmark = "0.4.7"
dokka = "1.9.10"
kover = "0.6.1"
kover-agent = "1.0.712"
node = "20.12.1"
#android-build-gradle = "7.4.2"
#android-build-gradle = "8.0.0"
#android-build-gradle = "7.4.0-beta02"
#android-build-gradle = "7.3.1"
#android-build-gradle = "8.1.0-alpha04"
#android-build-gradle = "8.2.0" # The project is using an incompatible version (AGP 8.2.0) of the Android Gradle plugin. Latest supported version is AGP 8.2.0-beta05
android-build-gradle = "8.2.0"
gson = "2.10.1"
gradle-publish-plugin = "1.1.0"
#gradle-publish-plugin = "0.14.0"
closure-compiler = "v20210808"
# https://repo.maven.apache.org/maven2/org/jetbrains/intellij/deps/intellij-coverage-agent/

Expand All @@ -50,6 +33,7 @@ korlibs-audio = { module = "com.soywiz:korlibs-audio", version.ref = "korlibs" }
korlibs-image = { module = "com.soywiz:korlibs-image", version.ref = "korlibs" }
korlibs-inject = { module = "com.soywiz:korlibs-inject", version.ref = "korlibs" }
korlibs-template = { module = "com.soywiz:korlibs-template", version.ref = "korlibs" }
korlibs-time = { module = "com.soywiz:korlibs-time", version.ref = "korlibs" }
korlibs-serialization-yaml = { module = "com.soywiz:korlibs-serialization-yaml", version.ref = "korlibs" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private val GITHUB_TREE_REGEX = Regex("(https://github\\.com\\/.*?\\/.*?)\\/tree

fun Dependency.Companion.parseString(str: String, projectFile: FileRef = MemoryFileRef()): Dependency {
try {
val parts = str.split("::")
val parts = str.split(Regex("(::|##)"))
val firstPart = parts.first()
when (firstPart) {
// - git::adder::korlibs/kproject::/modules/adder::54f73b01cea9cb2e8368176ac45f2fca948e57db
Expand Down Expand Up @@ -133,7 +133,8 @@ fun Dependency.Companion.parseString(str: String, projectFile: FileRef = MemoryF
- git@github.com:korlibs/korge-ext.git/korge-tiled#0.0.1::734d96ccc18733064ef9fbda8ac359585011112d
- "https://github.com/korlibs/korge-ext.git/korge-tiled#0.0.1::734d96ccc18733064ef9fbda8ac359585011112d"
- "https://github.com/korlibs/korge-parallax/tree/0.0.1/korge-parallax::dacd7f4c430c48349565295394f723b05841c54a"
- https://github.com/korlibs/korge-virtualcontroller/tree/v1.0.2/korge-virtualcontroller##df0e840b8171bb3f5b8f7a86b77fbe39e725be16
## MAVEN:
- maven::common::org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4
- com.soywiz.korlibs.korge2:korge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ data class LocalFileRef(val file: File) : FileRef {
}

data class GitFileRef(val git: GitRepository, val ref: String, val path: String) : FileRef {
init {
//println("GitFileRef(ref='$ref', path='$path')")
//check(!ref.contains("#")) { "Ref contains #" }
}

override val name: String get() = PathInfo(path).name
override fun writeBytes(data: ByteArray) = TODO()
override fun readBytes(): ByteArray = git.useGit { it.readFile(ref, path) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.serialization")
}
dependencies {
add("commonMainApi", "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
add("commonMainApi", "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0")
add("commonMainApi", project(":mymodule"))
}
[file("build.extra.gradle"), file("build.extra.gradle.kts")].each { extraGradle ->
Expand Down
1 change: 0 additions & 1 deletion korge-korlibs
Submodule korge-korlibs deleted from de91b0
2 changes: 2 additions & 0 deletions korge-sandbox/src/samples/MainBezier.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package samples
import korlibs.image.color.*
import korlibs.image.vector.*
import korlibs.io.async.*
import korlibs.io.async.launch
import korlibs.korge.scene.*
import korlibs.korge.tween.*
import korlibs.korge.view.*
Expand All @@ -11,6 +12,7 @@ import korlibs.math.geom.bezier.*
import korlibs.math.interpolation.*
import korlibs.math.random.*
import korlibs.time.*
import kotlinx.coroutines.*
import kotlin.random.*

class MainBezier : Scene() {
Expand Down
1 change: 1 addition & 0 deletions korge-sandbox/src/samples/MainFilterSwitch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import korlibs.image.format.readBitmap
import korlibs.io.async.launch
import korlibs.io.async.launchImmediately
import korlibs.io.file.std.resourcesVfs
import kotlinx.coroutines.*
import util.*
import kotlin.random.Random

Expand Down
3 changes: 2 additions & 1 deletion korge-sandbox/src/samples/MainFilters.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import korlibs.korge.scene.*
import korlibs.korge.tween.*
import korlibs.korge.view.*
import korlibs.korge.view.filter.*
import korlibs.math.geom.*
import korlibs.math.interpolation.*
import korlibs.time.*

class MainFilters : ScaledScene(768, 512) {
override suspend fun SContainer.sceneMain() {
val bitmap = resourcesVfs["korge.png"].readBitmap()

val wave = WaveFilter()
val wave = WaveFilter(crestDistance = Vector2D(200, 200), amplitude = Vector2D(24, 24))
image(bitmap) {
scale(.5)
position(0, 0)
Expand Down
2 changes: 1 addition & 1 deletion korge-sandbox/src/samples/MainFiltersRenderToBitmap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MainFiltersRenderToBitmap : Scene() {
val container = FixedSizeContainer(Size(width, height)).apply {
//scale(2.0, 2.0)
println("PREPARING VIEWS...")
image(bitmap).scale(.5).position(0, 0).addFilter(WaveFilter(time = 0.5.seconds))
image(bitmap).scale(.5).position(0, 0).addFilter(WaveFilter(time = 0.5.seconds, crestDistance = Vector2D(200, 200), amplitude = Vector2D(24, 24)))
//image(bitmap).scale(.5).position(256, 0).addFilter(DirectionalBlurFilter(radius = 32.0))
image(bitmap).scale(.5).position(256, 0).addFilter(BlurFilter(radius = 32.0))
image(bitmap).scale(.5).position(512, 0).addFilter(TransitionFilter(TransitionFilter.Transition.SWEEP, reversed = false, spread = 1.0, ratio = Ratio.HALF))
Expand Down
3 changes: 2 additions & 1 deletion korge-sandbox/src/samples/MainFiltersSample.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import korlibs.korge.scene.*
import korlibs.korge.tween.*
import korlibs.korge.view.*
import korlibs.korge.view.filter.*
import korlibs.math.geom.*
import korlibs.math.interpolation.*
import korlibs.time.*

class MainFiltersSample : Scene() {
override suspend fun SContainer.sceneMain() {
val bitmap = resourcesVfs["korge.png"].readBitmap()

val wave = WaveFilter()
val wave = WaveFilter(crestDistance = Vector2D(200, 200), amplitude = Vector2D(24, 24))
image(bitmap) {
scale(.5)
position(0, 0)
Expand Down
3 changes: 2 additions & 1 deletion korge-sandbox/src/samples/MainFlag.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import korlibs.korge.scene.*
import korlibs.korge.view.*
import korlibs.korge.view.filter.*
import korlibs.time.*
import kotlin.time.*

class MainFlag : ScaledScene(592, 592) {
override suspend fun SContainer.sceneMain() {
Expand All @@ -31,7 +32,7 @@ class MainFlag : ScaledScene(592, 592) {
}

// Propagates the wave over time
addUpdater { dt: TimeSpan ->
addUpdater { dt: Duration ->
//println("MainFlag.addUpdater: dt=$dt")
flagFilter.time = flagFilter.time.plus(dt)
invalidateRender()
Expand Down
14 changes: 9 additions & 5 deletions korge-sandbox/src/samples/MainPolyphonic.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import korlibs.korge.scene.*
import korlibs.korge.ui.*
import korlibs.korge.view.*
import korlibs.math.*
import kotlinx.atomicfu.*
import kotlin.math.*

class MainPolyphonic : Scene() {
Expand Down Expand Up @@ -55,11 +56,11 @@ class MainPolyphonic : Scene() {

data class Note_t(val note: Int, val octave: Int, val duration: Int)
data class ChannelState_t(
val currentNote: KorAtomicRef<Note_t> = KorAtomicRef(Note_t(0, 0, 0)),
val noteIndex: KorAtomicInt = KorAtomicInt(0),
val currentTime: KorAtomicInt = KorAtomicInt(0),
val currentsampleIndex: KorAtomicFloat = KorAtomicFloat(0f),
val currentsampleIncrement: KorAtomicFloat = KorAtomicFloat(0f)
val currentNote: AtomicRef<Note_t> = atomic(Note_t(0, 0, 0)),
val noteIndex: AtomicInt = atomic(0),
val currentTime: AtomicInt = atomic(0),
val currentsampleIndex: AtomicRef<Float> = atomic(0f),
val currentsampleIncrement: AtomicRef<Float> = atomic(0f)
)

val channelStates = Array(2) { ChannelState_t() }
Expand Down Expand Up @@ -408,3 +409,6 @@ class MainPolyphonic : Scene() {
}
}
}

private fun AtomicRef<Float>.addAndGetMod(delta: Float, modulo: Float): Float = updateAndGet { (it + delta) % modulo }
private fun AtomicRef<Double>.addAndGetMod(delta: Double, modulo: Double): Double = updateAndGet { (it + delta) % modulo }
2 changes: 2 additions & 0 deletions korge-sandbox/src/samples/MainShapes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package samples

import korlibs.image.color.*
import korlibs.io.async.*
import korlibs.io.async.launch
import korlibs.korge.input.*
import korlibs.korge.scene.*
import korlibs.korge.view.*
import korlibs.math.geom.*
import korlibs.time.*
import kotlinx.coroutines.*

class MainShapes : Scene() {
override suspend fun SContainer.sceneMain() {
Expand Down
1 change: 1 addition & 0 deletions korge-sandbox/src/samples/MainTextMetrics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import korlibs.image.color.*
import korlibs.image.font.*
import korlibs.image.text.*
import korlibs.io.async.*
import korlibs.io.file.*
import korlibs.io.file.std.*
import korlibs.korge.input.*
import korlibs.korge.scene.*
Expand Down
2 changes: 2 additions & 0 deletions korge-sandbox/src/samples/MainTweenPoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import korlibs.image.color.*
import korlibs.image.format.*
import korlibs.image.vector.*
import korlibs.io.async.*
import korlibs.io.async.launch
import korlibs.io.file.std.*
import korlibs.korge.scene.*
import korlibs.korge.tween.*
Expand All @@ -13,6 +14,7 @@ import korlibs.math.geom.shape.*
import korlibs.math.geom.vector.*
import korlibs.math.interpolation.*
import korlibs.time.*
import kotlinx.coroutines.*

class MainTweenPoint : Scene() {
override suspend fun SContainer.sceneMain() {
Expand Down
1 change: 1 addition & 0 deletions korge-sandbox/src/samples/asteroids/Game.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import korlibs.korge.view.align.*
import korlibs.math.geom.*
import korlibs.math.random.*
import korlibs.time.*
import kotlinx.coroutines.*
import onCollision
import kotlin.random.*

Expand Down
Loading

0 comments on commit 6faab0a

Please sign in to comment.