-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
69 lines (58 loc) · 1.52 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
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'groovy'
id 'application'
id 'com.stehno.natives' version '0.2.4'
}
apply from: './libraries.gradle'
group = 'org.thathanka'
version = '0.1.1'
ext {
authorName = "Travis Rasor"
authorEmail = "travis@thathanka.org"
expectedGradleVersion = '2.7'
javaLanguageLevel = '1.7'
}
repositories {
jcenter()
}
dependencies {
compile(libraries.groovy)
compile(libraries.slf4j)
compile(libraries.jsr305)
compile(libraries.lwjgl)
testCompile(libraries.junit)
testRuntime(libraries.logback)
}
natives {
def os = getOs()
println "Unpacking natives for $os to ./build/natives/$os"
jars = [
"lwjgl-platform-$lwjglVersion-natives-osx",
"lwjgl-platform-$lwjglVersion-natives-windows",
"lwjgl-platform-$lwjglVersion-natives-linux" ]
platforms = "$os"
}
run {
mainClassName = 'org.thathanka.lwjgl2.HelloWorld'
systemProperty 'java.library.path', file("build/natives/${getOs()}")
}
test {
maxHeapSize = "1024m"
jvmArgs '-XX:MaxPermSize=256m'
systemProperty 'java.library.path', file("build/natives/${getOs()}")
}
def getOs() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
return 'win'
}
if (Os.isFamily(Os.FAMILY_MAC)) {
return 'osx'
}
if (Os.isFamily(Os.FAMILY_UNIX))
return 'linux' //this is not really all that correct
throw new GradleException('Your OS does not seem to be supported')
}
task checkOs {
println "Operating System: ${getOs()}"
}