chore: Automatically detect macOS and disable AppImage target format

This commit is contained in:
Artem Chepurnyi 2024-04-23 20:39:53 +03:00
parent 5f295900b4
commit 8a520656cc
2 changed files with 7 additions and 11 deletions

View File

@ -55,7 +55,7 @@ jobs:
env: env:
JAVA_HOME: ${{ steps.setup-java.outputs.path }} JAVA_HOME: ${{ steps.setup-java.outputs.path }}
with: with:
arguments: "-PexcludeAppImage=true :desktopApp:packageDmg :desktopApp:notarizeDmg" arguments: ":desktopApp:packageDmg :desktopApp:notarizeDmg"
- name: 'Upload logs' - name: 'Upload logs'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()

View File

@ -1,3 +1,4 @@
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { 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 appId = "com.artemchep.keyguard"
val macExtraPlistKeys: String val macExtraPlistKeys: String
@ -101,7 +93,11 @@ compose.desktop {
TargetFormat.Dmg, TargetFormat.Dmg,
TargetFormat.Msi, TargetFormat.Msi,
TargetFormat.Deb, 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() ).toTypedArray()
targetFormats(*formats) targetFormats(*formats)