-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
119 lines (101 loc) · 4.21 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Gradle script to build the BasicGame-on-Gradle project
plugins {
id 'application' // to build JVM applications
}
java {
// select one version of Java for source code:
sourceCompatibility = JavaVersion.VERSION_11
//sourceCompatibility = JavaVersion.VERSION_17
//sourceCompatibility = JavaVersion.VERSION_21
// select one version of Java for class files:
targetCompatibility = JavaVersion.VERSION_11
//targetCompatibility = JavaVersion.VERSION_17
//targetCompatibility = JavaVersion.VERSION_21
}
application {
mainClass = 'mygame.Main'
}
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.compilerArgs << '-Xdiags:verbose'
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true // to provide detailed deprecation warnings
options.encoding = 'UTF-8'
options.release = 11
}
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Boolean isMacOS = DefaultNativePlatform.currentOperatingSystem.isMacOsX()
tasks.withType(JavaExec).configureEach { // Java runtime options:
if (isMacOS) {
jvmArgs '-XstartOnFirstThread'
}
classpath sourceSets.main.runtimeClasspath
enableAssertions true
//jvmArgs '-verbose:gc'
//jvmArgs '-Xbatch'
//jvmArgs '-Xms256m', '-Xmx256m' // to enlarge the Java heap
//jvmArgs '-XX:+PrintCompilation'
//jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10'
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // to disable caching of snapshots
}
dependencies {
// You can read more about how to add dependencies here:
// https://docs.gradle.org/current/userguide/dependency_management.html#declaring-dependencies
// from mavenCentral (or mavenLocal) repositories:
implementation(libs.jme3.core)
implementation(libs.jme3.desktop)
//implementation(libs.jme3.effects)
//implementation(libs.jme3.networking)
//implementation(libs.jme3.niftygui)
//implementation(libs.jme3.terrain)
//runtimeOnly(libs.jme3.awt.dialogs) // only for JMonkeyEngine v3.6 or later!
// select one version of LWJGL (from mavenCentral or mavenLocal)
//runtimeOnly(libs.jme3.lwjgl) // LWJGL 2.x
runtimeOnly(libs.jme3.lwjgl3) // LWJGL 3.x
// BasicGame doesn't use physics. If your game needs physics, select one of:
// 1. Minie
//implementation(libs.minie)
// OR
// 2. jme3-jbullet
//implementation(libs.jme3.jbullet)
// OR
// 3. KK Physics
//implementation(libs.kk.physics)
//runtimeOnly(variantOf(libs.jolt.jni.linux64){ classifier('ReleaseSp') })
//runtimeOnly(variantOf(libs.jolt.jni.linuxarm32hf){ classifier('ReleaseSp') })
//runtimeOnly(variantOf(libs.jolt.jni.linuxarm64){ classifier('ReleaseSp') })
//runtimeOnly(variantOf(libs.jolt.jni.macosx64){ classifier('ReleaseSp') })
//runtimeOnly(variantOf(libs.jolt.jni.macosxarm64){ classifier('ReleaseSp') })
//runtimeOnly(variantOf(libs.jolt.jni.windows64){ classifier('ReleaseSp') })
// BasicGame doesn't use jme3-jogg nor jme3-plugins
// -- they are included solely to avoid warnings from AssetConfig.
runtimeOnly(libs.jme3.jogg)
runtimeOnly(libs.jme3.plugins)
// libraries related to the Lemur GUI and Groovy:
//implementation(libs.lemur)
//implementation(libs.lemur.props)
//implementation(libs.lemur.proto)
//runtimeOnly(libs.groovy.jsr223)
// other add-on libraries:
//implementation(libs.blocks)
//implementation(libs.heart)
//implementation(libs.jmePower)
//implementation(libs.sim.math)
//implementation(libs.skyControl)
//runtimeOnly(libs.jme3.testdata)
}
// Register cleanup tasks:
clean.dependsOn('cleanDLLs', 'cleanDyLibs', 'cleanLogs', 'cleanSOs')
tasks.register('cleanDLLs', Delete) { // extracted Windows native libraries
delete fileTree(dir: '.', include: '*.dll')
}
tasks.register('cleanDyLibs', Delete) { // extracted macOS native libraries
delete fileTree(dir: '.', include: '*.dylib')
}
tasks.register('cleanLogs', Delete) { // JVM crash logs
delete fileTree(dir: '.', include: 'hs_err_pid*.log')
}
tasks.register('cleanSOs', Delete) { // extracted Linux and Android native libraries
delete fileTree(dir: '.', include: '*.so')
}