@@ -321,7 +321,7 @@ task releaseWinSetups(group: 'build') {
321
321
322
322
def macBundleTarget = new File (buildDir, ' jpackage-mac' )
323
323
324
- task jpackageMac (type : Exec , group : ' build' ) {
324
+ task jpackageMacArm (type : Exec , group : ' build' ) {
325
325
dependsOn shadowJar
326
326
327
327
def macVersion = ' 1.0.7' // default
@@ -346,29 +346,77 @@ task jpackageMac(type: Exec, group: 'build') {
346
346
347
347
def command = [jpackageExec,
348
348
' --type' , ' app-image' ,
349
- ' --name' , ' Chatty' ,
349
+ ' --name' , ' Chatty-arm64 ' ,
350
350
' --input' , new File (macBundleTarget, ' input' ),
351
351
' --main-jar' , ' Chatty.jar' ,
352
352
' --main-class' , ' chatty.Chatty' ,
353
353
' --dest' , macBundleTarget,
354
- ' --description' , ' Chatty - Twitch Chat Client' ,
354
+ ' --description' , ' Chatty - Twitch Chat Client (ARM64) ' ,
355
355
' --java-options' , ' -Xmx600M' ,
356
356
' --icon' , ' assets-bundle/Chatty.icns' ,
357
357
' --app-version' , macVersion,
358
- ' --vendor' , ' Chatty' ]
358
+ ' --vendor' , ' Chatty' ,
359
+ ' --mac-package-identifier' , ' chatty.client.arm64' ]
359
360
360
361
commandLine command
361
362
}
362
363
363
- task packageApp (type : Zip ) {
364
- dependsOn jpackageMac
365
- from(" ${ macBundleTarget} /Chatty.app" )
366
- archiveFileName = " Chatty_${ version} _mac.app.zip"
364
+ task jpackageMacIntel (type : Exec , group : ' build' ) {
365
+ dependsOn shadowJar
366
+
367
+ def macVersion = ' 1.0.7' // default
368
+
369
+ doFirst {
370
+ delete macBundleTarget
371
+ copy {
372
+ from tasks. shadowJar. archivePath
373
+ into new File (macBundleTarget, ' input' )
374
+ }
375
+
376
+ def versionParts = project. version. replaceAll(/ [^0-9.]/ , ' ' ). split(/ \. / )
377
+ macVersion = (versionParts. size() >= 3 ) ?
378
+ " ${ versionParts[0]} .${ versionParts[1]} .${ versionParts[2]} " :
379
+ (versionParts. size() == 2 ) ? " ${ versionParts[0]} .${ versionParts[1]} .0" :
380
+ " ${ versionParts[0]} .0.0"
381
+
382
+ if (macVersion == ' ..0' ) macVersion = ' 1.0.7'
383
+ }
384
+
385
+ def jpackageExec = project. hasProperty(' jpackagePath' ) ? jpackagePath : ' jpackage'
386
+
387
+ def command = [jpackageExec,
388
+ ' --type' , ' app-image' ,
389
+ ' --name' , ' Chatty-x64' ,
390
+ ' --input' , new File (macBundleTarget, ' input' ),
391
+ ' --main-jar' , ' Chatty.jar' ,
392
+ ' --main-class' , ' chatty.Chatty' ,
393
+ ' --dest' , macBundleTarget,
394
+ ' --description' , ' Chatty - Twitch Chat Client (Intel)' ,
395
+ ' --java-options' , ' -Xmx600M' ,
396
+ ' --icon' , ' assets-bundle/Chatty.icns' ,
397
+ ' --app-version' , macVersion,
398
+ ' --vendor' , ' Chatty' ,
399
+ ' --mac-package-identifier' , ' chatty.client.x64' ]
400
+
401
+ commandLine command
402
+ }
403
+
404
+ task packageAppArm (type : Zip ) {
405
+ dependsOn jpackageMacArm
406
+ from(" ${ macBundleTarget} /Chatty-arm64.app" )
407
+ archiveFileName = " Chatty_${ version} _mac_arm64.app.zip"
408
+ destinationDirectory = releasesDir
409
+ }
410
+
411
+ task packageAppIntel (type : Zip ) {
412
+ dependsOn jpackageMacIntel
413
+ from(" ${ macBundleTarget} /Chatty-x64.app" )
414
+ archiveFileName = " Chatty_${ version} _mac_x64.app.zip"
367
415
destinationDirectory = releasesDir
368
416
}
369
417
370
418
task releaseMacSetups (group : ' build' ) {
371
- dependsOn packageApp
419
+ dependsOn packageAppArm, packageAppIntel
372
420
}
373
421
374
422
// ---------
0 commit comments