From 999d00ca3a586eebf7332fed60396bde70e3d59f Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Sat, 4 Sep 2021 00:32:28 +0300 Subject: [PATCH] Changing build scripts for a proper supports of KotlinJS --- .github/workflows/release.yml | 2 -- ktoml-core/build.gradle.kts | 14 ++++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f21b3e4..6462a22e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,6 @@ on: push: tags: - 'v*' - branches: - - main env: PGP_SEC: ${{ secrets.PGP_SEC }} diff --git a/ktoml-core/build.gradle.kts b/ktoml-core/build.gradle.kts index 8bfa7afe..37c719f7 100644 --- a/ktoml-core/build.gradle.kts +++ b/ktoml-core/build.gradle.kts @@ -1,4 +1,5 @@ import com.akuleshov7.buildutils.configurePublishing +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest @@ -9,6 +10,8 @@ plugins { kotlin { explicitApi() + + // building jvm task only on windows jvm { compilations.all { kotlinOptions { @@ -17,11 +20,14 @@ kotlin { } } - js(LEGACY) + val os = getCurrentOperatingSystem() - linuxX64() - mingwX64() - macosX64() + when { + os.isWindows -> mingwX64() + os.isLinux -> linuxX64() + os.isMacOsX -> macosX64() + else -> throw GradleException("Unknown operating system $os") + } sourceSets { all {