From 8a520656ccb2a2e411173408717d00ca20d3eab6 Mon Sep 17 00:00:00 2001 From: Artem Chepurnyi Date: Tue, 23 Apr 2024 20:39:53 +0300 Subject: [PATCH] chore: Automatically detect macOS and disable AppImage target format --- .github/workflows/new_tag_release.yaml | 2 +- desktopApp/build.gradle.kts | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/new_tag_release.yaml b/.github/workflows/new_tag_release.yaml index f1f408b..bc5cef7 100644 --- a/.github/workflows/new_tag_release.yaml +++ b/.github/workflows/new_tag_release.yaml @@ -55,7 +55,7 @@ jobs: env: JAVA_HOME: ${{ steps.setup-java.outputs.path }} with: - arguments: "-PexcludeAppImage=true :desktopApp:packageDmg :desktopApp:notarizeDmg" + arguments: ":desktopApp:packageDmg :desktopApp:notarizeDmg" - name: 'Upload logs' uses: actions/upload-artifact@v4 if: always() diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index eed5491..593285b 100644 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -1,3 +1,4 @@ +import org.apache.tools.ant.taskdefs.condition.Os import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { @@ -24,15 +25,6 @@ kotlin { } } -// Because of this bug you can not build for macOS and -// have the app image distribution format enabled. -// See: -// https://github.com/JetBrains/compose-multiplatform/issues/3814 -val excludeAppImage = kotlin.run { - val excludeAppImage: String? by project - excludeAppImage == "true" -} - val appId = "com.artemchep.keyguard" val macExtraPlistKeys: String @@ -101,7 +93,11 @@ compose.desktop { TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb, - TargetFormat.AppImage.takeUnless { excludeAppImage }, + // Because of this bug you can not build for macOS and + // have the app image distribution format enabled. + // See: + // https://github.com/JetBrains/compose-multiplatform/issues/3814 + TargetFormat.AppImage.takeUnless { Os.isFamily(Os.FAMILY_MAC) }, ).toTypedArray() targetFormats(*formats)