Skip to content

New targets #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/github-pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
branches:
- main

env:
CHROME_BIN: "chrome"
jobs:
Build-And-Test-Linux:
runs-on: ubuntu-latest
Expand All @@ -20,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
- run: ./linuxBuild.sh
- run: CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} ./linuxBuild.sh
Build-And-Test-Mac:
runs-on: macos-latest
steps:
Expand All @@ -32,7 +30,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
- run: ./macBuild.sh
id: setup-chrome
- run: CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} ./macBuild.sh
Build-And-Test-Windows:
runs-on: windows-latest
steps:
Expand All @@ -45,6 +44,7 @@ jobs:
uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- shell: msys2 {0}
run: |
./windowsBuild.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and bug-fixing.

### WASM

WASM platform is experimental, use with caution. Note that currently wasm returns a value after converting to IEEE-754 number, unlike
WASM platform is experimental, use with caution, tests for wasm are not run on Windows and Mac at the moment. Note that currently wasm returns a value after converting to IEEE-754 number, unlike
other platforms (JVM, JS, Native), so if you use:
```kotlin
val a = BigDecimal.fromFloat(0.000000000000123f)
Expand Down
137 changes: 65 additions & 72 deletions bignum-serialization-kotlinx/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest

plugins {
kotlin(PluginsDeps.multiplatform)
Expand Down Expand Up @@ -28,8 +29,10 @@ val primaryDevelopmentOs: HostOs = if (bignumPrimaryDevelopmentOs != null) {
"linux" -> HostOs.LINUX
"windows" -> HostOs.WINDOWS
"mac" -> HostOs.MAC
else -> throw org.gradle.api.GradleException("Invalid development enviromoment OS selecte: " +
"$bignumPrimaryDevelopmentOs. Only linux, windows and mac are supported at the moment")
else -> throw org.gradle.api.GradleException(
"Invalid development enviromoment OS selecte: " +
"$bignumPrimaryDevelopmentOs. Only linux, windows and mac are supported at the moment"
)
}
} else {
HostOs.LINUX
Expand Down Expand Up @@ -66,74 +69,78 @@ signing {
}

kotlin {

val hostOs = getHostOsName()
if (hostOs == primaryDevelopmentOs) {
jvm()
js(IR) {
jvm()
js {
compilations {
this.forEach {
it.compileTaskProvider.configure {
kotlinOptions.sourceMap = true
kotlinOptions.metaInfo = true
if (it.name == "main") {
kotlinOptions.main = "call"
}
}
}
nodejs()
browser()
}
wasmJs {
browser()
browser() {
testTask {
useKarma {
useChromeHeadless()
}
}
}
}
}
if (hostOs == HostOs.LINUX) {
linuxX64()
// linuxArm32Hfp() Not supported by kotlinx serialization
// linuxArm64() Not supported by kotlinx serialization
}
linuxX64()
linuxArm64()
androidNativeX64()
androidNativeX86()
androidNativeArm32()
androidNativeArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
macosX64()
macosArm64()
tvos()
tvosArm64()
tvosSimulatorArm64()
watchos()
tvosX64()
watchosArm32()
watchosArm64()
watchosDeviceArm64()
watchosX64()
watchosSimulatorArm64()
// mingwX86() Not supported by kotlinx serialization
mingwX64()
wasmJs {
browser()
}
wasmWasi()

sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin(Deps.Common.stdLib))
implementation(project(Deps.Project.bignum))
implementation(Deps.Common.kotlinxSerialization)
}
commonMain.dependencies {
implementation(kotlin(Deps.Common.stdLib))
implementation(project(Deps.Project.bignum))
implementation(Deps.Common.kotlinxSerialization)
}
val commonTest by getting {
dependencies {
implementation(kotlin(Deps.Common.test))
implementation(kotlin(Deps.Common.testAnnotation))
implementation(Deps.Common.coroutines)
}
commonTest.dependencies {
implementation(kotlin(Deps.Common.test))
implementation(kotlin(Deps.Common.testAnnotation))
implementation(Deps.Common.coroutines)
}

if (hostOs == primaryDevelopmentOs) {
val jvmTest by getting {
dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(kotlin(Deps.Jvm.reflection))
}
}

val jsTest by getting {
dependencies {
implementation(kotlin(Deps.Js.test))
}
}

val wasmJsTest by getting {
dependencies {
implementation(kotlin(Deps.WasmJs.test))
}
jvmTest.dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(kotlin(Deps.Jvm.reflection))
}
jsTest.dependencies {
implementation(kotlin(Deps.Js.test))
}
val wasmJsTest by getting {
dependencies {
implementation(kotlin(Deps.WasmJs.test))
}
}


}
}

Expand Down Expand Up @@ -163,37 +170,23 @@ tasks {
}
}

val jsNodeTest by getting(org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest::class) {
val jsNodeTest by getting(KotlinJsTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
}

val jsBrowserTest by getting(org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest::class) {
val jsBrowserTest by getting(KotlinJsTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
}
}

// val jsLegacyNodeTest by getting(org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest::class) {
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// }
// }
//
// val jsLegacyBrowserTest by getting(org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest::class) {
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// }
// }

if (hostOs == HostOs.LINUX) {
val linuxX64Test by getting(KotlinNativeTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
}
val linuxX64Test by getting(KotlinNativeTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
}
}
}
Expand Down
Loading