forked from jsettlers/settlers-remake
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
84 lines (66 loc) · 2.04 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
apply plugin: 'java'
import jsettlers.shaders.compile.ShaderCompilationTask
String[] variants = new String[] {
"natives-linux",
"natives-linux-arm32",
"natives-linux-arm64",
"natives-macos",
"natives-macos-arm64",
"natives-windows",
"natives-windows-x86",
"natives-windows-arm64",
};
String[] modules = new String[] {
"lwjgl",
"lwjgl-opengl",
"lwjgl-openal",
"lwjgl-glfw",
"lwjgl-vma",
}
dependencies {
implementation project(':go.graphics')
def lwjglVersion = rootProject.ext.lwjglVersion
for(String module : modules) {
implementation "org.lwjgl:" + module + ":" + lwjglVersion
for(String variant : variants) {
runtimeOnly "org.lwjgl:" + module + ":" + lwjglVersion + ":" + variant
}
}
implementation "org.lwjgl:lwjgl-vulkan:" + lwjglVersion + ":natives-macos"
implementation "org.lwjgl:lwjgl-vulkan:" + lwjglVersion
implementation "org.lwjgl:lwjgl-egl:" + lwjglVersion
implementation "org.lwjgl:lwjgl-jawt:" + lwjglVersion
implementation "org.joml:joml:1.9.17"
implementation "org.lwjglx:lwjgl3-awt:0.1.8"
// macos support
implementation "org.jogamp.gluegen:gluegen-rt:2.3.2"
implementation "org.jogamp.jogl:jogl-all:2.3.2"
runtimeOnly "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-macosx-universal"
runtimeOnly "org.jogamp.jogl:jogl-all:2.3.2:natives-macosx-universal"
}
def shaderDefinitionDir = 'src/main/glsl/'
def shaderJavaOutputDir = 'src/generated/java'
def shaderResOutputDir = 'src/generated/resources'
sourceSets {
main.java.srcDirs += [shaderJavaOutputDir]
main.resources.srcDirs += [shaderResOutputDir]
}
clean {
delete file(shaderJavaOutputDir)
delete file(shaderResOutputDir)
}
task compileShaders(type: ShaderCompilationTask) {
inputDirectory = file(shaderDefinitionDir).toPath()
generatedSourcesDirectory = file(shaderJavaOutputDir).toPath()
generatedResourcesDirectory = file(shaderResOutputDir).toPath()
}
compileJava {
dependsOn compileShaders
}
copyMainResources {
dependsOn compileShaders
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}