-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (104 loc) · 4.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import groovy.xml.MarkupBuilder
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java'
}
def MAIN_CLASS = 'fr.ostix.game.main.Main'
group 'fr.ostix.game'
version '0.5.5'
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
project.ext.lwjglNatives = "natives-linux"
break
case OperatingSystem.WINDOWS:
project.ext.lwjglNatives = "natives-windows"
break
}
repositories {
mavenCentral()
}
tasks.register('runConfiguration') {
//Run
def run = new File("run")
if (!run.exists()) run.mkdirs()
String dir = projectDir.getAbsolutePath()
println(dir)
//Config
def runConfigurationsDir = new File(dir + "/.idea/runConfigurations")
runConfigurationsDir.mkdirs()
def taskName = 'Main'
def mainClass = MAIN_CLASS
def props = '-Djava.library.path=../natives -Dgame.logging.console.level=log -Dorg.lwjglx.VALIDATE'
def args = ''
def writer = new FileWriter(new File(runConfigurationsDir, "${taskName}.xml"))
def xml = new MarkupBuilder(writer)
xml.component(name: "ProjectRunConfigurationManager") {
configuration(default: 'false', name: taskName, type: "Application", factoryName: "Application", singleton: "true") {
option(name: 'MAIN_CLASS_NAME', value: mainClass)
option(name: 'VM_PARAMETERS', value: props)
option(name: 'PROGRAM_PARAMETERS', value: args)
option(name: 'WORKING_DIRECTORY', value: '$PROJECT_DIR$/run')
module(name: '$PROJECT_NAME$.main')
}
}
}
project.ext.lwjglVersion = "3.3.1"
project.ext.jomlVersion = "1.10.5"
dependencies {
implementation fileTree('libs')
// https://mvnrepository.com/artifact/com.github.stephengold/jbullet
implementation group: 'com.github.stephengold', name: 'jbullet', version: '1.0.2'
// https://mvnrepository.com/artifact/cz.advel.jbullet/jbullet
// implementation group: 'cz.advel.jbullet', name: 'jbullet', version: '20101010-1'
// https://mvnrepository.com/artifact/javax.vecmath/vecmath
implementation group: 'javax.vecmath', name: 'vecmath', version: '1.5.2'
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-assimp"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-jemalloc"
implementation "org.lwjgl:lwjgl-lmdb"
implementation "org.lwjgl:lwjgl-meshoptimizer"
implementation "org.lwjgl:lwjgl-openal"
implementation "org.lwjgl:lwjgl-opencl"
implementation "org.lwjgl:lwjgl-opengl"
implementation "org.lwjgl:lwjgl-stb"
implementation "org.lwjgl:lwjgl-tinyfd"
implementation "org.lwjgl:lwjgl-tootle"
implementation "org.lwjgl:lwjgl-xxhash"
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-jemalloc::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-lmdb::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-meshoptimizer::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-tinyfd::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-tootle::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-xxhash::$lwjglNatives"
implementation "org.joml:joml:${jomlVersion}"
// https://mvnrepository.com/artifact/org.l33tlabs.twl/pngdecoder
implementation group: 'org.l33tlabs.twl', name: 'pngdecoder', version: '1.0'
// https://mvnrepository.com/artifact/net.sf.trove4j/trove4j
implementation group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3'
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.28'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.7'
// https://mvnrepository.com/artifact/org.joml/joml
implementation group: 'org.joml', name: 'joml', version: '1.10.4'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
task uberJar(type: Jar) {
archiveClassifier = 'uber'
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}}
test {
useJUnitPlatform()
}