-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
122 lines (101 loc) · 3.56 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
import static org.gradle.internal.os.OperatingSystem.*
plugins {
id 'java'
id 'java-library'
id "org.jetbrains.kotlin.jvm" version "1.3.70"
id "com.github.johnrengelman.shadow" version '5.2.0'
}
// jitpack
group = 'com.github.kotlin_graphics'
ext{
moduleName = "${group}.openvr"
kotlin = 'org.jetbrains.kotlin:kotlin'
kotlin_version = '1.3.70'
kotlintest_version = '3.4.2'
uno_version = '402f5f495429b7f2178a1d200c32bb5ed2f7e6fa'
vkk_version = 'bc3da1dd67594af6f2d3e49be74b6fc260025c12'
gln_version = '8dea51af29a2a1d6e51ed3b6d7b06ba2ca2f99b9'
gli_version = 'ac3da8180268b5d121ea83866de5bfe0e8998045'
glm_version = '1b4ac18dd1a3c23440d3f33596688aac60bc0141'
unsigned_version = '18131d0fe0b7465a145a4502d31452c5ae0e59a1'
kool_version = 'fcf04b2c03b8949d9d9a8b0a580082e927903510'
lwjgl_version = "3.2.3"
lwjgl_natives = current() == WINDOWS ? "windows" : current() == LINUX ? "linux" : "macos"
}
dependencies {
implementation "$kotlin-stdlib-jdk8"
testImplementation "io.kotlintest:kotlintest-runner-junit5:$kotlintest_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
def kx = "com.github.kotlin-graphics"
implementation "$kx:gln:$gln_version" // wtf testImplementation doesnt seem to work
implementation "$kx:gli:$gli_version"
implementation "${kx}.glm:glm:$glm_version"
implementation "$kx:kool:$kool_version"
// implementation "$kx:kotlin-unsigned:$unsigned_version"
// implementation 'com.github.kotlin-graphics.uno-sdk:uno-core:683e68fbb3'
["core", "gl"].each {
implementation "${kx}.uno-sdk:uno-$it:$uno_version"
}
["", "-glfw", "-jemalloc", "-openal", "-opengl", "-stb", "-openvr", "-vulkan"].each {
implementation "org.lwjgl:lwjgl$it:$lwjgl_version"
if (it != "-vulkan")
runtimeOnly "org.lwjgl:lwjgl$it:$lwjgl_version:natives-$lwjgl_natives"
}
implementation 'com.beust:klaxon:5.2'
}
repositories {
mavenCentral()
jcenter()
maven { setUrl("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { setUrl('https://jitpack.io') }
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
// archives javadocJar
}
test.useJUnitPlatform()
// https://stackoverflow.com/a/47458666/1047713
//test {
// testLogging {
// events "passed", "skipped", "failed"
// exceptionFormat "full"
// outputs.upToDateWhen { false }
// showStandardStreams = true
// }
//}
shadowJar.archiveClassifier = 'all'
compileKotlin {
// Enable Kotlin compilation to Java 8 class files with method parameter name metadata
kotlinOptions {
jvmTarget = "11"
// javaParameters = true
}
// As per https://stackoverflow.com/a/47669720
// See also https://discuss.kotlinlang.org/t/kotlin-support-for-java-9-module-system/2499/9
destinationDir = compileJava.destinationDir
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
// javaParameters = true
}
}
compileJava {
dependsOn(':compileKotlin')
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--patch-module', "$moduleName=${sourceSets["main"].output.asPath}"]
classpath = files()
}
}
jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }