-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to Kotest 6.0.M1 + new
arrow-platform
(#3506)
- Loading branch information
Showing
41 changed files
with
161 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicIntTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicLongTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptyListTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptySetTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/test/Platform.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
arrow-libs/core/arrow-functions/src/commonTest/kotlin/arrow/core/AndThenTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
public final class arrow/platform/CurrentPlatform { | ||
public static final fun getPlatform ()Larrow/platform/Platform; | ||
} | ||
|
||
public final class arrow/platform/Platform : java/lang/Enum { | ||
public static final field JS Larrow/platform/Platform; | ||
public static final field JVM Larrow/platform/Platform; | ||
public static final field Native Larrow/platform/Platform; | ||
public static final field WebAssembly Larrow/platform/Platform; | ||
public static fun getEntries ()Lkotlin/enums/EnumEntries; | ||
public static fun valueOf (Ljava/lang/String;)Larrow/platform/Platform; | ||
public static fun values ()[Larrow/platform/Platform; | ||
} | ||
|
||
public final class arrow/platform/PlatformKt { | ||
public static final fun stackSafeIteration ()I | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
arrow-libs/core/arrow-platform/api/arrow-platform.klib.api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Klib ABI Dump | ||
// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, watchosArm32, watchosArm64, watchosSimulatorArm64, watchosX64] | ||
// Rendering settings: | ||
// - Signature version: 2 | ||
// - Show manifest properties: true | ||
// - Show declarations: true | ||
|
||
// Library unique name: <io.arrow-kt:arrow-platform> | ||
final enum class arrow.platform/Platform : kotlin/Enum<arrow.platform/Platform> { // arrow.platform/Platform|null[0] | ||
enum entry JS // arrow.platform/Platform.JS|null[0] | ||
enum entry JVM // arrow.platform/Platform.JVM|null[0] | ||
enum entry Native // arrow.platform/Platform.Native|null[0] | ||
enum entry WebAssembly // arrow.platform/Platform.WebAssembly|null[0] | ||
|
||
final val entries // arrow.platform/Platform.entries|#static{}entries[0] | ||
final fun <get-entries>(): kotlin.enums/EnumEntries<arrow.platform/Platform> // arrow.platform/Platform.entries.<get-entries>|<get-entries>#static(){}[0] | ||
|
||
final fun valueOf(kotlin/String): arrow.platform/Platform // arrow.platform/Platform.valueOf|valueOf#static(kotlin.String){}[0] | ||
final fun values(): kotlin/Array<arrow.platform/Platform> // arrow.platform/Platform.values|values#static(){}[0] | ||
} | ||
|
||
final val arrow.platform/platform // arrow.platform/platform|{}platform[0] | ||
final fun <get-platform>(): arrow.platform/Platform // arrow.platform/platform.<get-platform>|<get-platform>(){}[0] | ||
|
||
final fun arrow.platform/stackSafeIteration(): kotlin/Int // arrow.platform/stackSafeIteration|stackSafeIteration(){}[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@file:Suppress("DSL_SCOPE_VIOLATION") | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
|
||
|
||
plugins { | ||
id(libs.plugins.kotlin.multiplatform.get().pluginId) | ||
alias(libs.plugins.arrowGradleConfig.kotlin) | ||
alias(libs.plugins.publish) | ||
alias(libs.plugins.spotless) | ||
} | ||
|
||
spotless { | ||
kotlin { | ||
ktlint().editorConfigOverride(mapOf("ktlint_standard_filename" to "disabled")) | ||
} | ||
} | ||
|
||
apply(from = property("ANIMALSNIFFER_MPP")) | ||
|
||
kotlin { | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(libs.kotlin.stdlib) | ||
} | ||
} | ||
} | ||
|
||
jvm { | ||
tasks.jvmJar { | ||
manifest { | ||
attributes["Automatic-Module-Name"] = "arrow.platform" | ||
} | ||
} | ||
} | ||
|
||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
compilerOptions { | ||
(project.rootProject.properties["kotlin_language_version"] as? String)?.also { languageVersion = KotlinVersion.fromVersion(it) } | ||
(project.rootProject.properties["kotlin_api_version"] as? String)?.also { apiVersion = KotlinVersion.fromVersion(it) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Maven publishing configuration | ||
POM_NAME=Arrow Platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
knit.package=arrow.platform.examples | ||
knit.dir=src/commonTest/kotlin/examples/ | ||
|
||
test.package=arrow.platform.examples.test | ||
test.dir=src/commonTest/kotlin/examples/autogenerated/ |
18 changes: 18 additions & 0 deletions
18
arrow-libs/core/arrow-platform/src/commonMain/kotlin/arrow/platform/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package arrow.platform | ||
|
||
import kotlin.jvm.JvmName | ||
|
||
public enum class Platform { | ||
JVM, JS, Native, WebAssembly | ||
} | ||
|
||
public expect val platform: Platform | ||
|
||
/** | ||
* Heuristic about the maximum amount of stack space | ||
* one can reasonably consume in the executing platform. | ||
*/ | ||
public fun stackSafeIteration(): Int = when (platform) { | ||
Platform.JVM -> 200_000 | ||
else -> 1000 | ||
} |
3 changes: 3 additions & 0 deletions
3
arrow-libs/core/arrow-platform/src/jsMain/kotlin/arrow/platform/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package arrow.platform | ||
|
||
public actual val platform: Platform = Platform.JS |
4 changes: 4 additions & 0 deletions
4
arrow-libs/core/arrow-platform/src/jvmMain/kotlin/arrow/platform/PlatformJvm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@file:JvmName("CurrentPlatform") | ||
package arrow.platform | ||
|
||
public actual val platform: Platform = Platform.JVM |
3 changes: 3 additions & 0 deletions
3
arrow-libs/core/arrow-platform/src/nativeMain/kotlin/arrow/platform/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package arrow.platform | ||
|
||
public actual val platform: Platform = Platform.Native |
3 changes: 3 additions & 0 deletions
3
arrow-libs/core/arrow-platform/src/wasmJsMain/kotlin/arrow/platform/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package arrow.platform | ||
|
||
public actual val platform: Platform = Platform.WebAssembly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/NamedThreadFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package arrow.fx.coroutines | ||
|
||
import arrow.atomic.AtomicInt | ||
import java.util.concurrent.ThreadFactory | ||
|
||
private val namedThreadCount = AtomicInt(0) | ||
|
||
class NamedThreadFactory(val name: String): ThreadFactory { | ||
override fun newThread(r: Runnable): Thread? = | ||
Thread(r, "$name-${namedThreadCount.getAndIncrement()}").apply { | ||
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e -> | ||
e.printStackTrace() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.