Skip to content

Commit 99e1658

Browse files
committed
A specific icon properties for each platform (iconFile property deprecated)
1 parent dd9f13c commit 99e1658

File tree

7 files changed

+90
-41
lines changed

7 files changed

+90
-41
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ And by default it will generate next artifacts in `target ` folder:
9292
| `envPath` | :x: | `null` | Defines PATH environment variable in GNU/Linux and Mac OS X startup scripts. |
9393
| `extra` | :x: | `null` | Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
9494
| `generateInstaller` | :x: | `true` | Generates an installer for the app. |
95-
| `iconFile` | :x: | `null` | Path to the app icon file (PNG, XPM, ICO or ICNS). |
95+
| `iconFile` | :x: | `null` | Path to the app icon file (PNG, XPM, ICO or ICNS). **:warning: Deprecated (see platform specific properties).** |
9696
| `jdkPath` | :x: | `${java.home}` | JDK used to generate a customized JRE. It allows to bundle customized JREs for different platforms. |
9797
| `jreDirectoryName` | :x: | `"jre"` | Bundled JRE directory name. |
9898
| `jrePath` | :x: | `""` | Path to JRE folder. If specified, it will bundle this JRE with the app, and won't generate a customized JRE. For Java 8 version or least. |
99-
| `licenseFile` | :x: | `${project.licenses[0].url}` or `${project.basedir}/LICENSE` | Path to project license file. |
99+
| `licenseFile` | :x: | `${project.licenses[0].url}` or `${project.basedir}/LICENSE` | Path to project license file. |
100100
| `mainClass` | :heavy_check_mark: | `${exec.mainClass}` | Full path to your app main class. |
101101
| `modules` | :x: | `[]` | Defines modules to customize the bundled JRE. Don't use `jdeps` to get module dependencies. |
102102
| `name` | :x: | `${project.name}` or `${project.artifactId}` | App name. |

docs/linux-specific-properties.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
```xml
44
<linuxConfig>
5+
<pngFile>path/to/icon.png<pngFile>
6+
<xpmFile>path/to/icon.png<xpmFile>
57
<generateDeb>true|false</generateDeb>
68
<generateRpm>true|false</generateRpm>
79
</linuxConfig>
810
```
911

1012
| Property | Mandatory | Default value | Description |
1113
| ------------- | --------- | ------------- | ------------------------------ |
14+
| `pngFile` | :x: | `null` | Icon file. |
15+
| `xpmFile` | :x: | `null` | Icon file for RPM generation. |
1216
| `generateDeb` | :x: | `true` | DEB package will be generated. |
1317
| `generateRpm` | :x: | `true` | RPM package will be generated. |

docs/macosx-specific-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
```xml
44
<macConfig>
55
<!-- general properties -->
6+
<icnsFile>path/to/icon.icns</icnsFile>
67
<generateDmg>true|false</generateDmg>
78
<generatePkg>true|false</generatePkg>
89
<!-- properties used in DMG disk image generation -->
@@ -24,6 +25,7 @@
2425

2526
| Property | Mandatory | Default value | Description |
2627
| ------------- | --------- | ------------- | ---------------------------------------- |
28+
| `icnsFile` | :x: | `null` | Icon file. |
2729
| `generateDmg` | :x: | `true` | Enables DMG disk image file generation. |
2830
| `generatePkg` | :x: | `true` | Enables installation package generation. |
2931

docs/windows-specific-properties.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
```xml
44
<winConfig>
5-
<!-- exe creation properties -->
5+
<!-- general properties -->
6+
<icoFile>path/to/icon.ico</icoFile>
7+
<generateSetup>true|false</generateSetup>
8+
<generateMsi>true|false</generateMsi>
9+
<generateMsm>true|false</generateMsm>
10+
<!-- exe creation properties -->
611
<headerType>gui</headerType>
12+
<wrapJar>true|false</wrapJar>
713
<companyName>${organizationName}</companyName>
814
<fileVersion>1.0.0.0</fileVersion>
915
<txtFileVersion>${version}</txtFileVersion>
@@ -19,35 +25,35 @@
1925
<disableProgramGroupPage>true|false</disableProgramGroupPage>
2026
<disableFinishedPage>true|false</disableFinishedPage>
2127
<createDesktopIconTask>true|false</createDesktopIconTask>
22-
<!-- enables/disables installers generation -->
23-
<generateSetup>true|false</generateSetup>
24-
<generateMsi>true|false</generateMsi>
2528
</winConfig>
2629
```
2730

28-
| Property | Mandatory | Default value | Description |
29-
| --------------- | --------- | ------------- | -------------------------- |
30-
| `generateSetup` | :x: | `true` | Generates Setup installer. |
31-
| `generateMsi` | :x: | `true` | Generates MSI installer. |
31+
| Property | Mandatory | Default value | Description |
32+
| --------------- | --------- | ------------- | -------------------------------------------- |
33+
| `icoFile` | :x: | `null` | Icon file. |
34+
| `generateSetup` | :x: | `true` | Generates Setup installer. |
35+
| `generateMsi` | :x: | `true` | Generates MSI installer. |
36+
| `generateMsm` | :x: | `false` | Generates MSI merge module. **Coming soon!** |
3237

3338

3439
## Exe creation properties
3540

36-
| Property | Mandatory | Default value | Description |
37-
| ------------------------- | --------- | --------------------- | ------------------------------------------------------------ |
38-
| `headerType` | :x: | `"gui"` | EXE header type: `console` or `gui`. |
39-
| `companyName` | :x: | `${organizationName}` | EXE company name. |
40-
| `fileVersion` | :x: | `"1.0.0.0"` | EXE file version. |
41-
| `txtFileVersion` | :x: | `${version}` | EXE txt file version. |
42-
| `productVersion` | :x: | `"1.0.0.0"` | EXE product version. |
43-
| `txtProductVersion` | :x: | `${version}` | EXE txt product version. |
44-
| `fileDescription` | :x: | `${description}` | EXE file description. |
45-
| `copyright` | :x: | `${organizationName}` | EXE copyright. |
46-
| `productName` | :x: | `${name}` | EXE product name. |
47-
| `internalName` | :x: | `${name}` | EXE internal name. |
48-
| `originalFilename` | :x: | `${name}.exe` | EXE original filename. |
49-
| `trademark` | :x: | `null` | EXE trademark. |
50-
| `language` | :x: | `null` | EXE language. |
41+
| Property | Mandatory | Default value | Description |
42+
| ------------------- | --------- | --------------------- | ------------------------------------ |
43+
| `headerType` | :x: | `"gui"` | EXE header type: `console` or `gui`. |
44+
| `wrapJar` | :x: | `true` | Wrap JAR file in native EXE. |
45+
| `companyName` | :x: | `${organizationName}` | EXE company name. |
46+
| `fileVersion` | :x: | `"1.0.0.0"` | EXE file version. |
47+
| `txtFileVersion` | :x: | `${version}` | EXE txt file version. |
48+
| `productVersion` | :x: | `"1.0.0.0"` | EXE product version. |
49+
| `txtProductVersion` | :x: | `${version}` | EXE txt product version. |
50+
| `fileDescription` | :x: | `${description}` | EXE file description. |
51+
| `copyright` | :x: | `${organizationName}` | EXE copyright. |
52+
| `productName` | :x: | `${name}` | EXE product name. |
53+
| `internalName` | :x: | `${name}` | EXE internal name. |
54+
| `originalFilename` | :x: | `${name}.exe` | EXE original filename. |
55+
| `trademark` | :x: | `null` | EXE trademark. |
56+
| `language` | :x: | `null` | EXE language. |
5157

5258
## Setup generation properties
5359

src/main/java/io/github/fvarrui/javapackager/model/LinuxConfig.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package io.github.fvarrui.javapackager.model;
22

3+
import java.io.File;
4+
35
import io.github.fvarrui.javapackager.packagers.Packager;
46

57
public class LinuxConfig {
68

79
private boolean generateDeb = true;
810
private boolean generateRpm = true;
11+
private File pngFile;
12+
private File xpmFile;
913

1014
public boolean isGenerateDeb() {
1115
return generateDeb;
@@ -23,17 +27,35 @@ public void setGenerateRpm(boolean generateRpm) {
2327
this.generateRpm = generateRpm;
2428
}
2529

30+
public File getPngFile() {
31+
return pngFile;
32+
}
33+
34+
public void setPngFile(File pngFile) {
35+
this.pngFile = pngFile;
36+
}
37+
38+
public File getXpmFile() {
39+
return xpmFile;
40+
}
41+
42+
public void setXpmFile(File xpmFile) {
43+
this.xpmFile = xpmFile;
44+
}
45+
2646
@Override
2747
public String toString() {
28-
return "[generateDeb=" + generateDeb + ", generateRpm=" + generateRpm + "]";
48+
return "LinuxConfig [generateDeb=" + generateDeb + ", generateRpm=" + generateRpm + ", pngFile=" + pngFile
49+
+ ", xpmFile=" + xpmFile + "]";
2950
}
3051

3152
/**
3253
* Tests GNU/Linux specific config and set defaults if not specified
54+
*
3355
* @param packager Packager
3456
*/
3557
public void setDefaults(Packager packager) {
3658
// nothing
3759
}
38-
60+
3961
}

src/main/java/io/github/fvarrui/javapackager/model/MacConfig.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
public class MacConfig {
1010

11+
private File icnsFile;
1112
private File backgroundImage;
1213
private Integer windowWidth;
1314
private Integer windowHeight;
@@ -24,6 +25,14 @@ public class MacConfig {
2425
private boolean generateDmg = true;
2526
private boolean generatePkg = true;
2627

28+
public File getIcnsFile() {
29+
return icnsFile;
30+
}
31+
32+
public void setIcnsFile(File icnsFile) {
33+
this.icnsFile = icnsFile;
34+
}
35+
2736
public File getBackgroundImage() {
2837
return backgroundImage;
2938
}
@@ -144,15 +153,13 @@ public void setGeneratePkg(boolean generatePkg) {
144153
this.generatePkg = generatePkg;
145154
}
146155

147-
148-
149156
@Override
150157
public String toString() {
151-
return "[backgroundImage=" + backgroundImage + ", windowWidth=" + windowWidth + ", windowHeight="
152-
+ windowHeight + ", windowX=" + windowX + ", windowY=" + windowY + ", iconSize=" + iconSize
153-
+ ", textSize=" + textSize + ", iconX=" + iconX + ", iconY=" + iconY + ", appsLinkIconX="
154-
+ appsLinkIconX + ", appsLinkIconY=" + appsLinkIconY + ", volumeIcon=" + volumeIcon + ", volumeName="
155-
+ volumeName + ", generateDmg=" + generateDmg + ", generatePkg=" + generatePkg + "]";
158+
return "MacConfig [icnsFile=" + icnsFile + ", backgroundImage=" + backgroundImage + ", windowWidth="
159+
+ windowWidth + ", windowHeight=" + windowHeight + ", windowX=" + windowX + ", windowY=" + windowY
160+
+ ", iconSize=" + iconSize + ", textSize=" + textSize + ", iconX=" + iconX + ", iconY=" + iconY
161+
+ ", appsLinkIconX=" + appsLinkIconX + ", appsLinkIconY=" + appsLinkIconY + ", volumeIcon=" + volumeIcon
162+
+ ", volumeName=" + volumeName + ", generateDmg=" + generateDmg + ", generatePkg=" + generatePkg + "]";
156163
}
157164

158165
/**

src/main/java/io/github/fvarrui/javapackager/model/WindowsConfig.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
44

5+
import java.io.File;
56
import java.util.UUID;
67

78
import io.github.fvarrui.javapackager.packagers.Packager;
89

910
public class WindowsConfig {
1011

12+
private File icoFile;
1113
private HeaderType headerType;
1214
private String companyName;
1315
private String copyright;
@@ -30,6 +32,14 @@ public class WindowsConfig {
3032
private String msiUpgradeCode;
3133
private boolean wrapJar = true;
3234

35+
public File getIcoFile() {
36+
return icoFile;
37+
}
38+
39+
public void setIcoFile(File icoFile) {
40+
this.icoFile = icoFile;
41+
}
42+
3343
public HeaderType getHeaderType() {
3444
return headerType;
3545
}
@@ -189,7 +199,7 @@ public String getMsiUpgradeCode() {
189199
public void setMsiUpgradeCode(String msiUpgradeCode) {
190200
this.msiUpgradeCode = msiUpgradeCode;
191201
}
192-
202+
193203
public boolean isWrapJar() {
194204
return wrapJar;
195205
}
@@ -198,14 +208,12 @@ public void setWrapJar(boolean wrapJar) {
198208
this.wrapJar = wrapJar;
199209
}
200210

201-
202-
203211
@Override
204212
public String toString() {
205-
return "[headerType=" + headerType + ", companyName=" + companyName + ", copyright=" + copyright
206-
+ ", fileDescription=" + fileDescription + ", fileVersion=" + fileVersion + ", internalName="
207-
+ internalName + ", language=" + language + ", originalFilename=" + originalFilename + ", productName="
208-
+ productName + ", productVersion=" + productVersion + ", trademarks=" + trademarks
213+
return "WindowsConfig [icoFile=" + icoFile + ", headerType=" + headerType + ", companyName=" + companyName
214+
+ ", copyright=" + copyright + ", fileDescription=" + fileDescription + ", fileVersion=" + fileVersion
215+
+ ", internalName=" + internalName + ", language=" + language + ", originalFilename=" + originalFilename
216+
+ ", productName=" + productName + ", productVersion=" + productVersion + ", trademarks=" + trademarks
209217
+ ", txtFileVersion=" + txtFileVersion + ", txtProductVersion=" + txtProductVersion
210218
+ ", disableDirPage=" + disableDirPage + ", disableProgramGroupPage=" + disableProgramGroupPage
211219
+ ", disableFinishedPage=" + disableFinishedPage + ", createDesktopIconTask=" + createDesktopIconTask

0 commit comments

Comments
 (0)