Skip to content

Commit 5bb5a85

Browse files
committed
Merge branch 'devel'
2 parents 22839cd + d08cf4f commit 5bb5a85

39 files changed

+549
-209
lines changed

Diff for: .gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,24 @@ target
1111
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
1212
!gradle-wrapper.jar
1313
src/main/resources/windows/winrun4j-launcher.jar
14+
15+
# Log file
16+
*.log
17+
18+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
19+
hs_err_pid*
20+
21+
# IntelliJ
22+
**/.idea/
23+
**.iml
24+
25+
# Eclipse
26+
**/.settings/
27+
28+
# Maven
29+
**/target/
30+
**/*.xml.releaseBackup
31+
/release.properties
32+
33+
## More
34+
.DS_Store

Diff for: README.md

+16-18
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
[![Maven Central](http://img.shields.io/maven-central/v/io.github.fvarrui/javapackager)](https://search.maven.org/artifact/io.github.fvarrui/javapackager)
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

6-
JavaPackager is a hybrid plugin for **Maven** and **Gradle** which provides an easy way to package Java applications in native Windows, Mac OS X or GNU/Linux executables, and generate installers for them.
6+
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 is not released to Maven Central, so you have to [install it manually](#how-to-build-and-install-the-plugin).
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).
99
1010
> :eyes: See [JavaPackager changes and fixes](https://github.com/fvarrui/JavaPackager/releases).
1111
1212
## History
1313

14-
It was born while teaching to my students how to build and distribute their Java apps, and after seeing that a chain of several plugins was needed to achieve this task, I decided to develop a plugin :ring: to govern them all.
14+
It was born while teaching to my students how to build and distribute their Java apps, and after seeing that a chain of several plugins was needed to achieve this task, I decided to develop a plugin :ring: to rule them all.
1515

1616
## Apps packaged with JavaPackager
1717

18-
- [Spektar Design Lab](https://spektar.io/)
18+
- [AstroImageJ](http://astroimagej.com/)
1919
- [Astro Pixel Processor](https://www.astropixelprocessor.com/)
2020
- [GistFX](https://github.com/RedmondSims/GistFX)
21-
- [AstroImageJ](http://astroimagej.com/)
21+
- [Spektar Design Lab](https://spektar.io/)
2222

2323
## How to use this plugin
2424

@@ -30,7 +30,7 @@ Add the following `plugin` tag to your `pom.xml`:
3030
<plugin>
3131
<groupId>io.github.fvarrui</groupId>
3232
<artifactId>javapackager</artifactId>
33-
<version>1.6.7</version>
33+
<version>{latest.version}</version>
3434
<executions>
3535
<execution>
3636
<phase>package</phase>
@@ -78,7 +78,7 @@ buildscript {
7878
mavenCentral()
7979
}
8080
dependencies {
81-
classpath 'io.github.fvarrui:javapackager:1.6.7'
81+
classpath 'io.github.fvarrui:javapackager:{latest.version}'
8282
}
8383
}
8484
@@ -132,8 +132,8 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
132132
| `${name}_${version}.exe` | Setup file. | Windows | [Inno Setup](http://www.jrsoftware.org/isinfo.php) |
133133
| `${name}_${version}.msi` | MSI installer file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
134134
| `${name}_${version}.msm` | MSI merge module file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
135-
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | Mac OS | |
136-
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | Mac OS | |
135+
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | MacOS | |
136+
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | MacOS | |
137137
| `${name}-${version}-${platform}.zip` | Zipball containing generated directory `${name}`. | All | |
138138
| `${name}-${version}-${platform}.tar.gz` | Compressed tarball containing generated directory `${name}`. | All | |
139139
| `assets` | Directory with all intermediate files generated by JavaPackager. | All | |
@@ -157,7 +157,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
157157
| `customizedJre` | :x: | `true` | Generates a customized JRE, including only identified or specified modules. Otherwise, all modules will be included. |
158158
| `description` | :x: | `${project.description}` or `${displayName}` | Project description. |
159159
| `displayName` | :x: | `${project.name}` or `${name}` | App name to show. |
160-
| `envPath` | :x: | | Defines PATH environment variable in GNU/Linux and Mac OS X startup scripts. |
160+
| `envPath` | :x: | | Defines PATH environment variable in GNU/Linux and MacOS startup scripts. |
161161
| `extra` | :x: | | Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
162162
| `fileAssociations` | :x: | [`FileAssociation[]`](https://github.com/fvarrui/JavaPackager/blob/master/src/main/java/io/github/fvarrui/javapackager/model/FileAssociation.java) | Associate file extensions or MIME types to the app. |
163163
| `forceInstaller` | :x: | `false` | If `true`, skips operating system check when generating installers. |
@@ -180,7 +180,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
180180
| `runnableJar` | :x: | | Defines your own JAR file to be bundled. If it's ommited, the plugin packages your code in a runnable JAR and bundle it with the app. |
181181
| `scripts` | :x: | | Specify bootstrap script. **Pre and post-install scripts comming soon!** |
182182
| `url` | :x: | | App website URL. |
183-
| `useResourcesAsWorkingDir` | :x: | `true` | Uses app resources folder as default working directory (always `true` on Mac OS). |
183+
| `useResourcesAsWorkingDir` | :x: | `true` | Uses app resources folder as default working directory (always `true` on MacOS). |
184184
| `version` | :x: | `${project.version}` | App version. |
185185
| `vmArgs` | :x: | `[]` | VM arguments. |
186186

@@ -191,7 +191,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
191191
| Property | Mandatory | Description |
192192
| ------------- | --------- | ------------------------------------------------------------------- |
193193
| `linuxConfig` | :x: | [GNU/Linux specific properties](docs/linux-specific-properties.md). |
194-
| `macConfig` | :x: | [Mac OS X specific properties](docs/macosx-specific-properties.md). |
194+
| `macConfig` | :x: | [MacOS specific properties](docs/macosx-specific-properties.md). |
195195
| `winConfig` | :x: | [Windows specific properties](docs/windows-specific-properties.md). |
196196

197197
> :warning: Be careful when using the `platform` property if your project uses platform dependent libraries, so the libraries of the current platform will be copied, not those required for the target platform. You can solve this problem using `classifiers`.
@@ -216,7 +216,7 @@ ${assetsDir}/
216216
├── linux/
217217
│ └── ${name}.png # on GNU/Linux it has to be a PNG file
218218
├── mac/
219-
│ └── ${name}.icns # on Mac OS X it has to be a ICNS file
219+
│ └── ${name}.icns # on MacOS it has to be a ICNS file
220220
└── windows/
221221
└── ${name}.ico # on Windows it has to be a ICO file
222222
```
@@ -239,7 +239,7 @@ ${assetsDir}/
239239
| ├── mime.xml.vtl # MIME.XML template
240240
│ └── startup.sh.vtl # Startup script template
241241
├── mac/
242-
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for Mac OS X
242+
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for MacOS
243243
| ├── customize-dmg.applescript.vtl # DMG customization Applescript template
244244
| ├── Info.plist.vtl # Info.plist template
245245
│ └── startup.vtl # Startup script template
@@ -262,7 +262,7 @@ You can use [default templates](https://github.com/fvarrui/JavaPackager/tree/mas
262262

263263
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.
264264

265-
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 Mac OS X.
265+
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.
266266

267267
The options should be separated with spaces or new lines:
268268

@@ -294,12 +294,10 @@ Execute next commands in BASH (GNU/Linux or macOS) or CMD (Windows):
294294
1. Download source code and change to the project directory:
295295

296296
```bash
297-
git clone https://github.com/fvarrui/JavaPackager.git [--branch x]
297+
git clone https://github.com/fvarrui/JavaPackager.git [--branch devel]
298298
cd JavaPackager
299299
```
300300

301-
> where `x` is branch name (e.g. `devel`)
302-
303301
2. Compile, package and install the plugin in your local repository (ommit `./` on Windows):
304302

305303
```bash

Diff for: build.gradle

+25-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ gradlePlugin {
2929
pluginBundle {
3030
website = 'http://github.com/fvarrui/JavaPackager'
3131
vcsUrl = 'http://github.com/fvarrui/JavaPackager.git'
32-
description = 'Packages Java applications as native Windows, Mac OS X or GNU/Linux executables and creates installers for them'
32+
description = 'Packages Java applications as native Windows, MacOS or GNU/Linux executables and creates installers for them'
3333
tags = ['java', 'packager', 'gradle-plugin', 'maven-plugin', 'native', 'installer', 'debian-packages', 'rpm-packages', 'dmg', 'maven', 'gradle', 'distribution', 'javapackager', 'linux-executables', 'deb', 'rpm', 'native-windows', 'java-applications', 'pkg', 'msi']
3434
plugins {
3535
javaPackagerPlugin {
@@ -46,7 +46,7 @@ dependencies {
4646
implementation 'org.apache.maven:maven-plugin-api:3.6.0'
4747
implementation 'org.codehaus.plexus:plexus-utils:3.1.1'
4848
implementation 'org.twdata.maven:mojo-executor:2.3.0'
49-
implementation 'commons-io:commons-io:2.6'
49+
implementation 'commons-io:commons-io:2.11.0'
5050
implementation 'org.apache.commons:commons-lang3:3.9'
5151
implementation 'org.apache.commons:commons-collections4:4.1'
5252
implementation 'org.apache.commons:commons-compress:1.21'
@@ -70,7 +70,7 @@ dependencies {
7070
}
7171

7272
group = 'io.github.fvarrui'
73-
version = '1.6.7'
73+
version = '1.7.0'
7474
description = 'Hybrid Maven/Gradle plugin to package Java applications as native Windows, Mac OS X or GNU/Linux executables and create installers for them'
7575

7676
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -86,6 +86,11 @@ publishing {
8686
}
8787
}
8888

89+
java {
90+
withSourcesJar()
91+
// and/or analogously use "withJavadocJar()" to get a "javadocJar" task
92+
}
93+
8994
install.repositories.mavenInstaller.pom.with {
9095
groupId = project.group
9196
artifactId = project.name
@@ -128,7 +133,7 @@ task generatePluginDescriptor(type: JavaExec, dependsOn: compileJava) {
128133
.with {
129134
appendNode('id', 'gradle')
130135
appendNode('name', 'Gradle Plugin Portal')
131-
appendNode('url', 'https://plugins.gradle.org/m2/')
136+
appendNode('url', 'https://plugins.gradle.org/m2/')
132137
}
133138
asNode().appendNode('build')
134139
.with {
@@ -156,18 +161,18 @@ if (project.hasProperty('release')) {
156161
apply plugin: 'signing'
157162
apply plugin: 'maven'
158163

159-
task javadocJar(type: Jar) {
164+
task deployingJavadocJar(type: Jar) {
160165
classifier = 'javadoc'
161166
from javadoc
162167
}
163168

164-
task sourcesJar(type: Jar) {
169+
task deployingSourcesJar(type: Jar) {
165170
classifier = 'sources'
166171
from sourceSets.main.allSource
167172
}
168173

169174
artifacts {
170-
archives javadocJar, sourcesJar
175+
archives deployingJavadocJar, deployingSourcesJar
171176
}
172177

173178
// Signature of artifacts
@@ -227,8 +232,8 @@ nexusStaging {
227232

228233
task updateUniversalJavaApplicationStub(type : Download) {
229234
def version = '20220410.162252'
230-
group 'Update universalJavaApplicationStub'
231-
description 'Downloads and ovewrites compiled and scripted versions of universalJavaApplicationStub to src/main/resources/mac and overrides the existing ones.'
235+
group 'Update assets'
236+
description 'Downloads compiled and scripted versions of universalJavaApplicationStub to src/main/resources/mac overriding the existing ones.'
232237
src([
233238
"https://github.com/fvarrui/universalJavaApplicationStub/releases/download/${version}/universalJavaApplicationStub.sh",
234239
"https://github.com/fvarrui/universalJavaApplicationStub/releases/download/${version}/universalJavaApplicationStub.x86_64",
@@ -239,3 +244,14 @@ task updateUniversalJavaApplicationStub(type : Download) {
239244
overwrite true
240245
}
241246

247+
task updateWhyJavaLauncher(type : Download) {
248+
def version = '1.1.2'
249+
group 'Update assets'
250+
description 'Downloads JavaLauncher.exe to src/main/resources/windows and overwrites the existing one.'
251+
src([
252+
"https://github.com/AstroImageJ/Why/releases/download/${version}/JavaLauncher.exe"
253+
])
254+
dest file('src/main/resources/windows')
255+
overwrite true
256+
}
257+

Diff for: docs/gradle/plugin-configuration-samples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ task packageMyApp(dependsOn: [ 'packageMyAppForLinux', 'packageMyAppForMac', 'pa
120120
E.g. on Windows, running `packageMyApp` task will generate next artifacts:
121121

122122
* `${name}_${version}-linux.tar.gz` with the GNU/Linux application including a customized JRE.
123-
* `${name}_${version}-mac.tar.gz` with the Mac OS X application including a customized JRE.
123+
* `${name}_${version}-mac.tar.gz` with the MacOS application including a customized JRE.
124124
* `${name}_${version}-windows.zip` with the Windows application including a customized JRE.
125125

126-
As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or Mac OS X, you have to specify a JDK for Windows.
126+
As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or MacOS, you have to specify a JDK for Windows.

0 commit comments

Comments
 (0)