Skip to content

Commit

Permalink
Merge branch 'main' into fixOr
Browse files Browse the repository at this point in the history
  • Loading branch information
ionspin committed Jul 14, 2024
2 parents a8bbec2 + a53ea6f commit 36ecfe1
Show file tree
Hide file tree
Showing 25 changed files with 643 additions and 3,599 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/github-pull-request-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

name: Build project and run tests.
run-name: ${{ github.actor }} pull request
on:
pull_request:
branches:
- main

jobs:
Build-And-Test-Linux:
runs-on: ubuntu-latest
steps:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout
uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
- run: CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} ./linuxBuild.sh
Build-And-Test-Mac:
runs-on: macos-latest
steps:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout
uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- run: CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} ./macBuild.sh
Build-And-Test-Windows:
runs-on: windows-latest
steps:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout
uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- shell: msys2 {0}
run: |
./windowsBuild.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ build/
/buildSrc/out
/bignum/node_modules
zignum/
.kotlin/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

##### 0.3.10-SNAPSHOT - current snapshot
- Fix for #280, return byte array containing zero instead of empty array when big integer is zero.
- Fix for #291, override hashCode as well as equals in ModularBigInteger
- Fix for #292, negate for Modular big intiger did nothing.
- Bump to kotlin 2.0.0
- Add github action for pull request build and test.


##### 0.3.9 - 28.1.2024
- Bump to kotlin 1.9.21
Expand Down
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

0 comments on commit 36ecfe1

Please sign in to comment.