@@ -4,6 +4,7 @@ buildscript {
4
4
}
5
5
dependencies {
6
6
classpath ' biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0'
7
+ classpath files(' libs/mucommander-gradle-macappbundle.jar' )
7
8
}
8
9
}
9
10
@@ -14,6 +15,10 @@ plugins {
14
15
id ' edu.sc.seis.launch4j' version ' 2.5.4'
15
16
}
16
17
18
+ // This is the only syntax that appears to work for a local plugin
19
+ // TODO: replace this with an official release of gradle-macappbundle
20
+ apply plugin : ' edu.sc.seis.macAppBundle'
21
+
17
22
allprojects {
18
23
tasks. withType(JavaCompile ). configureEach {
19
24
options. fork = true
@@ -645,3 +650,98 @@ task msi(dependsOn: 'winAppImage', type: Exec) {
645
650
' --vendor' , ' Arik Hadas'
646
651
}
647
652
653
+ configurations. default. canBeResolved= true
654
+
655
+ macAppBundle {
656
+ appName = " muCommander"
657
+ dmgName = ' mucommander-' + project. version+ ' -' + project. ext. release
658
+ mainClassName = " com.mucommander.main.muCommander"
659
+ appStyle = " universalJavaApplicationStub"
660
+ bundleJRE = false
661
+ bundleIdentifier = " com.mucommander.muCommander"
662
+ jvmVersion = " 1.6+"
663
+ icon = " package/osx/icon.icns"
664
+ bundleAllowMixedLocalizations = " true"
665
+ bundleExtras. put(" NSHighResolutionCapable" , " true" )
666
+ bundleExtras. put(" NSSupportsAutomaticGraphicsSwitching" , " true" )
667
+ backgroundImage = " package/osx/bg.gif"
668
+ backgroundImageWidth = 450
669
+ backgroundImageHeight = 475
670
+ appIconX = 225
671
+ appIconY = 75
672
+ appFolderX = 225
673
+ appFolderY = 350
674
+ backgroundScript = """
675
+ tell application "Finder"
676
+ tell disk "\$ {VOL_NAME}"
677
+ open
678
+ set current view of container window to icon view
679
+ set toolbar visible of container window to false
680
+ set statusbar visible of container window to false
681
+ set the bounds of container window to { 0, 0, \$ {IMAGE_WIDTH}, \$ {IMAGE_HEIGHT} }
682
+ set the position of the container window to {400, 100}
683
+ set viewOptions to the icon view options of container window
684
+ set arrangement of viewOptions to not arranged
685
+ set icon size of viewOptions to 72
686
+ set background picture of viewOptions to file ".background:\$ {DMG_BACKGROUND_IMG}"
687
+ set position of item "\$ {APP_NAME}.app" of container window to { \$ {APPICONX}, \$ {APPICONY} }
688
+ set position of item "Applications" of container window to { \$ {APPFOLDERX}, \$ {APPFOLDERY} }
689
+ close
690
+ open
691
+ update without registering applications
692
+ delay 2
693
+ end tell
694
+ end tell
695
+ """
696
+
697
+ javaProperties. put(" com.apple.smallTabs" , " true" )
698
+ javaProperties. put(" com.apple.hwaccel" , " true" )
699
+ javaProperties. put(" apple.laf.useScreenMenuBar" , " true" )
700
+ javaProperties. put(" file.encoding" , " UTF-8" )
701
+ javaExtrasList. add(" --add-exports" )
702
+ javaExtrasList. add(" java.desktop/com.apple.eawt=ALL-UNNAMED" )
703
+ javaExtrasList. add(" --add-exports" )
704
+ javaExtrasList. add(" java.desktop/com.apple.laf=ALL-UNNAMED" )
705
+ javaExtrasList. add(" --add-exports" )
706
+ javaExtrasList. add(" java.desktop/com.apple.laf=ALL-UNNAMED" )
707
+ javaExtrasList. add(" --add-exports" )
708
+ javaExtrasList. add(" java.desktop/com.apple.eio=ALL-UNNAMED" )
709
+ javaExtrasList. add(" --add-exports" )
710
+ javaExtrasList. add(" java.desktop/com.apple.eawt=ALL-UNNAMED" )
711
+ javaExtrasList. add(" --add-exports" )
712
+ javaExtrasList. add(" java.desktop/javax.swing.plaf.basic=ALL-UNNAMED" )
713
+ javaExtrasList. add(" --add-exports" )
714
+ javaExtrasList. add(" java.base/java.io=ALL-UNNAMED" )
715
+ javaExtrasList. add(" --add-exports" )
716
+ javaExtrasList. add(" java.base/java.net=ALL-UNNAMED" )
717
+ javaExtrasList. add(" --add-exports" )
718
+ javaExtrasList. add(" java.transaction.xa/javax.transaction.xa=ALL-UNNAMED" )
719
+ javaExtrasList. add(" --add-exports" )
720
+ javaExtrasList. add(" java.management/javax.management=ALL-UNNAMED" )
721
+ javaExtrasList. add(" --add-exports" )
722
+ javaExtrasList. add(" java.rmi/java.rmi=ALL-UNNAMED" )
723
+ javaExtrasList. add(" --add-exports" )
724
+ javaExtrasList. add(" java.security.jgss/org.ietf.jgss=ALL-UNNAMED" )
725
+ javaExtrasList. add(" --add-exports" )
726
+ javaExtrasList. add(" java.sql/java.sql=ALL-UNNAMED" )
727
+ javaExtrasList. add(" --add-exports" )
728
+ javaExtrasList. add(" java.base/sun.net.www.protocol.http=ALL-UNNAMED" )
729
+ javaExtrasList. add(" --add-exports" )
730
+ javaExtrasList. add(" java.base/sun.net.www.protocol.https=ALL-UNNAMED" )
731
+ }
732
+
733
+ copyToResourcesJava. dependsOn createBundlesDir
734
+ copyToResourcesJava. doLast {
735
+ copy {
736
+ from " build/osgi"
737
+ include ' app/**'
738
+ include ' bundle/**'
739
+ include ' conf/**'
740
+ exclude ' bundle/osgiaas*'
741
+ exclude ' bundle/jline*'
742
+ exclude ' bundle/mucommander-os-linux*'
743
+ exclude ' bundle/mucommander-os-openvms*'
744
+ exclude ' bundle/mucommander-os-win*'
745
+ into project. file(" ${ ->project.buildDir} /${ ->project.macAppBundle.appOutputDir} /${ ->project.macAppBundle.appName} .app/Contents/${ ->project.macAppBundle.jarSubdir} " )
746
+ }
747
+ }
0 commit comments