diff --git a/desktop/build.gradle.kts b/desktop/build.gradle.kts index dae21a01f..30f82abb4 100644 --- a/desktop/build.gradle.kts +++ b/desktop/build.gradle.kts @@ -44,6 +44,9 @@ compose.desktop { mainClass = "org.meshtastic.desktop.MainKt" buildTypes.release.proguard { + // Note: Enabling ProGuard will reduce final distribution size significantly, + // but will require thorough testing of serialization, reflection (Koin), and JNI (SQLite). + // Recommend enabling when ready: isEnabled.set(true) isEnabled.set(false) configurationFiles.from(project.file("proguard-rules.pro")) } @@ -58,17 +61,48 @@ compose.desktop { ) packageName = "Meshtastic" - modules("java.net.http") + // Ensure critical JVM modules are included in the custom JRE bundled with the app. + // jdeps might miss some of these if they are loaded via reflection or JNI. + modules( + "java.net.http", // Ktor Java client + "jdk.crypto.ec", // Required for SSL/TLS HTTPS requests + "jdk.unsupported", // sun.misc.Unsafe used by Coroutines & Okio + "java.sql", // Sometimes required by SQLite JNI + "java.naming" // Required by Ktor for DNS resolution + ) + + // Default JVM arguments for the packaged application + // Increase max heap size to prevent OOM issues on complex maps/data + jvmArgs("-Xmx2G") - // App Icon - macOS { iconFile.set(project.file("src/main/resources/icon.png")) } - windows { iconFile.set(project.file("src/main/resources/icon.png")) } - linux { iconFile.set(project.file("src/main/resources/icon.png")) } + // App Icon & OS Specific Configurations + macOS { + iconFile.set(project.file("src/main/resources/icon.icns")) + // TODO: To prepare for real distribution on macOS, you'll need to sign and notarize. + // You can inject these from CI environment variables. + // bundleID = "org.meshtastic.desktop" + // sign = true + // notarize = true + // appleID = System.getenv("APPLE_ID") + // appStorePassword = System.getenv("APPLE_APP_SPECIFIC_PASSWORD") + } + windows { + iconFile.set(project.file("src/main/resources/icon.ico")) + menuGroup = "Meshtastic" + // TODO: Must generate and set a consistent UUID for Windows upgrades. + // upgradeUuid = "YOUR-UPGRADE-UUID-HERE" + } + linux { + iconFile.set(project.file("src/main/resources/icon.png")) + menuGroup = "Network" + } - // Read version from project properties (passed by CI) or default to 0.1.0 + // Read version from project properties (passed by CI) or default to 1.0.0 // Native installers require strict numeric semantic versions (X.Y.Z) without suffixes - val rawVersion = project.findProperty("appVersionName")?.toString() ?: "0.1.0" - val sanitizedVersion = Regex("^\\d+\\.\\d+\\.\\d+").find(rawVersion)?.value ?: "0.1.0" + val rawVersion = project.findProperty("android.injected.version.name")?.toString() + ?: System.getenv("VERSION_NAME") + ?: "1.0.0" + val sanitizedVersion = Regex("^\\d+\\.\\d+\\.\\d+").find(rawVersion)?.value ?: "1.0.0" packageVersion = sanitizedVersion description = "Meshtastic Desktop Application" @@ -173,4 +207,4 @@ aboutLibraries { duplicationMode = DuplicateMode.MERGE duplicationRule = DuplicateRule.SIMPLE } -} +} \ No newline at end of file diff --git a/desktop/src/main/resources/icon.icns b/desktop/src/main/resources/icon.icns new file mode 100644 index 000000000..ca858909d Binary files /dev/null and b/desktop/src/main/resources/icon.icns differ diff --git a/desktop/src/main/resources/icon.ico b/desktop/src/main/resources/icon.ico new file mode 100644 index 000000000..e47432eaa Binary files /dev/null and b/desktop/src/main/resources/icon.ico differ diff --git a/desktop/src/main/resources/icon.png b/desktop/src/main/resources/icon.png index e3e10fb55..11c5db18c 100644 Binary files a/desktop/src/main/resources/icon.png and b/desktop/src/main/resources/icon.png differ