Skip to content

Commit b23f849

Browse files
committed
add architecture-agnostic dmg
this dmg does not include JRE but rather uses the JRE that is available on the machine. to achieve this, we added gradle-macappbundle back with the changes in: crotwell/gradle-macappbundle#76
1 parent 54a8222 commit b23f849

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

.github/workflows/nightly.yml

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
os: macos-14
2828
- arch: x86_64
2929
os: macos-12
30+
- arch: noarch
31+
os: macos-14
3032
runs-on: ${{ matrix.os }}
3133
needs: get-version
3234
steps:
@@ -64,6 +66,11 @@ jobs:
6466

6567
- name: Build dmg
6668
run: ./gradlew dmg -Parch=${{ matrix.arch }} -Pidentity="${{ secrets.MACOS_IDENTITY }}"
69+
if: ${{ matrix.arch }} != 'noarch'
70+
71+
- name: Build dmg
72+
run: ./gradlew createDmg -Pidentity="${{ secrets.MACOS_IDENTITY }}"
73+
if: ${{ matrix.arch }} == 'noarch'
6774

6875
- name: Sign dmg
6976
run: /usr/bin/codesign --entitlements package/osx/mucommander-entitlements --timestamp --options runtime --deep --force -s "${{ secrets.MACOS_IDENTITY }}" "./build/distributions/mucommander-${{ needs.get-version.outputs.full_version }}-${{ matrix.arch }}.dmg" -v

build.gradle

+103
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ buildscript {
44
}
55
dependencies {
66
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0'
7+
classpath files('libs/mucommander-gradle-macappbundle.jar')
78
}
89
}
910

@@ -14,6 +15,10 @@ plugins {
1415
id 'edu.sc.seis.launch4j' version '2.5.4'
1516
}
1617

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+
1722
allprojects {
1823
tasks.withType(JavaCompile).configureEach {
1924
options.fork = true
@@ -645,3 +650,101 @@ task msi(dependsOn: 'winAppImage', type: Exec) {
645650
'--vendor', 'Arik Hadas'
646651
}
647652

653+
configurations.default.canBeResolved=true
654+
655+
macAppBundle {
656+
appName = "muCommander"
657+
dmgName = 'mucommander-'+project.version+'-'+project.ext.release+'-noarch'
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+
if (!project.hasProperty('skipDmgSign') && project.ext.identity?.trim()) {
698+
certIdentity = project.ext.identity
699+
}
700+
javaProperties.put("com.apple.smallTabs", "true")
701+
javaProperties.put("com.apple.hwaccel", "true")
702+
javaProperties.put("apple.laf.useScreenMenuBar", "true")
703+
javaProperties.put("file.encoding", "UTF-8")
704+
javaExtrasList.add("--add-exports")
705+
javaExtrasList.add("java.desktop/com.apple.eawt=ALL-UNNAMED")
706+
javaExtrasList.add("--add-exports")
707+
javaExtrasList.add("java.desktop/com.apple.laf=ALL-UNNAMED")
708+
javaExtrasList.add("--add-exports")
709+
javaExtrasList.add("java.desktop/com.apple.laf=ALL-UNNAMED")
710+
javaExtrasList.add("--add-exports")
711+
javaExtrasList.add("java.desktop/com.apple.eio=ALL-UNNAMED")
712+
javaExtrasList.add("--add-exports")
713+
javaExtrasList.add("java.desktop/com.apple.eawt=ALL-UNNAMED")
714+
javaExtrasList.add("--add-exports")
715+
javaExtrasList.add("java.desktop/javax.swing.plaf.basic=ALL-UNNAMED")
716+
javaExtrasList.add("--add-exports")
717+
javaExtrasList.add("java.base/java.io=ALL-UNNAMED")
718+
javaExtrasList.add("--add-exports")
719+
javaExtrasList.add("java.base/java.net=ALL-UNNAMED")
720+
javaExtrasList.add("--add-exports")
721+
javaExtrasList.add("java.transaction.xa/javax.transaction.xa=ALL-UNNAMED")
722+
javaExtrasList.add("--add-exports")
723+
javaExtrasList.add("java.management/javax.management=ALL-UNNAMED")
724+
javaExtrasList.add("--add-exports")
725+
javaExtrasList.add("java.rmi/java.rmi=ALL-UNNAMED")
726+
javaExtrasList.add("--add-exports")
727+
javaExtrasList.add("java.security.jgss/org.ietf.jgss=ALL-UNNAMED")
728+
javaExtrasList.add("--add-exports")
729+
javaExtrasList.add("java.sql/java.sql=ALL-UNNAMED")
730+
javaExtrasList.add("--add-exports")
731+
javaExtrasList.add("java.base/sun.net.www.protocol.http=ALL-UNNAMED")
732+
javaExtrasList.add("--add-exports")
733+
javaExtrasList.add("java.base/sun.net.www.protocol.https=ALL-UNNAMED")
734+
}
735+
736+
copyToResourcesJava.dependsOn createBundlesDir
737+
copyToResourcesJava.doLast {
738+
copy {
739+
from "build/osgi"
740+
include 'app/**'
741+
include 'bundle/**'
742+
include 'conf/**'
743+
exclude 'bundle/osgiaas*'
744+
exclude 'bundle/jline*'
745+
exclude 'bundle/mucommander-os-linux*'
746+
exclude 'bundle/mucommander-os-openvms*'
747+
exclude 'bundle/mucommander-os-win*'
748+
into project.file("${->project.buildDir}/${->project.macAppBundle.appOutputDir}/${->project.macAppBundle.appName}.app/Contents/${->project.macAppBundle.jarSubdir}")
749+
}
750+
}
339 KB
Binary file not shown.

0 commit comments

Comments
 (0)