6
6
7
7
plugins {
8
8
/* To begin with, Gradle needs the "kotlin" plugin so that it knows this is a Kotlin project. */
9
- kotlin(" jvm" ) version " 1.6.21 "
9
+ kotlin(" jvm" ) version " 1.7.10 "
10
10
/* This template is for an application -- we"ll need this plugin to make sure Gradle knows
11
11
* this, too. */
12
12
application
13
- /* To create distributable files for your game, we use this runtime plugin. */
14
- id(" org.beryx.runtime " ) version " 1.12.7 "
13
+ /* To create distributable files for your game, we use this jlink plugin. */
14
+ id(" org.beryx.jlink " ) version " 2.25.0 "
15
15
}
16
16
17
+ val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks
18
+ val compileJava: JavaCompile by tasks
19
+ compileJava.destinationDirectory.set(compileKotlin.destinationDirectory.get())
20
+
17
21
/* Your project's group name goes here.
18
22
* This should be a domain name you own.
19
23
* If you don't own a domain, don"t worry! You can always set this to "io.github.yourgithubusername". */
@@ -31,6 +35,7 @@ description = "A Kotlin Template for FastJ."
31
35
32
36
/* Here, we specify where the main entrypoint of the project.
33
37
* Feel free to change this as needed. */
38
+ application.mainModule.set(" fastj.templategame" )
34
39
application.mainClass.set(" tech.fastj.template.GameKt" )
35
40
36
41
@@ -43,9 +48,9 @@ repositories.maven {
43
48
repositories.mavenCentral()
44
49
45
50
/* The dependency for FastJ, the game engine this template depends on. */
46
- dependencies.implementation(" com .github.fastjengine:FastJ :1.6.0 " )
51
+ dependencies.implementation(" io .github.lucasstarsz.fastj:fastj-library :1.7.0-SNAPSHOT-1 " )
47
52
/* We'll stick with the simplest logging option for now -- you can change it however you need. */
48
- dependencies.implementation(" org.slf4j:slf4j-simple:2.0.0-alpha5 " )
53
+ dependencies.implementation(" org.slf4j:slf4j-simple:2.0.0-alpha7 " )
49
54
50
55
/* To make Kotlin compile and run properly with Gradle, this adds your Kotlin code to the Java
51
56
* source sets. */
@@ -56,7 +61,7 @@ sourceSets.main {
56
61
57
62
/* The Runtime plugin is used to configure the executables and other distributions for your
58
63
* project. */
59
- runtime {
64
+ jlink {
60
65
61
66
options.addAll(
62
67
" --strip-debug" ,
@@ -66,47 +71,49 @@ runtime {
66
71
)
67
72
68
73
launcher {
74
+ name = project.name
69
75
noConsole = true
70
76
}
71
77
72
78
jpackage {
79
+
73
80
/* Use this to define the path of the icons for your project. */
74
81
val iconPath = " project-resources/fastj_icon"
75
82
val currentOs = org.gradle.internal.os.OperatingSystem .current()
76
83
77
-
78
84
when {
79
- currentOs.isWindows -> {
80
- installerType = " msi"
81
- imageOptions = listOf (" --icon" , " ${iconPath} .ico" )
82
- installerOptions = listOf (
83
- " --description" , project.description as String ,
84
- " --vendor" , project.group as String ,
85
- " --app-version" , project.version as String ,
86
- " --win-per-user-install" ,
87
- " --win-dir-chooser" ,
88
- " --win-shortcut" ,
89
- )
90
- }
91
- currentOs.isLinux -> {
92
- installerType = " deb"
93
- imageOptions = listOf (" --icon" , " ${iconPath} .png" )
94
- installerOptions = listOf (
95
- " --description" , project.description as String ,
96
- " --vendor" , project.group as String ,
97
- " --app-version" , project.version as String ,
98
- " --linux-shortcut" ,
99
- )
100
- }
101
- currentOs.isMacOsX -> {
102
- installerType = " pkg"
103
- imageOptions = listOf (" --icon" , " ${iconPath} .icns" )
104
- installerOptions = listOf (
85
+ currentOs.isWindows -> imageOptions = listOf (" --icon" , " ${iconPath} .ico" )
86
+ currentOs.isLinux -> imageOptions = listOf (" --icon" , " ${iconPath} .png" )
87
+ currentOs.isMacOsX -> imageOptions = listOf (" --icon" , " ${iconPath} .icns" )
88
+ }
89
+
90
+ /* Comment the line below to create an installer for your application */
91
+ skipInstaller = true
92
+
93
+ if (! skipInstaller) {
94
+ installerOptions.addAll(
95
+ listOf (
105
96
" --description" , project.description as String ,
106
97
" --vendor" , project.group as String ,
107
- " --app-version" , project.version as String ,
108
- " --mac-package-name" , project.name
98
+ " --app-version" , project.version as String
109
99
)
100
+ )
101
+
102
+ when {
103
+ currentOs.isWindows -> {
104
+ installerType = " msi"
105
+ installerOptions.addAll(listOf (" --win-per-user-install" , " --win-dir-chooser" , " --win-shortcut" ))
106
+ }
107
+
108
+ currentOs.isLinux -> {
109
+ installerType = " deb"
110
+ installerOptions.addAll(listOf (" --linux-shortcut" ))
111
+ }
112
+
113
+ currentOs.isMacOsX -> {
114
+ installerType = " pkg"
115
+ installerOptions.addAll(listOf (" --mac-package-name" , project.name))
116
+ }
110
117
}
111
118
}
112
119
}
0 commit comments