Skip to content

Commit 20aa3d3

Browse files
author
OnionTiger
committed
chore: CI
1 parent 0400915 commit 20aa3d3

File tree

7 files changed

+120
-6
lines changed

7 files changed

+120
-6
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ jobs:
9393
fail-fast: false
9494
matrix:
9595
include:
96-
- name: ios
97-
task: ./gradlew buildReleaseIpa
98-
path: composeApp/build/archives/release/*.ipa
96+
# - name: ios
97+
# task: ./gradlew buildReleaseIpa
98+
# path: composeApp/build/archives/release/*.ipa
9999
- name: android
100100
task: ./gradlew assembleRelease
101101
path: composeApp/build/outputs/apk/release/*.apk
@@ -372,8 +372,8 @@ jobs:
372372
EOF
373373
374374
# Copy icon if exists
375-
if [ -f "composeApp/desktopAppIcons/LinuxIcon.png" ]; then
376-
cp composeApp/desktopAppIcons/LinuxIcon.png AppDir/KMP-MineStableDiffusion.png
375+
if [ -f "docs/AppIcon.png" ]; then
376+
cp docs/AppIcon.png AppDir/KMP-MineStableDiffusion.png
377377
fi
378378
379379
# Fix permissions

composeApp/build.gradle.kts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ kotlin {
1818
androidTarget {
1919
@OptIn(ExperimentalKotlinGradlePluginApi::class)
2020
compilerOptions {
21-
jvmTarget.set(JvmTarget.JVM_11)
21+
jvmTarget.set(JvmTarget.JVM_21)
2222
}
2323
}
2424

@@ -158,6 +158,55 @@ compose.desktop {
158158
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
159159
packageName = "org.onion.diffusion"
160160
packageVersion = "1.0.0"
161+
162+
targetFormats(
163+
TargetFormat.Dmg,
164+
TargetFormat.Msi,
165+
TargetFormat.Exe,
166+
TargetFormat.Deb,
167+
TargetFormat.Rpm
168+
)
169+
170+
packageName = "MineStableDiffusion"
171+
packageVersion = libs.versions.app.version.get()
172+
vendor = "Onion"
173+
licenseFile.set(rootProject.rootDir.resolve("LICENSE"))
174+
modules(
175+
"jdk.unsupported",
176+
"java.instrument"
177+
)
178+
179+
linux {
180+
iconFile.set(rootProject.file("docs/AppIcon.png"))
181+
}
182+
windows {
183+
iconFile.set(rootProject.file("docs/AppIcon.ico"))
184+
dirChooser = true
185+
perUserInstall = true
186+
}
187+
macOS {
188+
iconFile.set(rootProject.file("docs/AppIcon.icns"))
189+
bundleID = "org.onion.diffusion"
190+
appCategory = "public.app-category.productivity"
191+
jvmArgs += listOf(
192+
"-Dapple.awt.application.name=MineStableDiffusion",
193+
"-Dsun.java2d.metal=true",
194+
"--add-opens=java.desktop/sun.lwawt=ALL-UNNAMED",
195+
"--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED",
196+
)
197+
}
198+
}
199+
200+
jvmArgs += listOf(
201+
"-XX:+UseZGC",
202+
"-XX:SoftMaxHeapSize=4096m",
203+
"--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED",
204+
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED"
205+
)
206+
207+
buildTypes.release.proguard {
208+
version.set("7.7.0")
209+
configurationFiles.from("proguard-rules.pro")
161210
}
162211
}
163212
}

composeApp/proguard-rules.pro

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# ================= Aggressive Optimizations =================
2+
-mergeinterfacesaggressively
3+
-overloadaggressively
4+
-repackageclasses
5+
6+
7+
# ================= Keep Rules for Dependencies =================
8+
9+
# --- OkHttp & Okio ---
10+
# Ignore warnings for optional platform-specific classes that OkHttp probes for at runtime. [11]
11+
-dontwarn okhttp3.internal.platform.**
12+
-dontwarn org.conscrypt.**
13+
-dontwarn org.bouncycastle.**
14+
-dontwarn org.openjsse.**
15+
16+
# Keep all essential classes for OkHttp and its dependency Okio. [3, 4]
17+
-keep class okhttp3.** { *; }
18+
-keep interface okhttp3.** { *; }
19+
-keep class okio.** { *; }
20+
-keep interface okio.** { *; }
21+
22+
# --- Other libraries from your original file ---
23+
-keep class com.sun.jna.** { *; }
24+
-keep class org.freedesktop.dbus.** { *; }
25+
-keep class io.github.alexzhirkevich.** { *; }
26+
27+
28+
# ================= Kotlin & Serialization Rules =================
29+
30+
# Keep annotations, which are critical for many libraries including serialization. [5]
31+
-keepattributes Signature, *Annotation*
32+
33+
# Keep classes and their serializers for kotlinx.serialization.
34+
# This fixes the "but not the descriptor class" notes.
35+
-keepclassmembers class ** {
36+
@kotlinx.serialization.Serializable <methods>;
37+
}
38+
-keep class *$$serializer { *; }
39+
40+
# Keep kotlinx-datetime, as it's referenced by other kept libraries (like okio.fakefilesystem).
41+
-keep class kotlinx.datetime.** { *; }
42+
43+
44+
# ================= Suppress other specific warnings if they persist =================
45+
46+
# Ktor might use SLF4J for logging.
47+
-dontwarn org.slf4j.impl.StaticLoggerBinder
48+
49+
# Your log shows warnings for android.* classes. This happens because you are building
50+
# a multiplatform module, but ProGuard runs in a context where Android SDK classes may not be available.
51+
# These are safe to ignore as they will be present on the actual Android device.
52+
-dontwarn android.security.**
53+
-dontwarn android.util.**
54+
-dontwarn android.os.**
55+
-dontwarn android.net.**
56+
57+
58+
59+
-keep class com.sun.jna.** { *; }
60+
-keep class org.freedesktop.dbus.** { *; }
61+
-keep class io.github.alexzhirkevich.** { *; }
62+
-keep class okio.fakefilesystem.** { *; }
63+
-keep class okio.** { *; }
64+
-keep class okhttp3.** { *; }

docs/AppIcon.icns

60.9 KB
Binary file not shown.

docs/AppIcon.ico

181 KB
Binary file not shown.

docs/AppIcon.png

87.7 KB
Loading

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[versions]
22
agp = "8.7.3"
3+
app-version="1.0.0"
34
android-compileSdk = "35"
45
android-minSdk = "29"
56
android-targetSdk = "35"

0 commit comments

Comments
 (0)