Skip to content

Commit ea7644c

Browse files
committed
U packaging for windows
1 parent b8673d4 commit ea7644c

File tree

2 files changed

+60
-12
lines changed

2 files changed

+60
-12
lines changed

build.gradle

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*/
4-
51
plugins {
62
id 'java'
73
id 'maven-publish'
4+
id 'io.github.fvarrui.javapackager.plugin' version '1.2.0-SNAPSHOT'
85
}
96

107
repositories {
11-
mavenLocal()
12-
maven {
13-
url = uri('http://repo.maven.apache.org/maven2')
14-
}
8+
mavenLocal()
9+
mavenCentral()
1510
}
1611

1712
dependencies {
@@ -20,10 +15,58 @@ dependencies {
2015

2116
group = 'io.github.fvarrui'
2217
version = '1.0.0'
18+
description = 'HelloWorld for Gradle'
2319
sourceCompatibility = '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+
2568
publishing {
26-
publications {
69+
publications {
2770
maven(MavenPublication) {
2871
from(components.java)
2972
}
@@ -33,3 +76,4 @@ publishing {
3376
tasks.withType(JavaCompile) {
3477
options.encoding = 'UTF-8'
3578
}
79+

settings.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*/
1+
pluginManagement {
2+
repositories {
3+
mavenCentral()
4+
mavenLocal()
5+
gradlePluginPortal()
6+
}
7+
}
48

59
rootProject.name = 'HelloWorldGradle'

0 commit comments

Comments
 (0)