From 5f7bf1dfa4196acb28dc9e5f5b4e36df1c68d64b Mon Sep 17 00:00:00 2001 From: Alexander Ioffe Date: Sat, 3 Feb 2024 23:53:13 -0500 Subject: [PATCH] Minimal set of targets on standard build, full in ci --- build.gradle.kts | 7 ++++++- pprint-kotlin-core/build.gradle.kts | 24 +++++++++++++++++++----- pprint-kotlin-kmp/build.gradle.kts | 24 +++++++++++++++++++----- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 90b0e97..2e8e275 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -90,9 +90,14 @@ subprojects { } } + val isCI = project.hasProperty("isCI") + val isLocal = !isCI + val noSign = project.hasProperty("nosign") + val doNotSign = isLocal || noSign + signing { // Sign if we're not doing a local build and we haven't specifically disabled it - if (!project.hasProperty("local") && !project.hasProperty("nosign")) { + if (!doNotSign) { val signingKeyRaw = System.getenv("NEW_SIGNING_KEY_ID_BASE64") if (signingKeyRaw == null) error("ERROR: No Signing Key Found") // Seems like the right way was to have newlines after all the exported (ascii armored) lines diff --git a/pprint-kotlin-core/build.gradle.kts b/pprint-kotlin-core/build.gradle.kts index 2bf382c..33e2bb4 100644 --- a/pprint-kotlin-core/build.gradle.kts +++ b/pprint-kotlin-core/build.gradle.kts @@ -21,7 +21,23 @@ kotlin { val isMac = platform == "mac" val isWindows = platform == "windows" - if (isLinux || !isCI) { + // If we're not the CI build a limited set of standard targets + if(!isCI) { + jvm { + jvmToolchain(11) + } + js { + browser() + nodejs() + } + + linuxX64() + macosX64() + mingwX64() + } + + // If we are a CI, build all the targets for the specified platform + if (isLinux && isCI) { jvm { jvmToolchain(11) } @@ -43,8 +59,7 @@ kotlin { androidNativeArm32() androidNativeArm64() } - - if (isMac || !isCI) { + if (isMac && isCI) { macosX64() macosArm64() iosX64() @@ -56,8 +71,7 @@ kotlin { watchosArm32() watchosArm64() } - - if (isWindows || !isCI) { + if (isWindows && isCI) { mingwX64() } diff --git a/pprint-kotlin-kmp/build.gradle.kts b/pprint-kotlin-kmp/build.gradle.kts index 842e910..8f8a189 100644 --- a/pprint-kotlin-kmp/build.gradle.kts +++ b/pprint-kotlin-kmp/build.gradle.kts @@ -22,7 +22,23 @@ kotlin { val isMac = platform == "mac" val isWindows = platform == "windows" - if (isLinux || !isCI) { + // If we're not the CI build a limited set of standard targets + if(!isCI) { + jvm { + jvmToolchain(11) + } + js { + browser() + nodejs() + } + + linuxX64() + macosX64() + mingwX64() + } + + // If we are a CI, build all the targets for the specified platform + if (isLinux && isCI) { jvm { jvmToolchain(11) } @@ -44,8 +60,7 @@ kotlin { androidNativeArm32() androidNativeArm64() } - - if (isMac || !isCI) { + if (isMac && isCI) { macosX64() macosArm64() iosX64() @@ -57,8 +72,7 @@ kotlin { watchosArm32() watchosArm64() } - - if (isWindows || !isCI) { + if (isWindows && isCI) { mingwX64() }