Skip to content

Commit f42306a

Browse files
committed
build(desktop): Generate native packages only for the current OS
This commit updates the desktop packaging configuration to build native distribution formats specific to the host operating system. Instead of building all formats (DMG, PKG, Exe, Msi, Deb, Rpm, AppImage) on every machine, the build script now detects the current OS and generates only the relevant packages: - **Windows**: Exe, Msi - **macOS**: Dmg, Pkg - **Linux**: Deb, Rpm, AppImage This change optimizes the build process by avoiding the creation of unnecessary and incompatible package types.
1 parent c2f416a commit f42306a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

composeApp/build.gradle.kts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ compose.desktop {
102102
packageVersion = libs.versions.projectVersionName.get().toString()
103103
vendor = "rainxchzed"
104104
includeAllModules = true
105+
106+
val currentOs = org.gradle.internal.os.OperatingSystem.current()
105107
targetFormats(
106-
TargetFormat.Dmg,
107-
TargetFormat.Pkg,
108-
TargetFormat.Exe,
109-
TargetFormat.Msi,
110-
TargetFormat.Deb,
111-
TargetFormat.Rpm,
112-
TargetFormat.AppImage,
108+
*when {
109+
currentOs.isWindows -> arrayOf(TargetFormat.Exe, TargetFormat.Msi)
110+
currentOs.isMacOsX -> arrayOf(TargetFormat.Dmg, TargetFormat.Pkg)
111+
currentOs.isLinux -> arrayOf(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
112+
else -> emptyArray()
113+
}
113114
)
114115
windows {
115116
iconFile.set(project.file("logo/app_icon.ico"))

0 commit comments

Comments
 (0)