Skip to content

Commit 15330cc

Browse files
committedAug 11, 2023
Merge branch 'devel'
2 parents 05a2195 + 0615a5d commit 15330cc

26 files changed

+390
-238
lines changed
 

‎README.md

+18-25
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# JavaPackager
22

3-
[![Maven Central](http://img.shields.io/maven-central/v/io.github.fvarrui/javapackager)](https://central.sonatype.com/artifact/io.github.fvarrui/javapackager/1.7.2)
3+
[![Maven Central](http://img.shields.io/maven-central/v/io.github.fvarrui/javapackager)](https://central.sonatype.com/artifact/io.github.fvarrui/javapackager/1.7.3)
44
[![GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-%250778B9.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
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
@@ -123,21 +121,21 @@ gradle packageMyApp
123121

124122
By default it will generate next artifacts in `${outputDirectory} ` folder:
125123

126-
| Artifact | Description | Platform | Requires |
127-
| --------------------------------------- | ---------------------------------------------------------------- | --------- | --------------------------------------------------------------------------- |
128-
| `${name}` | Directory with native application and other assets. | All | |
129-
| `${name}-${version}-runnable.jar` | Runnable JAR file. | All | |
130-
| `${name}_${version}.AppImage` | AppImage package file. | GNU/Linux | [FUSE 2](https://github.com/AppImage/AppImageKit/wiki/FUSE) to run the app. |
131-
| `${name}_${version}.deb` | DEB package file. | All | |
132-
| `${name}_${version}.rpm` | RPM package file. | All | |
133-
| `${name}_${version}.exe` | Setup file. | Windows | [Inno Setup](http://www.jrsoftware.org/isinfo.php) |
134-
| `${name}_${version}.msi` | MSI installer file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
135-
| `${name}_${version}.msm` | MSI merge module file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
136-
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | MacOS | |
137-
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | MacOS | |
138-
| `${name}-${version}-${platform}.zip` | Zipball containing generated directory `${name}`. | All | |
139-
| `${name}-${version}-${platform}.tar.gz` | Compressed tarball containing generated directory `${name}`. | All | |
140-
| `assets` | Directory with all intermediate files generated by JavaPackager. | All | |
124+
| Artifact | Description | Platform | Requires |
125+
| --------------------------------------- | ---------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------ |
126+
| `${name}` | Directory with native application and other assets. | All | |
127+
| `${name}-${version}-runnable.jar` | Runnable JAR file. | All | |
128+
| `${name}_${version}.AppImage` | AppImage package file. | GNU/Linux | [FUSE 2](https://github.com/AppImage/AppImageKit/wiki/FUSE) to run the app. |
129+
| `${name}_${version}.deb` | DEB package file. | All | |
130+
| `${name}_${version}.rpm` | RPM package file. | All | |
131+
| `${name}_${version}.exe` | Setup file. | Windows | [Inno Setup](http://www.jrsoftware.org/isinfo.php) (`iscc` command must be in PATH variable) |
132+
| `${name}_${version}.msi` | MSI installer file. | Windows | [WiX Toolset](https://wixtoolset.org/) (`candle` and `light` commands must be in PATH variable) |
133+
| `${name}_${version}.msm` | MSI merge module file. | Windows | [WiX Toolset](https://wixtoolset.org/) ( `candle` and `light` commands must be in PATH variable) |
134+
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | MacOS | |
135+
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | MacOS | |
136+
| `${name}-${version}-${platform}.zip` | Zipball containing generated directory `${name}`. | All | |
137+
| `${name}-${version}-${platform}.tar.gz` | Compressed tarball containing generated directory `${name}`. | All | |
138+
| `assets` | Directory with all intermediate files generated by JavaPackager. | All | |
141139

142140
> **Inno Setup** and **WiX Toolset** installation [guide](docs/windows-tools-guide.md).
143141
@@ -148,6 +146,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
148146
| `additionalModulePaths` | :x: | `[]` | Additional module paths for `jdeps`. |
149147
| `additionalModules` | :x: | `[]` | Additional modules to the ones identified by `jdeps` or the specified with `modules` property. |
150148
| `additionalResources` | :x: | `[]` | Additional files and folders to include in the bundled app. |
149+
| `arch` | :x: | `${os.arch}` | The dependency of some ArtifactGenerator objects in the process of making packages, such as GenerateDeb |
151150
| `administratorRequired` | :x: | `false` | App will run as administrator (with elevated privileges). |
152151
| `assetsDir` | :x: | `${basedir}/assets` or `${projectdir}/assets` | Assets location (icons and custom Velocity templates). |
153152
| `bundleJre` | :x: | `false` | Embeds a customized JRE with the app. |
@@ -261,7 +260,7 @@ You can use [default templates](https://github.com/fvarrui/JavaPackager/tree/mas
261260

262261
### Additional JVM options at runtime
263262

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.
263+
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.
265264

266265
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.
267266

@@ -389,9 +388,3 @@ Run next command (ommit `./` on Windows):
389388
```bash
390389
./gradlew publish closeAndReleaseRepository
391390
```
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

+32-23
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies {
4848
implementation 'org.vafer:jdeb:1.9'
4949
implementation 'net.jsign:jsign-core:3.1'
5050
implementation 'org.redline-rpm:redline:1.2.10'
51-
implementation 'io.github.fvarrui:launch4j:2.5.2'
51+
implementation 'edu.sc.seis.launch4j:launch4j:2.5.2'
5252

5353
testImplementation 'junit:junit:4.12'
5454

@@ -64,7 +64,7 @@ dependencies {
6464
}
6565

6666
group = 'io.github.fvarrui'
67-
version = '1.7.2'
67+
version = '1.7.3'
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
}
@@ -157,7 +167,7 @@ task generatePluginDescriptor(type: JavaExec, dependsOn: compileJava) {
157167
'--errors',
158168
'--batch-mode',
159169
'--file', generatePomFileForPluginMavenPublication.destination,
160-
'org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor',
170+
'org.apache.maven.plugins:maven-plugin-plugin:3.9.0:descriptor',
161171
'-Dproject.build.sourceEncoding=' + compileJava.options.encoding
162172
]
163173
doLast {
@@ -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

+2
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

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package io.github.fvarrui.javapackager.gradle;
22

3-
import static io.github.fvarrui.javapackager.utils.ObjectUtils.defaultIfNull;
4-
3+
import io.github.fvarrui.javapackager.packagers.Context;
54
import io.github.fvarrui.javapackager.packagers.Packager;
65
import io.github.fvarrui.javapackager.packagers.PackagerFactory;
76

7+
import static io.github.fvarrui.javapackager.utils.ObjectUtils.defaultIfNull;
8+
89
/**
910
* Default packaging task for Gradle
1011
*/
@@ -22,6 +23,7 @@ protected Packager createPackager() throws Exception {
2223
.additionalModulePaths(extension.getAdditionalModulePaths())
2324
.additionalResources(extension.getAdditionalResources())
2425
.administratorRequired(extension.getAdministratorRequired())
26+
.arch(extension.getArch())
2527
.assetsDir(extension.getAssetsDir())
2628
.bundleJre(extension.getBundleJre())
2729
.classpath(extension.getClasspath())
@@ -51,7 +53,7 @@ protected Packager createPackager() throws Exception {
5153
.organizationName(extension.getOrganizationName())
5254
.organizationUrl(extension.getOrganizationUrl())
5355
.outputDirectory(extension.getOutputDirectory())
54-
.packagingJdk(extension.getPackagingJdk())
56+
.packagingJdk(defaultIfNull(extension.getPackagingJdk(), Context.getGradleContext().getDefaultToolchain()))
5557
.runnableJar(extension.getRunnableJar())
5658
.scripts(extension.getScripts())
5759
.useResourcesAsWorkingDir(extension.isUseResourcesAsWorkingDir())
@@ -61,5 +63,5 @@ protected Packager createPackager() throws Exception {
6163
.winConfig(extension.getWinConfig());
6264

6365
}
64-
66+
6567
}

‎src/main/java/io/github/fvarrui/javapackager/gradle/GradleContext.java

-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,5 @@ public File createWindowsExe(WindowsPackager packager) throws Exception {
122122
}
123123
return null;
124124
}
125-
126-
127125

128126
}

0 commit comments

Comments
 (0)
Failed to load comments.