Skip to content

Commit 995ddf9

Browse files
committed
feat: allow configuring the packageName at build time
1 parent a08b83a commit 995ddf9

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737

3838
- name: Package App
3939
working-directory: ./pretixscan
40-
run: ./gradlew packageDistributionForCurrentOS
40+
shell: bash
41+
run: ./gradlew packageDistributionForCurrentOS -PappPackageName="${{ runner.os == 'Windows' && 'pretixSCAN Desktop' || 'pretixSCAN' }}"
4142

4243
- name: Read version
4344
working-directory: ./pretixscan

pretixscan/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ KMP provides for various native distributions to be created, please refer to the
3535
For example, create a distribution package for the current OS:
3636

3737
```bash
38-
./gradlew packageDistributionForCurrentOS
38+
./gradlew packageDistributionForCurrentOS -PappPackageName="pretixSCAN"
3939
```
4040

4141
By default, packages are created under `pretixscan/composeApp/build/compose/binaries`.

pretixscan/composeApp/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,13 @@ compose.desktop {
153153
mainClass = "eu.pretix.desktop.MainKt"
154154

155155
nativeDistributions {
156+
// On Windows, we need the packageName to be set as 'pretixSCAN Desktop' in order to avoid a conflict with v1
157+
158+
val requiredPackageName = findProperty("appPackageName")?.toString()
159+
?: throw GradleException("Package name must be provided via -PappPackageName=<name>")
160+
156161
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
157-
packageName = "pretixSCAN"
162+
packageName = requiredPackageName
158163
packageVersion = version
159164
vendor = "pretix GmbH"
160165
copyright = "pretix.eu, Raphael Michel"
@@ -167,8 +172,8 @@ compose.desktop {
167172
macOS {
168173
iconFile.set(File("logo/pretix_app_icon.icns"))
169174
}
175+
170176
windows {
171-
packageName = "pretixSCAN Desktop"
172177
iconFile.set(File("logo/pretix_app_icon.ico"))
173178

174179
// MSI specific configuration
@@ -182,6 +187,7 @@ compose.desktop {
182187
upgradeUuid = "550e8400-e29b-41d4-a716-446655440000"
183188

184189
}
190+
185191
linux {
186192
iconFile.set(File("logo/pretix_app_icon.png"))
187193
}

0 commit comments

Comments
 (0)