Skip to content

Commit

Permalink
Draft: moving forward to Kotlin 1.9.0 and WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbsl committed Aug 4, 2023
1 parent 4cc8f73 commit 71afad2
Show file tree
Hide file tree
Showing 10 changed files with 285 additions and 533 deletions.
17 changes: 8 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
# Core
kaverit = "2.5.0"
kaverit = "2.6.0-master-SNAPSHOT"
# Android
android-appcompat = "28.0.0"
androidx-appcompat = "1.6.1"
androidx-fragment = "1.5.7"
androidx-fragment = "1.6.1"
androidx-lifecycle = "2.6.1"
androidx-compose = "2.5.3"
androidx-compose = "2.6.0"
# Compose
compose = "1.4.0-dev-wasm06"
compose = "1.4.0-dev-wasm09"
# KSP
kotlinpoet = "1.12.0"
ksp = "1.8.10-1.0.9"
kotlinpoet = "1.14.2"
ksp = "1.9.0-1.0.12"
# Ktor
ktor = "2.3.0"
ktor = "2.3.2"
# JxInject
javax-inject = "1"
# TornadoFX
Expand All @@ -23,7 +23,7 @@ tornadofx = "1.7.20"
testfx = "4.0.4-alpha"
# Test
junit = "4.13.2"
junit-jupiter = "5.6.0"
junit-jupiter = "5.6.3"

[libraries]
# Core
Expand Down Expand Up @@ -57,6 +57,5 @@ junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
jetpack-compose = { id = "org.jetbrains.compose", version.ref = "compose" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
openjfx = { id = "org.openjfx.javafxplugin", version.ref = "openjfx" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.kodein.di.DI
import org.kodein.di.DIContainer
import org.kodein.di.internal.maySynchronized
import org.kodein.di.internal.synchronizedIfNull
import kotlin.jvm.Volatile

/**
* A class that can be used to configure a DI object and as a DI object.
Expand Down Expand Up @@ -62,7 +61,7 @@ public class ConfigurableDI : DI {
/**
* DI instance. If it is not null, than it cannot be configured anymore.
*/
@Volatile
@kotlin.concurrent.Volatile
private var _instance: DI? = null

/**
Expand Down
5 changes: 5 additions & 0 deletions kodein-di/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ kotlin.kodein {
}
}

kotlin.sourceSets {
val jsBasedMain by getting
getByName("wasmMain").dependsOn(jsBasedMain)
}

kodeinUpload {
name = "Kodein"
description = "Kodein Core"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package org.kodein.di.bindings

import org.kodein.di.DI
import org.kodein.di.DIContext
import org.kodein.di.DirectDI
import org.kodein.di.internal.maySynchronized
import org.kodein.di.internal.newConcurrentMap
import org.kodein.di.internal.synchronizedIfNotNull
import org.kodein.di.internal.synchronizedIfNull
import org.kodein.type.TypeToken
import kotlin.jvm.Volatile

public interface ScopeCloseable {
public fun close()
Expand Down Expand Up @@ -110,7 +108,8 @@ public class StandardScopeRegistry : ScopeRegistry() {
*/
public class SingleItemScopeRegistry : ScopeRegistry() {
private val _lock = Any()
@Volatile

@kotlin.concurrent.Volatile
private var _pair: Pair<RegKey, () -> Any?>? = null

override fun getOrCreate(key: RegKey, sync: Boolean, creator: () -> Reference<Any>): Any {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.kodein.di.internal.BindingDIImpl
import org.kodein.di.internal.synchronizedIfNull
import org.kodein.type.TypeToken
import org.kodein.type.erasedOf
import kotlin.jvm.Volatile
import kotlin.concurrent.Volatile

/**
* Concrete factory: each time an instance is needed, the function creator function will be called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.kodein.di.bindings.ExternalSource
import org.kodein.di.bindings.toKContext
import org.kodein.di.description
import org.kodein.di.fullDescription
import kotlin.jvm.Volatile
import kotlin.concurrent.Volatile

internal class DIContainerImpl private constructor(
override val tree: DITree,
Expand All @@ -21,7 +21,8 @@ internal class DIContainerImpl private constructor(
private val fullContainerTreeOnError: Boolean,
) : DIContainer {

@Volatile var initCallbacks: (() -> Unit)? = null
@Volatile
var initCallbacks: (() -> Unit)? = null
private set

/**
Expand Down
Loading

0 comments on commit 71afad2

Please sign in to comment.