-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
45 lines (40 loc) · 1.18 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
apply plugin: 'application'
apply plugin: 'java'
mainClassName = 'com.jeffheaton.opencl.HelloOpenCL'
repositories {
mavenCentral()
}
dependencies {
compile 'org.lwjgl.lwjgl:lwjgl:2.8.4'
}
platforms = ['windows', 'linux', 'osx']
platforms.each { platform ->
task "${platform}Natives" {
outputDir = "$buildDir/natives/$platform"
inputs.files(configurations.compile)
outputs.dir(outputDir)
doLast {
copy {
def artifacts = configurations.compile.resolvedConfiguration.resolvedArtifacts
.findAll { it.classifier == "natives-$platform" }
artifacts.each {
from zipTree(it.file)
}
into outputDir
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.4'
}
task natives {
description "Copies native libraries to an appropriate directory."
dependsOn platforms.collect { "${it}Natives" }.findAll { tasks[it] }
}
// Unfortunatly the Gradle app plug-in does not allow me to pass in -D options.
// LWJGL
run {
systemProperties = [ 'java.library.path' : './build/natives/osx' ]
it.dependsOn natives
}