-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
91 lines (74 loc) · 2.43 KB
/
build.gradle
File metadata and controls
91 lines (74 loc) · 2.43 KB
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
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java'
}
group = 'me.cg360.spudengine'
version = '0.1.0'
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
project.ext.lwjgl_natives = "natives-linux"
break
case OperatingSystem.WINDOWS:
project.ext.lwjgl_natives = "natives-windows"
break
}
// Set up environment, if not already setup.
new File("/run/").mkdirs()
new File("/run/assets/").mkdirs()
repositories {
mavenCentral()
}
dependencies {
implementation platform("org.lwjgl:lwjgl-bom:$lwjgl_version")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-assimp"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-openal"
implementation "org.lwjgl:lwjgl-rpmalloc"
implementation "org.lwjgl:lwjgl-shaderc"
implementation "org.lwjgl:lwjgl-stb"
implementation "org.lwjgl:lwjgl-tootle"
implementation "org.lwjgl:lwjgl-vma"
implementation "org.lwjgl:lwjgl-vulkan"
runtimeOnly "org.lwjgl:lwjgl::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-openal::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-rpmalloc::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-shaderc::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-stb::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-tootle::$lwjgl_natives"
runtimeOnly "org.lwjgl:lwjgl-vma::$lwjgl_natives"
implementation "org.joml:joml:${joml_version}"
implementation "org.joml:joml-primitives:${joml_primitives_ersion}"
implementation "org.tinylog:tinylog-api:$tiny_log_version"
implementation "org.tinylog:tinylog-impl:$tiny_log_version"
}
def copyAssets = tasks.register("copyAssets", Copy) {
var fromPath = "$rootDir/src/main/resources/assets"
var toPath = "$rootDir/run/assets"
from fromPath
into toPath
eachFile { file ->
println file.sourcePath
println file.path
}
}
build {
finalizedBy copyAssets
}
jar {
manifest {
attributes(
'Main-Class': 'me.cg360.spudengine.core.Main'
)
}
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}