Skip to content

Commit 5f2d2ca

Browse files
committed
Add logger to app bundler
Also print the used executable into the log now
1 parent cb11d59 commit 5f2d2ca

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ protected AbstractOSXApplicationBuilder( T task, S setup, FileResolver fileResol
6464
super( task, fileResolver );
6565
this.setup = setup;
6666
appBundler = new AppBundlerTask();
67+
appBundler.setLogger( setup.getProject().getLogger() );
6768
}
6869

6970
/**

src/com/oracle/appbundler/AppBundlerTask.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
import org.apache.tools.ant.types.Resource;
6262
import org.apache.tools.ant.types.resources.FileResource;
6363

64+
import org.gradle.api.logging.Logger;
65+
6466
import com.inet.gradle.setup.util.ResourceUtils;
6567

6668
/**
@@ -132,7 +134,14 @@ public class AppBundlerTask extends Task {
132134
private static final String STRING_TAG = "string";
133135

134136
private static final int BUFFER_SIZE = 2048;
137+
138+
private Logger logger;
135139

140+
public void setLogger( Logger logger ) {
141+
this.logger = logger;
142+
}
143+
144+
136145
public void setOutputDirectory(File outputDirectory) {
137146
this.outputDirectory = outputDirectory;
138147
}
@@ -453,7 +462,18 @@ public void execute() throws BuildException {
453462

454463
// Copy executable to MacOS folder
455464
File executableFile = new File(macOSDirectory, executableName);
456-
copy(getClass().getResource(EXECUTABLE_NAME), executableFile);
465+
URL executable = null;
466+
if ( architectures.size() == 1 ) {
467+
// check if the is a special arch launcher
468+
executable = getClass().getResource(EXECUTABLE_NAME + "_" + architectures.get( 0 ) );
469+
}
470+
471+
if ( executable == null ) {
472+
executable = getClass().getResource(EXECUTABLE_NAME); // has to exist
473+
}
474+
475+
this.logger.lifecycle( "Using executable from: " + executable.toString() );
476+
copy(executable, executableFile);
457477

458478
executableFile.setExecutable(true, false);
459479

0 commit comments

Comments
 (0)