Skip to content

Commit

Permalink
Merge pull request #282 from fvarrui/revert-276-devel
Browse files Browse the repository at this point in the history
Revert merge devel -> master
  • Loading branch information
Osiris-Team authored Jan 12, 2023
2 parents 9e46a86 + af2e01e commit 22839cd
Show file tree
Hide file tree
Showing 107 changed files with 2,575 additions and 5,577 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.gradle
**/build/
**/.idea/

# Package Files #
bin
Expand Down
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add the following `plugin` tag to your `pom.xml`:
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.0</version>
<version>1.6.7</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -78,7 +78,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'io.github.fvarrui:javapackager:1.7.0-SNAPSHOT'
classpath 'io.github.fvarrui:javapackager:1.6.7'
}
}
Expand All @@ -88,17 +88,15 @@ apply plugin: 'io.github.fvarrui.javapackager.plugin'
Create your packaging task:

```groovy
task packageMyApp(type: io.github.fvarrui.javapackager.GradlePackageTask, dependsOn: build) {
javapackager{
// mandatory
mainClass = 'path.to.your.mainClass'
// optional
bundleJre = true|false
generateInstaller = true|false
administratorRequired = true|false
platform = auto|linux|mac|windows
additionalResources = [ file('file path'), file('folder path'), ... ]
}
task packageMyApp(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: build) {
// mandatory
mainClass = 'path.to.your.mainClass'
// optional
bundleJre = true|false
generateInstaller = true|false
administratorRequired = true|false
platform = auto|linux|mac|windows
additionalResources = [ file('file path'), file('folder path'), ... ]
linuxConfig {
...
}
Expand All @@ -108,12 +106,6 @@ task packageMyApp(type: io.github.fvarrui.javapackager.GradlePackageTask, depend
winConfig {
...
}
manifest {
....
}
scripts {
...
}
...
}
```
Expand All @@ -126,10 +118,6 @@ And execute the next command in project's root folder:
gradle packageMyApp
```

### Package your app via CI

- **GitHub:** You can find an example workflow file [here](https://github.com/fvarrui/JavaPackager/blob/pr-248/test/hello-world-maven/.github/workflows/package.yml).

### Generated artifacts

By default it will generate next artifacts in `${outputDirectory} ` folder:
Expand Down Expand Up @@ -173,25 +161,21 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
| `extra` | :x: | | Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
| `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. |
| `forceInstaller` | :x: | `false` | If `true`, skips operating system check when generating installers. |
| `nativeImage` | :x: | `false` | If `true`, generates a native image for the current operating system. Note that `jdkVendor` must be set to `graalvm` for this to work. |
| `sharedLibrary` | :x: | `false` | If `true`, generates a shared library for the current operating system. Note that `jdkVendor` must be set to `graalvm` for this to work. |
| `generateInstaller` | :x: | `true` | Generates an installer for the app. |
| `jdkVersion` | :x: | `latest` | JDK version to download and use. The latest version is used by default. See all available versions here: [adoptium](https://api.adoptium.net/v3/info/available_releases). |
| `jdkVendor` | :x: | `graalvm` | JDK vendor to download the JDK from. Currently supported: `adoptium, graalvm` |
| `jdkPath` | :x: | `null` | If null downloads (if necessary and also updates it if needed) the right JDK for the selected platform and sets this value to `<temp-dir>/jdk/win` or `<temp-dir>/jdk/linux` or `<temp-dir>/jdk/mac`. The downloaded JDK will be used to generate a customized JRE. |
| `jdkPath` | :x: | `${java.home}` | JDK used to generate a customized JRE. It allows to bundle customized JREs for different platforms. |
| `jreDirectoryName` | :x: | `"jre"` | Bundled JRE directory name. |
| `jreMinVersion` | :x: | | JRE minimum version. If an appropriate version cannot be found display error message. Disabled if a JRE is bundled. |
| `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. |
| `licenseFile` | :x: | `${project.licenses[0].url}` or `${basedir}/LICENSE` or `${projectdir}/LICENSE` | Path to project license file. |
| `mainClass` | :heavy_check_mark: | `${exec.mainClass}` | Full path to your app main class. |
| `manifest` | :x: | | [Allows adding additional entries to MANIFEST.MF file.](docs/manifest.md) |
| `modules` | :x: | `[]` | Modules to customize the bundled JRE. Don't use `jdeps` to get module dependencies. |
| `appName` | :x: | `${project.name}` or `${project.artifactId}` | App name. |
| `name` | :x: | `${project.name}` or `${project.artifactId}` | App name. |
| `organizationName` | :x: | `${project.organization.name}` or `"ACME"` | Organization name. |
| `organizationUrl` | :x: | `${project.organization.url}` | Organization website URL. |
| `organizationEmail` | :x: | | Organization email. |
| `outputDirectory` | :x: | `${project.build.directory}` or `${project.builddir}` | Output directory (where the artifacts will be generated). |
| `packagingJdk` | :x: | `null` or same as `jdkPath` | JDK used in the execution of `jlink` and other JDK tools. If null `jdkPath` will be used. |
| `packagingJdk` | :x: | `${java.home}` | JDK used in the execution of `jlink` and other JDK tools. |
| `platform` | :x: | `auto` | Defines the target platform, which could be different to the execution platform. Possible values: `auto`, `mac`, `linux`, `windows`. Use `auto` for using execution platform as target. |
| `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. |
| `scripts` | :x: | | Specify bootstrap script. **Pre and post-install scripts comming soon!** |
Expand All @@ -214,7 +198,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
### Plugin assets

Any [asset used by JavaPackager]([JavaPackager/src/main/resources at master · fvarrui/JavaPackager · GitHub](https://github.com/fvarrui/JavaPackager/tree/master/src/main/resources)), such as application icons or templates, can be replaced just by placing a file with the same name in `${assetsDir}` folder organized by platform.
Any [asset used by JavaPackager](https://github.com/fvarrui/JavaPackager/tree/master/src/main/resources), such as application icons or templates, can be replaced just by placing a file with the same name in `${assetsDir}` folder organized by platform.

```bash
${assetsDir}/
Expand Down
26 changes: 6 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
repositories {
mavenLocal()
mavenCentral()
maven {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
Expand Down Expand Up @@ -46,40 +46,31 @@ dependencies {
implementation 'org.apache.maven:maven-plugin-api:3.6.0'
implementation 'org.codehaus.plexus:plexus-utils:3.1.1'
implementation 'org.twdata.maven:mojo-executor:2.3.0'
implementation 'commons-io:commons-io:2.7'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'org.apache.commons:commons-collections4:4.1'
implementation 'org.apache.commons:commons-compress:1.21'
implementation 'org.apache.velocity:velocity-engine-core:2.3'
implementation 'org.apache.velocity:velocity-engine-core:2.0'
implementation 'org.vafer:jdeb:1.9'
implementation 'net.jsign:jsign-core:3.1'
implementation 'org.redline-rpm:redline:1.2.10'
implementation 'io.github.fvarrui:launch4j:2.5.2'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'org.rauschig:jarchivelib:1.2.0'
implementation 'com.squareup:javapoet:1.13.0'

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation 'org.apache.maven.shared:maven-invoker:3.2.0'
testImplementation 'junit:junit:4.12'

compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0'

mavenEmbedder 'org.apache.maven:maven-embedder:3.6.0'
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
mavenEmbedder 'org.slf4j:slf4j-simple:1.7.30'
mavenEmbedder 'org.eclipse.aether:aether-connector-basic:1.1.0'
mavenEmbedder 'org.eclipse.aether:aether-transport-wagon:1.1.0'
mavenEmbedder 'org.apache.maven.wagon:wagon-http:3.4.1'
mavenEmbedder 'org.apache.maven.wagon:wagon-provider-api:3.4.1'
}

test {
useJUnitPlatform()
}

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

sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -95,11 +86,6 @@ publishing {
}
}

java {
withSourcesJar()
// and/or analogously use "withJavadocJar()" to get a "javadocJar" task
}

install.repositories.mavenInstaller.pom.with {
groupId = project.group
artifactId = project.name
Expand Down
Loading

0 comments on commit 22839cd

Please sign in to comment.