@@ -50,7 +50,7 @@ compose.desktop {
50
50
51
51
nativeDistributions{
52
52
modules(" jdk.jdi" , " java.compiler" , " jdk.accessibility" )
53
- targetFormats(TargetFormat .Dmg , TargetFormat .Msi , TargetFormat .Deb , TargetFormat . Pkg )
53
+ targetFormats(TargetFormat .Dmg , TargetFormat .Msi , TargetFormat .Deb )
54
54
packageName = " Processing"
55
55
56
56
macOS{
@@ -162,6 +162,23 @@ tasks.register<Exec>("packageCustomDmg"){
162
162
app
163
163
)
164
164
}
165
+ tasks.register<Exec >(" packagePkg" ){
166
+ onlyIf { org.gradle.internal.os.OperatingSystem .current().isMacOsX }
167
+ dependsOn(" createDistributable" )
168
+ group = " compose desktop"
169
+ val distributable = tasks.named<AbstractJPackageTask >(" createDistributable" ).get()
170
+ val app = distributable.destinationDir.get().file(" ${distributable.packageName.get()} .app" ).asFile
171
+ val target = app.parentFile.parentFile.resolve(" pkg/${distributable.packageName.get()} -$version .pkg" )
172
+ target.parentFile.mkdirs()
173
+
174
+ commandLine(" pkgbuild" ,
175
+ " --install-location" , " /Applications" ,
176
+ " --identifier" , " ${rootProject.group} .app" ,
177
+ " --version" , version,
178
+ " --component" , app,
179
+ target
180
+ )
181
+ }
165
182
166
183
tasks.register<Exec >(" packageCustomMsi" ){
167
184
onlyIf { org.gradle.internal.os.OperatingSystem .current().isWindows }
@@ -205,6 +222,8 @@ tasks.register("generateSnapConfiguration"){
205
222
processing:
206
223
command: opt/processing/bin/Processing
207
224
desktop: opt/processing/lib/processing-Processing.desktop
225
+ environment:
226
+ LD_LIBRARY_PATH: ${' $' } SNAP/lib:${' $' } LD_LIBRARY_PATH
208
227
plugs:
209
228
- desktop
210
229
- desktop-legacy
@@ -216,12 +235,9 @@ tasks.register("generateSnapConfiguration"){
216
235
plugin: dump
217
236
source: deb/processing_$version -1_$snaparch .deb
218
237
source-type: deb
219
- stage-packages:
220
- - openjdk-17-jdk
221
238
override-prime: |
222
239
snapcraftctl prime
223
240
chmod -R +x opt/processing/lib/app/resources/jdk-*
224
- rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts
225
241
""" .trimIndent()
226
242
dir.file(" ../snapcraft.yaml" ).asFile.writeText(content)
227
243
}
@@ -249,14 +265,12 @@ tasks.register<Zip>("zipDistributable"){
249
265
}
250
266
251
267
afterEvaluate{
252
- tasks.named(" createDistributable" ).configure{
253
- finalizedBy(" zipDistributable" )
254
- }
255
268
tasks.named(" packageDmg" ).configure{
256
269
dependsOn(" packageCustomDmg" )
257
270
group = " compose desktop"
258
271
actions = emptyList()
259
272
}
273
+
260
274
tasks.named(" packageMsi" ).configure{
261
275
dependsOn(" packageCustomMsi" )
262
276
group = " compose desktop"
@@ -268,7 +282,7 @@ afterEvaluate{
268
282
){
269
283
dependsOn(" notarizeDmg" )
270
284
}
271
- dependsOn(" packageSnap" )
285
+ dependsOn(" packageSnap" , " zipDistributable " , " packagePkg " )
272
286
}
273
287
}
274
288
0 commit comments