Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ else if (Platform.linux.equals(platform)) {
copySpec.include(appFolder.getName() + "/" + executable.getName());
copySpec.include(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
copySpec.include(appFolder.getName() + "/scripts/*");
copySpec.setFileMode(0755);
copySpec.filePermissions(p -> p.unix("755"));
});

}
Expand All @@ -93,7 +93,7 @@ else if (Platform.mac.equals(platform)) {
copySpec.include(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
copySpec.include(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
copySpec.include(appFile.getName() + "/Contents/Resources/scripts/*");
copySpec.setFileMode(0755);
copySpec.filePermissions(p -> p.unix("755"));
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else if (Platform.linux.equals(platform)) {
copySpec.include(appFolder.getName() + "/" + executable.getName());
copySpec.include(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
copySpec.include(appFolder.getName() + "/scripts/*");
copySpec.setFileMode(0755);
copySpec.filePermissions(p -> p.unix("755"));
});

}
Expand All @@ -88,7 +88,7 @@ else if (Platform.mac.equals(platform)) {
copySpec.include(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
copySpec.include(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
copySpec.include(appFile.getName() + "/Contents/Resources/scripts/*");
copySpec.setFileMode(0755);
copySpec.filePermissions(p -> p.unix("755"));
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public File getRootDir() {

@Override
public File getBuildDir() {
return project.getBuildDir();
return project.getLayout().getBuildDirectory().getAsFile().get();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public PackagePluginExtension(Project project) {
this.vmArgs = new ArrayList<>();
this.appArgs = new ArrayList<>();
this.winConfig = new WindowsConfig();
this.outputDirectory = project.getBuildDir();
this.outputDirectory = project.getLayout().getBuildDirectory().getAsFile().get();
this.scripts = new Scripts();
this.forceInstaller = false;
this.arch = Arch.getDefault();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.fvarrui.javapackager.maven;

import static org.apache.commons.lang3.ObjectUtils.getIfNull;
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment;

import java.io.File;
Expand Down Expand Up @@ -352,7 +352,7 @@ public void execute() throws MojoExecutionException {
.additionalModulePaths(additionalModulePaths)
.additionalResources(additionalResources)
.administratorRequired(administratorRequired)
.arch(defaultIfNull(arch, Arch.getDefault()))
.arch(getIfNull(arch, Arch::getDefault))
.assetsDir(assetsDir)
.bundleJre(bundleJre)
.classpath(classpath)
Expand Down Expand Up @@ -404,11 +404,11 @@ public void execute() throws MojoExecutionException {
} catch (Exception e) {

throw new MojoExecutionException(e.getMessage(), e);

}


}


}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public String toString() {
*/
public void setDefaults(Packager packager) {
this.setCategories((categories == null || categories.isEmpty()) ? Collections.singletonList("Utility") : categories);
this.setInstallationPath(ObjectUtils.defaultIfNull(installationPath, "/opt"));
this.setInstallationPath(ObjectUtils.getIfNull(installationPath, () -> "/opt"));
}

}
24 changes: 12 additions & 12 deletions src/main/java/io/github/fvarrui/javapackager/model/MacConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.fvarrui.javapackager.model;

import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.apache.commons.lang3.ObjectUtils.getIfNull;

import java.io.File;
import java.io.Serializable;
Expand Down Expand Up @@ -305,16 +305,16 @@ public String toString() {
* @param packager Packager
*/
public void setDefaults(Packager packager) {
this.setWindowX(defaultIfNull(this.getWindowX(), 10));
this.setWindowY(defaultIfNull(this.getWindowY(), 60));
this.setWindowWidth(defaultIfNull(this.getWindowWidth(), 540));
this.setWindowHeight(defaultIfNull(this.getWindowHeight(), 360));
this.setIconSize(defaultIfNull(this.getIconSize(), 128));
this.setTextSize(defaultIfNull(this.getTextSize(), 16));
this.setIconX(defaultIfNull(this.getIconX(), 52));
this.setIconY(defaultIfNull(this.getIconY(), 116));
this.setAppsLinkIconX(defaultIfNull(this.getAppsLinkIconX(), 360));
this.setAppsLinkIconY(defaultIfNull(this.getAppsLinkIconY(), 116));
this.setAppId(defaultIfNull(this.getAppId(), packager.getMainClass()));
this.setWindowX(getIfNull(this.getWindowX(), () -> 10));
this.setWindowY(getIfNull(this.getWindowY(), () -> 60));
this.setWindowWidth(getIfNull(this.getWindowWidth(), () -> 540));
this.setWindowHeight(getIfNull(this.getWindowHeight(), () -> 360));
this.setIconSize(getIfNull(this.getIconSize(), () -> 128));
this.setTextSize(getIfNull(this.getTextSize(), () -> 16));
this.setIconX(getIfNull(this.getIconX(), () -> 52));
this.setIconY(getIfNull(this.getIconY(), () -> 116));
this.setAppsLinkIconX(getIfNull(this.getAppsLinkIconX(), () -> 360));
this.setAppsLinkIconY(getIfNull(this.getAppsLinkIconY(), () -> 116));
this.setAppId(getIfNull(this.getAppId(), packager::getMainClass));
}
}