Skip to content

Commit f2d04f0

Browse files
committed
fix: only require the parameter when building a package
1 parent 49b7242 commit f2d04f0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030

3131
- name: Gradle build
3232
working-directory: ./pretixscan
33-
run: ./gradlew :composeApp:build -PappPackageName="pretixSCAN"
33+
run: ./gradlew :composeApp:build

pretixscan/composeApp/build.gradle.kts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,10 @@ compose.desktop {
155155
nativeDistributions {
156156
// On Windows, we need the packageName to be set as 'pretixSCAN Desktop' in order to avoid a conflict with v1
157157

158-
val requiredPackageName = findProperty("appPackageName")?.toString()
159-
?: throw GradleException("Package name must be provided via -PappPackageName=<name>")
158+
val packageNameValue = findProperty("appPackageName")?.toString() ?: "pretixSCAN-default"
160159

161160
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
162-
packageName = requiredPackageName
161+
packageName = packageNameValue
163162
packageVersion = version
164163
vendor = "pretix GmbH"
165164
copyright = "pretix.eu, Raphael Michel"
@@ -193,4 +192,13 @@ compose.desktop {
193192
}
194193
}
195194
}
195+
}
196+
197+
// Validate packageName is provided for packaging tasks
198+
tasks.matching { it.name.contains("package", ignoreCase = true) }.configureEach {
199+
doFirst {
200+
if (findProperty("appPackageName") == null) {
201+
throw GradleException("Package name must be provided via -PappPackageName=<name> for packaging tasks")
202+
}
203+
}
196204
}

0 commit comments

Comments
 (0)