-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
87 lines (70 loc) · 2.69 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
// The Gradle start scripts are licensed under the Apache 2.0 Software License.
plugins {
// The Java plugin adds Java compilation along with testing and bundling
// capabilities to a project.
id 'java'
// The Application plugin facilitates creating an executable JVM
// application.
id 'application'
}
// The vast majority of Java projects rely on libraries, so managing a
// project’s dependencies is an important part of building a Java project.
// Specifying the dependencies for your Java project requires just three
// pieces of information:
// - Which dependency you need, such as a name and version.
// - What it’s needed for, e.g. compilation or running.
// - Where to look for it
// The first two are specified in a dependencies {} block and
// the third in a repositories {} block.
repositories {
// Here is where to look for the modules declared as dependencies.
// https://bintray.com/bintray/jcenter
jcenter()
flatDir {
dirs 'lib'
}
}
dependencies {
// Configuration (ex: implementation or testImplementation) - a named
// collection of dependencies, grouped together for a specific goal
// such as compiling or running a module.
// Module coordinate (ex: junit:junit:4.12) — the ID of the
// dependency, usually in the form '<group>:<module>:<version>'.
// Configuration & Module coordinate:
// The follow dependencies are get from the directory lib
// If it define flatDir not is needed indicate the directory
implementation name: 'json-smart-1.0.9'
implementation name: 'lwjgl'
implementation name: 'TWL'
implementation name: 'xpp3-1.1.4c'
testImplementation 'junit:junit:4.12'
}
application {
// Configure the application main class.
mainClassName = 'hale.Game'
}
// Executes a Java application in a child process.
// ...
// Type: JavaExec -> Starts a JVM with the given classpath and
// application class (with the method main).
// ...
// Overwrite the task run.
import org.gradle.internal.os.OperatingSystem;
task run(type: JavaExec, overwrite: true) {
// Load the libraries for Linux
if (OperatingSystem.current().isLinux()) {
systemProperties['java.library.path'] = 'lib/native/linux/'
}
// Load the libraries for Windows
else if (OperatingSystem.current().isWindows()) {
systemProperties['java.library.path'] = 'lib/native/windows/'
}
// Load the libraries for MacOS
else if (OperatingSystem.current().isMacOsX()) {
systemProperties['java.library.path'] = 'lib/native/macosx/'
}
// Configure the application classpath.
classpath = sourceSets.main.runtimeClasspath
// Configure the application main class.
main = 'hale.Game'
}