Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(deps): fix js build and remove native build because of hardcoding…
Browse files Browse the repository at this point in the history
… issues in kotlin 1.6.10
  • Loading branch information
mirceanis committed Mar 20, 2022
1 parent eb32d2f commit ed2b0e5
Show file tree
Hide file tree
Showing 4 changed files with 3,320 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -277,3 +277,4 @@ gradle-app.setting
**/build/

# End of https://www.toptal.com/developers/gitignore/api/intellij,kotlin,node,gradle
/kotlin-js-store/yarn.lock
23 changes: 15 additions & 8 deletions build.gradle.kts
Expand Up @@ -32,12 +32,13 @@ kotlin {
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
// // XXX: disabling native targets because they still cause trouble on apple M1 in kotlin 1.6.10
// val nativeTarget = when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// isMingwX64 -> mingwX64("native")
// else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
// }

sourceSets {
val commonMain by getting
Expand All @@ -59,8 +60,9 @@ kotlin {
implementation(kotlin("test-js"))
}
}
val nativeMain by getting
val nativeTest by getting
// // XXX: disabling native targets because they still cause trouble on apple M1 in kotlin 1.6.10
// val nativeMain by getting
// val nativeTest by getting
}
}

Expand All @@ -85,3 +87,8 @@ fun getCurrentVersion(): String {
val props = loadProperties("version.properties")
return props.getProperty("version") ?: "0.0.42-dev"
}

// // XXX: workaround for hardcoded nodejs version bug in kotlin 1.6.10
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"private": "true",
"description": "A naive Elgamal commutative encryption implementation using Curve25519.",
"scripts": {
"test": "./gradlew jvmTest jsTest nativeTest",
"test": "./gradlew jvmTest jsTest",
"build": "./gradlew build",
"release": "semantic-release --debug"
},
Expand Down

0 comments on commit ed2b0e5

Please sign in to comment.