1- /*
2- * This file was generated by the Gradle 'init' task.
3- */
4-
51plugins {
62 id ' java'
73 id ' maven-publish'
4+ id ' io.github.fvarrui.javapackager.plugin' version ' 1.2.0-SNAPSHOT'
85}
96
107repositories {
11- mavenLocal()
12- maven {
13- url = uri(' http://repo.maven.apache.org/maven2' )
14- }
8+ mavenLocal()
9+ mavenCentral()
1510}
1611
1712dependencies {
@@ -20,10 +15,58 @@ dependencies {
2015
2116group = ' io.github.fvarrui'
2217version = ' 1.0.0'
18+ description = ' HelloWorld for Gradle'
2319sourceCompatibility = ' 1.8'
2420
21+ javaPackager {
22+ mainClass = ' io.github.fvarrui.helloworld.Main'
23+ generateInstaller = false
24+ additionalResources = [ file(' info.txt' ) ]
25+ bundleJre = true
26+ platform = ' windows'
27+ winConfig {
28+ headerType = ' gui'
29+ }
30+ createZipball = true
31+ createTarball = true
32+ }
33+
34+ // task packageForWindows(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
35+ // description = 'Packages the application as a native Windows executable and bundles it in a zipball'
36+ // javaPackager {
37+ // platform = 'windows'
38+ // winConfig {
39+ // headerType = 'gui'
40+ // }
41+ // createZipball = true
42+ // }
43+ // }
44+ //
45+ // task packageForLinux(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
46+ // description = 'Packages the application as a native GNU/Linux executable and bundles it in a zipball'
47+ // javaPackager {
48+ // platform = 'linux'
49+ // createTarball = true
50+ // jdkPath = file('C:\\Users\\fvarrui\\GitHub\\jdks\\adoptopenjdk\\jdk-13.0.2+8-linux')
51+ // }
52+ // }
53+ //
54+ // task packageForMac(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
55+ // description = 'Packages the application as a native Mac OS app and bundles it in a zipball'
56+ // javaPackager {
57+ // platform = 'mac'
58+ // createTarball = true
59+ // jdkPath = file('C:\\Users\\fvarrui\\GitHub\\jdks\\adoptopenjdk\\jdk-13.0.2+8-mac')
60+ // }
61+ // }
62+ //
63+ // task packageForAllPlatforms(dependsOn: [ packageForWindows, packageForMac, packageForLinux ]) {
64+ // description = 'Packages the application for all platforms'
65+ // group = 'JavaPackager'
66+ // }
67+
2568publishing {
26- publications {
69+ publications {
2770 maven(MavenPublication ) {
2871 from(components. java)
2972 }
@@ -33,3 +76,4 @@ publishing {
3376tasks. withType(JavaCompile ) {
3477 options. encoding = ' UTF-8'
3578}
79+
0 commit comments