Skip to content

Commit

Permalink
Move to Kotlin 1.9.23, refactor Gradle file and source set directories (
Browse files Browse the repository at this point in the history
  • Loading branch information
findjigar authored Mar 21, 2024
1 parent 6f97449 commit 021b778
Show file tree
Hide file tree
Showing 60 changed files with 823 additions and 2,270 deletions.
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ commonMain {
License
=======

Copyright 2022 Touchlab, Inc.
Copyright 2024 Touchlab, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 0 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,4 @@ val VERSION_NAME: String by project
allprojects {
group = GROUP
version = VERSION_NAME
}

allprojects {
repositories {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}
}
7 changes: 7 additions & 0 deletions convention-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

dependencies {
implementation(libs.kotlin.gradlePlugin)
}
10 changes: 10 additions & 0 deletions convention-plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencyResolutionManagement {
repositories {
gradlePluginPortal()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
67 changes: 67 additions & 0 deletions convention-plugins/src/main/kotlin/kmp-setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

plugins {
kotlin("multiplatform")
}

kotlin {
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
jvm()
js {
nodejs {
testTask {
useMocha {
// Override default timeout (needed for stress tests)
timeout = "120s"
}
}
}
browser()
}
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class)
wasmJs {
browser()
nodejs()
}
macosX64()
iosArm64()
iosX64()
watchosArm32()
watchosArm64()
watchosX64()
watchosDeviceArm64()
tvosArm64()
tvosX64()

macosArm64()
iosSimulatorArm64()
watchosSimulatorArm64()
tvosSimulatorArm64()

mingwX64()
linuxX64()
linuxArm64()

androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()

@Suppress("OPT_IN_USAGE")
applyDefaultHierarchyTemplate {
common {
group("jsAndWasmJs") {
withJs()
withWasm()
}
}
}
}

rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
140 changes: 6 additions & 134 deletions deprecated/stately-collections/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
* limitations under the License.
*/

apply plugin: 'org.jetbrains.kotlin.multiplatform'
plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'kmp-setup'
id 'com.vanniktech.maven.publish'
}

group = GROUP
version = VERSION_NAME
Expand All @@ -23,39 +27,6 @@ configurations {
compileClasspath
}
kotlin {
targetHierarchy.default {}
jvm()
js {
nodejs()
browser()
}
wasm {
browser()
binaries.executable()
}
macosX64()
iosArm64()
iosX64()
watchosArm32()
watchosArm64()
watchosX64()
watchosDeviceArm64()
tvosArm64()
tvosX64()
mingwX64()
linuxX64()
linuxArm64()

macosArm64()
iosSimulatorArm64()
watchosSimulatorArm64()
tvosSimulatorArm64()

androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()

sourceSets {
commonMain {
dependencies {
Expand All @@ -70,104 +41,5 @@ kotlin {
implementation libs.testHelp
}
}

create("jsWasmMain") {
dependsOn commonMain
}

create("jsWasmTest") {
dependsOn commonTest
}

jsMain {
dependsOn jsWasmMain
}
jsTest {
dependsOn jsWasmTest
}

wasmMain {
dependsOn jsWasmMain
}
wasmTest {
dependsOn jsWasmTest
}

nativeCommonMain {
dependsOn commonMain
}
nativeCommonTest {
dependsOn commonTest
}

macosX64Main {
dependsOn nativeCommonMain
}
iosArm64Main {
dependsOn nativeCommonMain
}
iosX64Main {
dependsOn nativeCommonMain
}
watchosArm32Main {
dependsOn nativeCommonMain
}
watchosArm64Main {
dependsOn nativeCommonMain
}
watchosX64Main {
dependsOn nativeCommonMain
}
watchosDeviceArm64Main {
dependsOn nativeCommonMain
}
tvosArm64Main {
dependsOn nativeCommonMain
}
tvosX64Main {
dependsOn nativeCommonMain
}

macosArm64Main {
dependsOn nativeCommonMain
}
iosSimulatorArm64Main {
dependsOn nativeCommonMain
}
watchosSimulatorArm64Main {
dependsOn nativeCommonMain
}
tvosSimulatorArm64Main {
dependsOn nativeCommonMain
}

mingwX64Main {
dependsOn nativeCommonMain
}

linuxX64Main {
dependsOn nativeCommonMain
}
linuxArm64Main {
dependsOn nativeCommonMain
}

androidNativeArm32Main {
dependsOn nativeCommonMain
}

androidNativeArm64Main {
dependsOn nativeCommonMain
}

androidNativeX86Main {
dependsOn nativeCommonMain
}

androidNativeX64Main {
dependsOn nativeCommonMain
}
}
}

apply plugin:"com.vanniktech.maven.publish"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package co.touchlab.stately.collections

import co.touchlab.stately.concurrency.Lock
import kotlin.native.concurrent.AtomicInt
import kotlin.native.concurrent.AtomicReference
import kotlin.concurrent.AtomicInt
import kotlin.concurrent.AtomicReference
import kotlin.native.concurrent.freeze

class CopyOnWriteList<T>(elements: Collection<T>) : MutableList<T> {
Expand Down
Loading

0 comments on commit 021b778

Please sign in to comment.