Skip to content

Commit 9c66092

Browse files
committed
Fix for OSX 10.13 / APFS
When the filesystem is APFS we need to specify the output format for the intermediate DMG as HFS+
1 parent 0d41d59 commit 9c66092

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/com/inet/gradle/setup/dmg/DmgBuilder.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
/**
4747
* Build a DMG image for OSX.
48-
*
48+
*
4949
* @author Volker Berlin
5050
*/
5151
public class DmgBuilder extends AbstractBuilder<Dmg, SetupBuilder> {
@@ -56,7 +56,7 @@ public class DmgBuilder extends AbstractBuilder<Dmg, SetupBuilder> {
5656

5757
/**
5858
* Create a new instance
59-
*
59+
*
6060
* @param dmg the calling task
6161
* @param setup the shared settings
6262
* @param fileResolver the file Resolver
@@ -68,7 +68,7 @@ public DmgBuilder( Dmg dmg, SetupBuilder setup, FileResolver fileResolver ) {
6868

6969
/**
7070
* Build the dmg file.
71-
*
71+
*
7272
* @throws RuntimeException if any error occur
7373
*/
7474
public void build() throws RuntimeException {
@@ -78,7 +78,7 @@ public void build() throws RuntimeException {
7878
throw new IllegalArgumentException( "No Services or DesktopStarters have been defined. Will stop now." );
7979
}
8080

81-
// Build all services
81+
// Build all services
8282
for( Service service : setup.getServices() ) {
8383
new OSXApplicationBuilder( task, setup, fileResolver ).buildService( service );
8484
if ( firstExecutableName == null ) {
@@ -98,7 +98,7 @@ public void build() throws RuntimeException {
9898
applicationName = setup.getApplication();
9999
imageSourceRoot = buildDir.toString(); // + "/" + setup.getApplication() + ".app";
100100

101-
// Just in case. If it still has not been set, we do not know what the user itends.
101+
// Just in case. If it still has not been set, we do not know what the user itends.
102102
if ( firstExecutableName == null ) {
103103
firstExecutableName = applicationName;
104104
}
@@ -113,7 +113,7 @@ public void build() throws RuntimeException {
113113
* /
114114
*/
115115
createBinary();
116-
//*/
116+
//*/
117117
} catch( RuntimeException ex ) {
118118
ex.printStackTrace();
119119
throw ex;
@@ -126,7 +126,7 @@ public void build() throws RuntimeException {
126126

127127
/**
128128
* Create the binary with native tools.
129-
*
129+
*
130130
* @throws Throwable
131131
*/
132132
private void createBinary() throws Throwable {
@@ -145,7 +145,7 @@ private void createBinary() throws Throwable {
145145

146146
/**
147147
* Create the service files and the pre- and post installer scripts
148-
*
148+
*
149149
* @throws IOException in case of errors
150150
*/
151151
private void createServiceFiles() throws IOException {
@@ -217,7 +217,7 @@ private void createServiceFiles() throws IOException {
217217

218218
/**
219219
* Create a package from the specified app files
220-
*
220+
*
221221
* @throws Throwable in case of errors
222222
*/
223223
private void createPackageFromApp() throws Throwable {
@@ -253,7 +253,7 @@ private void createPackageFromApp() throws Throwable {
253253

254254
/**
255255
* Extract the application information to use for the package builder
256-
*
256+
*
257257
* @throws IOException in case of errors
258258
*/
259259
private void extractApplicationInformation() throws IOException {
@@ -291,7 +291,7 @@ private void extractApplicationInformation() throws IOException {
291291

292292
/**
293293
* Returns a subdirectory if needed because of the installation
294-
*
294+
*
295295
* @return subdirectory or ""
296296
*/
297297
private String installationSubdirectory() {
@@ -300,7 +300,7 @@ private String installationSubdirectory() {
300300

301301
/**
302302
* Create and patch the ditribution xml file that defines the package
303-
*
303+
*
304304
* @throws Throwable in case of error
305305
*/
306306
private void createAndPatchDistributionXML() throws Throwable {
@@ -319,7 +319,7 @@ private void createAndPatchDistributionXML() throws Throwable {
319319

320320
/**
321321
* Patch the distriubiton file with custom settings
322-
*
322+
*
323323
* @throws Throwable in case of errors
324324
*/
325325
private void patchDistributionXML() throws Throwable {
@@ -385,7 +385,7 @@ private void patchDistributionXML() throws Throwable {
385385

386386
/**
387387
* Check a file for the correct setup text-resource type
388-
*
388+
*
389389
* @param file to check
390390
* @return file if ok, or null
391391
*/
@@ -414,6 +414,8 @@ private void createTempImage() {
414414
command.add( "create" );
415415
command.add( "-srcfolder" );
416416
command.add( imageSourceRoot );
417+
command.add( "-fs" );
418+
command.add( "HFS+" );
417419
command.add( "-format" );
418420
command.add( "UDRW" );
419421
command.add( "-volname" );
@@ -424,7 +426,7 @@ private void createTempImage() {
424426

425427
/**
426428
* Call hdiutil to mount temporary image
427-
*
429+
*
428430
* @throws IOException in case of errors
429431
*/
430432
private void attach() throws IOException {
@@ -454,12 +456,12 @@ private void detach() {
454456

455457
/**
456458
* Call SetFile to set the volume icon.
457-
*
459+
*
458460
* @throws IOException IOException
459461
*/
460462
private void setVolumeIcon() throws IOException {
461463

462-
// Copy Icon as file icon into attached container
464+
// Copy Icon as file icon into attached container
463465
File iconDestination = TempPath.getTempFile( applicationName, ".VolumeIcon.icns" );
464466
File icons = setup.getIconForType( buildDir, "icns" );
465467
if( icons == null ) {
@@ -490,7 +492,7 @@ private void setVolumeIcon() throws IOException {
490492
/**
491493
* Run an apple script using the applescript.txt template
492494
* This will set up the layout of the DMG window
493-
*
495+
*
494496
* @throws IOException in case of errors
495497
*/
496498
private void applescript() throws IOException {
@@ -521,7 +523,7 @@ private void applescript() throws IOException {
521523

522524
/**
523525
* run a Script for the Package.
524-
*
526+
*
525527
* @throws IOException exception
526528
*/
527529
private void packageApplescript() throws IOException {

0 commit comments

Comments
 (0)