-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
104 lines (86 loc) · 3.66 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* FastJ Groovy Template Build Script
*
* Thank you for choosing FastJ! This is a Gradle-based build script that will help you manage your
* project with ease. */
plugins {
/* To begin with, Gradle needs the 'groovy' plugin so that it knows this is a Groovy project. */
id 'groovy'
/* This template is for an application -- we'll need this plugin to make sure Gradle knows
* this, too. */
id 'application'
/* To create distributable files for your game, we use this runtime plugin. */
id 'org.beryx.runtime' version '1.12.7'
}
/* Your project's group name goes here.
* This should be a domain name you own.
* If you don't own a domain, don't worry! You can always set this to 'io.github.yourgithubusername'. */
group('io.github.yourgithubusername')
/* Your project's version.
* When you want to distribute a new version of your project, always make sure to update the
* project version. */
version('0.0.1')
/* Your project's description.
* Give a one or two sentence description of your project -- if you publish it somewhere, you'll be
* able to use it. */
description('A Groovy Template for FastJ.')
/* When you add a dependency on another project (like FastJ), you need to add specify where the
* dependencies are coming from!
* FastJ is hosted on Maven Central and Jitpack.io, so we"ll add the jitpack.io dependency here. */
repositories.maven {
url('https://jitpack.io/')
}
repositories.mavenCentral()
/* The dependency for FastJ, the game engine this template depends on. */
dependencies.implementation('io.github.lucasstarsz.fastj:fastj-library:1.7.0-SNAPSHOT-1')
/* We'll stick with the simplest logging option for now -- you can change it however you need. */
dependencies.implementation('org.slf4j:slf4j-simple:2.0.0-alpha7')
/* The dependency for the Groovy programming language. */
dependencies.implementation('org.apache.groovy:groovy:4.0.4')
/* Here, we specify where the main entrypoint of the project.
* Feel free to change this as needed. */
application.getMainClass().set('tech.fastj.template.Game')
/* The Runtime plugin is used to configure the executables and other distributions for your
* project. */
runtime {
options.addAll(
'--strip-debug',
'--compress', '2',
'--no-header-files',
'--no-man-pages'
)
launcher {
noConsole = true
}
jpackage {
/* Use this to define the path of the icons for your project. */
def iconPath = 'project-resources/fastj_icon'
def currentOs = org.gradle.internal.os.OperatingSystem.current()
if (currentOs.windows) {
imageOptions += ['--icon', "${iconPath}.ico"]
} else if (currentOs.linux) {
imageOptions += ['--icon', "${iconPath}.png"]
} else if (currentOs.macOsX) {
imageOptions += ['--icon', "${iconPath}.icns"]
}
/* Comment the line below to create an installer for your application */
skipInstaller = true
if (!skipInstaller) {
installerOptions += [
'--description', project.description,
'--vendor', project.group,
'--app-version', project.version
]
if (currentOs.windows) {
installerType = 'msi'
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-shortcut']
} else if (currentOs.linux) {
installerType = 'deb'
installerOptions += ['--linux-shortcut']
} else if (currentOs.macOsX) {
installerType = 'pkg'
installerOptions += ['--mac-package-name', project.name]
}
}
}
}