Skip to content

Commit

Permalink
Zip archive name can now be configured via zipName parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcashman committed Nov 16, 2017
1 parent 81f5bce commit 39f5faa
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[1.2.1]
- Zip archive name can now be configured via zipName parameter

[1.2.0]
- Added bundleNativeZip task to generate a zip archive of the application

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ There are several optional configuration parameters for each platform.

| Optional Parameter | Description | Example |
| ------------- | ------------- | ------------- |
| zipName | Specifies the name for the outputted zip file | zipName = 'my-game-windows.zip' |
| vmArgs | Passes JVM options to the application on launch | vmArgs = ["-Xmx1g"] |
| appArgs | Passes application arguments to the application on launch | appArgs = ["arg1", "arg2"] |
| withJre | Copies your local JRE and bundles it with the application. The value of $JAVA_HOME must be passed as an argument. | withJre("/usr/lib/jvm/java-8-oracle/") |
Expand All @@ -100,6 +101,7 @@ parcl {
vmArgs = ["-Xmx1g"]
appArgs = ["arg1", "arg2"]
exeName = "myapplication"
zipName = 'my-game-windows.zip'
withJre("C:\\Program Files (x86)\\Java\\jdk1.8.0_25\\jre")
}
Expand All @@ -113,6 +115,7 @@ parcl {
displayName = 'My Application'
identifier = 'com.example.my.apple.identifier'
copyright = 'Copyright 2015 Your Name Here'
zipName = 'my-game-mac.zip'
withJre("/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home")
}
Expand All @@ -122,6 +125,7 @@ parcl {
appArgs = ["arg1", "arg2"]
binName = "myapplication"
preferSystemJre = true
zipName = 'my-game-linux.zip'
withJre("/usr/lib/jvm/java-8-oracle/")
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sourceCompatibility = 1.7
targetCompatibility = 1.7

group = 'org.mini2Dx'
version = '1.2.0'
version = '1.2.1-SNAPSHOT'
description = 'Gradle plugin for bundling your Java application for distribution on Windows, Mac and Linux'

dependencies {
Expand Down
12 changes: 9 additions & 3 deletions src/main/groovy/org/mini2Dx/parcl/ParclPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class ParclPlugin implements Plugin<Project> {
from "${project.buildDir}/windows/"
include '**/*'
conventionMapping.archiveName = {
project.getExtensions().findByName('parcl').exe.exeName + ".zip"
project.getExtensions().findByName('parcl').exe.zipName != null ?
project.getExtensions().findByName('parcl').exe.zipName :
project.getExtensions().findByName('parcl').exe.exeName + "-windows.zip"
}
destinationDir(project.file('build'))
}
Expand All @@ -76,7 +78,9 @@ class ParclPlugin implements Plugin<Project> {
from "${project.buildDir}/mac/"
include '**/*'
conventionMapping.archiveName = {
project.getExtensions().findByName('parcl').app.appName + ".zip"
project.getExtensions().findByName('parcl').app.zipName != null ?
project.getExtensions().findByName('parcl').app.zipName :
project.getExtensions().findByName('parcl').app.appName + "-mac.zip"
}
destinationDir(project.file('build'))
}
Expand All @@ -90,7 +94,9 @@ class ParclPlugin implements Plugin<Project> {
from "${project.buildDir}/linux/"
include '**/*'
conventionMapping.archiveName = {
project.getExtensions().findByName('parcl').linux.binName + ".zip"
project.getExtensions().findByName('parcl').linux.zipName != null ?
project.getExtensions().findByName('parcl').linux.zipName :
project.getExtensions().findByName('parcl').linux.binName + "-linux.zip"
}
destinationDir(project.file('build'))
}
Expand Down
1 change: 1 addition & 0 deletions src/main/groovy/org/mini2Dx/parcl/domain/App.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class App {
String identifier
String copyright
String javaHome;
String zipName;

void withJre(String javaHome) {
this.javaHome = javaHome
Expand Down
9 changes: 5 additions & 4 deletions src/main/groovy/org/mini2Dx/parcl/domain/Exe.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ import java.util.List;
* Configuration for Windows packages
*/
class Exe {
List<String> vmArgs
List<String> appArgs
String exeName
String javaHome
List<String> vmArgs;
List<String> appArgs;
String exeName;
String javaHome;
String zipName;

void withJre(String javaHome) {
this.javaHome = javaHome
Expand Down
11 changes: 6 additions & 5 deletions src/main/groovy/org/mini2Dx/parcl/domain/Linux.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import java.util.List;
* Configuration for Linux binaries
*/
class Linux {
List<String> vmArgs
List<String> appArgs
String binName
String javaHome
boolean preferSystemJre
List<String> vmArgs;
List<String> appArgs;
String binName;
String javaHome;
boolean preferSystemJre;
String zipName;

void withJre(String javaHome) {
this.javaHome = javaHome
Expand Down

0 comments on commit 39f5faa

Please sign in to comment.