Skip to content

Commit 4110d77

Browse files
authored
Merge branch 'devel' into topic/xcg/fix_deb_generation
2 parents e55b3e0 + 01f680f commit 4110d77

File tree

14 files changed

+107
-60
lines changed

14 files changed

+107
-60
lines changed

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
JavaPackager is a hybrid plugin for **Maven** and **Gradle** which provides an easy way to package Java applications in native Windows, MacOS or GNU/Linux executables, and generate installers for them.
77

8-
> SNAPSHOT version (available in `devel` branch) is not released to Maven Central, so you have to [install it manually](#how-to-build-and-install-the-plugin).
9-
108
> :eyes: See [JavaPackager changes and fixes](https://github.com/fvarrui/JavaPackager/releases).
119
1210
## History
@@ -261,7 +259,7 @@ You can use [default templates](https://github.com/fvarrui/JavaPackager/tree/mas
261259

262260
### Additional JVM options at runtime
263261

264-
When you build your app, all configuration details are hardcoded into the executable and cannot be changed without recreating it or hacking with a resource editor. JavaPackager introduces a feature that allows to pass additional JVM options at runtime from an `.l4j.ini` file (like [Launch4j](http://launch4j.sourceforge.net/docs.html) does, but available for all platforms in the same way). So, you can specify these options in the packager's configuration (packaging time), in INI file (runtime) or in both.
262+
When you build your app, all configuration details are hardcoded into the executable and cannot be changed without recreating or hacking it with a resource editor. JavaPackager introduces a feature that allows to pass additional JVM options at runtime from an `.l4j.ini` file (like [Launch4j](http://launch4j.sourceforge.net/docs.html) does, but available for all platforms in the same way). So, you can specify these options in the packager's configuration (packaging time), in INI file (runtime) or in both.
265263

266264
The INI file's name must correspond to `${name}.l4j.ini` and it has to be located next to the executable on Windows and GNU/Linux, and in `Resources` folder on MacOS.
267265

@@ -389,9 +387,3 @@ Run next command (ommit `./` on Windows):
389387
```bash
390388
./gradlew publish closeAndReleaseRepository
391389
```
392-
393-
> Related [guide](https://nemerosa.ghost.io/2015/07/01/publishing-to-the-maven-central-using-gradle/).
394-
395-
## Future features
396-
397-
Check the [TO-DO list](https://github.com/fvarrui/JavaPackager/projects/1#column-7704117) to know the features we plan to add to JavaPackager.

build.gradle

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ dependencies {
6464
}
6565

6666
group = 'io.github.fvarrui'
67-
version = '1.7.2'
67+
version = '1.7.3-SNAPSHOT'
6868
description = 'Hybrid Maven/Gradle plugin to package Java applications as native Windows, Mac OS X or GNU/Linux executables and create installers for them'
6969

7070
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -114,27 +114,37 @@ publishing {
114114
name = project.name
115115
groupId = project.group
116116
artifactId = project.name
117-
version = project.version
118-
description = project.description
119117
packaging = 'maven-plugin'
120-
url = 'https://github.com/fvarrui/JavaPackager'
121-
scm {
122-
connection = 'scm:git:git://github.com/fvarrui/JavaPackager.git'
123-
developerConnection = 'scm:git:git@github.com:fvarrui/fvarrui.git'
118+
}
119+
}
120+
}
121+
122+
afterEvaluate {
123+
publications {
124+
withType(MavenPublication) {
125+
// customize all publications here
126+
pom {
127+
version = project.version
128+
description = project.description
124129
url = 'https://github.com/fvarrui/JavaPackager'
125-
}
126-
licenses {
127-
license {
128-
name = 'GPL-v3.0'
129-
url = 'http://www.gnu.org/licenses/gpl-3.0.txt'
130-
distribution = 'repo'
130+
scm {
131+
connection = 'scm:git:git://github.com/fvarrui/JavaPackager.git'
132+
developerConnection = 'scm:git:git@github.com:fvarrui/fvarrui.git'
133+
url = 'https://github.com/fvarrui/JavaPackager'
131134
}
132-
}
133-
developers {
134-
developer {
135-
id = 'fvarrui'
136-
name = 'Francisco Vargas Ruiz'
137-
url = 'https://github.com/fvarrui'
135+
licenses {
136+
license {
137+
name = 'GPL-v3.0'
138+
url = 'http://www.gnu.org/licenses/gpl-3.0.txt'
139+
distribution = 'repo'
140+
}
141+
}
142+
developers {
143+
developer {
144+
id = 'fvarrui'
145+
name = 'Francisco Vargas Ruiz'
146+
url = 'https://github.com/fvarrui'
147+
}
138148
}
139149
}
140150
}
@@ -186,7 +196,7 @@ nexusStaging {
186196
}
187197

188198
task updateUniversalJavaApplicationStub(type : Download) {
189-
def version = '20220410.162252'
199+
def version = '20230601.235708'
190200
group 'Update assets'
191201
description 'Downloads compiled and scripted versions of universalJavaApplicationStub to src/main/resources/mac overriding the existing ones.'
192202
src([
@@ -209,4 +219,3 @@ task updateWhyJavaLauncher(type : Download) {
209219
dest file('src/main/resources/windows')
210220
overwrite true
211221
}
212-

docs/windows-specific-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<copyright>${organizationName}</copyright>
2222
<productName>${name}</productName>
2323
<internalName>${name}</internalName>
24+
<txtShortcutName>${name}</txtShortcutName>
2425
<originalFilename>${name}.exe</originalFilename>
2526

2627
<!-- choose EXE creation tool -->
@@ -103,6 +104,7 @@
103104
| ------------------------- | --------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
104105
| `setupMode` | :x: | `installForAllUsers` | Setup installation mode: require administrative privileges or not. [*](#setupmode) |
105106
| `setupLanguages` | :x: | `<english>compiler:Default.isl</english><spanish>compiler:Languages\Spanish.isl</spanish>` | Map with setup languages. |
107+
| `shortcutName` | :x: | `${name}` | Sets the name of the user optional shortcut created on the desktop |
106108
| `disableDirPage` | :x: | `true` | If this is set to `true`, Setup will not show the **Select Destination Location** wizard page. |
107109
| `disableProgramGroupPage` | :x: | `true` | If this is set to `true`, Setup will not show the **Select Start Menu Folder** wizard page. |
108110
| `disableFinishedPage` | :x: | `true` | If this is set to `true`, Setup will not show the **Setup Completed** wizard page. |

src/main/java/io/github/fvarrui/javapackager/gradle/DefaultPackageTask.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.fvarrui.javapackager.gradle;
22

3+
import io.github.fvarrui.javapackager.packagers.Context;
34
import io.github.fvarrui.javapackager.packagers.Packager;
45
import io.github.fvarrui.javapackager.packagers.PackagerFactory;
56

@@ -52,7 +53,7 @@ protected Packager createPackager() throws Exception {
5253
.organizationName(extension.getOrganizationName())
5354
.organizationUrl(extension.getOrganizationUrl())
5455
.outputDirectory(extension.getOutputDirectory())
55-
.packagingJdk(extension.getPackagingJdk())
56+
.packagingJdk(defaultIfNull(extension.getPackagingJdk(), Context.getGradleContext().getDefaultToolchain()))
5657
.runnableJar(extension.getRunnableJar())
5758
.scripts(extension.getScripts())
5859
.useResourcesAsWorkingDir(extension.isUseResourcesAsWorkingDir())

src/main/java/io/github/fvarrui/javapackager/maven/CreateRunnableJar.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ protected File doApply(Packager packager) {
8080
plugin(
8181
groupId("org.apache.maven.plugins"),
8282
artifactId("maven-jar-plugin"),
83-
version("3.1.1")
83+
version("3.3.0")
8484
),
8585
goal("jar"),
8686
configuration(
8787
element("classifier", classifier),
8888
element("archive", archive.toArray(new Element[archive.size()])),
89-
element("outputDirectory", jarFile.getParentFile().getAbsolutePath()),
90-
element("finalName", name + "-" + version)
89+
element("outputDirectory", jarFile.getParentFile().getAbsolutePath())
9190
),
9291
env);
9392

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class WindowsConfig implements Serializable {
3030
private String trademarks;
3131
private String txtFileVersion;
3232
private String txtProductVersion;
33+
private String shortcutName;
3334
private boolean disableDirPage = true;
3435
private boolean disableProgramGroupPage = true;
3536
private boolean disableFinishedPage = true;
@@ -153,6 +154,14 @@ public void setTxtProductVersion(String txtProductVersion) {
153154
this.txtProductVersion = txtProductVersion;
154155
}
155156

157+
public String getShortcutName() {
158+
return shortcutName;
159+
}
160+
161+
public void setShortcutName(String shortcutName) {
162+
this.shortcutName = shortcutName;
163+
}
164+
156165
public String getInternalName() {
157166
return internalName;
158167
}
@@ -312,6 +321,7 @@ public String toString() {
312321
+ ", internalName=" + internalName + ", language=" + language + ", originalFilename=" + originalFilename
313322
+ ", productName=" + productName + ", productVersion=" + productVersion + ", trademarks=" + trademarks
314323
+ ", txtFileVersion=" + txtFileVersion + ", txtProductVersion=" + txtProductVersion
324+
+ ", shortcutName=" + shortcutName
315325
+ ", disableDirPage=" + disableDirPage + ", disableProgramGroupPage=" + disableProgramGroupPage
316326
+ ", disableFinishedPage=" + disableFinishedPage + ", disableRunAfterInstall=" + disableRunAfterInstall
317327
+ ", disableWelcomePage=" + disableWelcomePage + ", createDesktopIconTask=" + createDesktopIconTask
@@ -331,6 +341,7 @@ public void setDefaults(Packager packager) {
331341
this.setFileVersion(defaultIfBlank(this.getFileVersion(), "1.0.0.0"));
332342
this.setTxtFileVersion(defaultIfBlank(this.getTxtFileVersion(), "" + packager.getVersion()));
333343
this.setProductVersion(defaultIfBlank(this.getProductVersion(), "1.0.0.0"));
344+
this.setShortcutName(defaultIfBlank(this.getShortcutName(), packager.getName()));
334345
this.setTxtProductVersion(defaultIfBlank(this.getTxtProductVersion(), "" + packager.getVersion()));
335346
this.setCompanyName(defaultIfBlank(this.getCompanyName(), packager.getOrganizationName()));
336347
this.setCopyright(defaultIfBlank(this.getCopyright(), packager.getOrganizationName()));
@@ -340,5 +351,4 @@ public void setDefaults(Packager packager) {
340351
this.setOriginalFilename(defaultIfBlank(this.getOriginalFilename(), packager.getName() + ".exe"));
341352
this.setMsiUpgradeCode(defaultIfBlank(this.getMsiUpgradeCode(), UUID.randomUUID().toString()));
342353
}
343-
344354
}

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateDmg.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ protected File doApply(MacPackager packager) throws Exception {
134134
if (!isAarch64) {
135135
// makes the top window open itself on mount:
136136
Logger.info("Blessing ...");
137-
execute("bless", "--folder", mountFolder, "--openfolder", mountFolder);
137+
try {
138+
execute("bless", "--folder", mountFolder, "--openfolder", mountFolder); }
139+
catch (Exception e){
140+
Logger.warn("Error blessing " + mountFolder + " due to: " + e.getMessage());
141+
}
138142
}
139143

140144
// tells the volume that it has a special file attribute

src/main/java/io/github/fvarrui/javapackager/packagers/Packager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,14 @@ public void resolveResources() throws Exception {
184184
// adds to additional resources
185185
if (additionalResources != null) {
186186
if (licenseFile != null) additionalResources.add(licenseFile);
187-
additionalResources.add(iconFile);
187+
188+
// skip adding icon file if target platform is windows
189+
if (!getPlatform().equals(Platform.windows)) {
190+
additionalResources.add(iconFile);
191+
} else {
192+
Logger.warn("Skipped adding the icon file as additional resource because the target platform is Windows");
193+
}
194+
188195
Logger.info("Effective additional resources " + additionalResources);
189196
}
190197

32.1 KB
Binary file not shown.
16.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)