Skip to content

Instantly share code, notes, and snippets.

@tom-bell
Created September 6, 2014 21:05
Show Gist options
  • Save tom-bell/c9e79b5d53267fc76870 to your computer and use it in GitHub Desktop.
Save tom-bell/c9e79b5d53267fc76870 to your computer and use it in GitHub Desktop.
lwjgl natives with Gradle
def listNativePaths() {
ArrayList<Object> paths = new ArrayList<>();
configurations.compile.each { file ->
if (file.name.contains("natives")) {
zipTree(file).matching {
exclude {
it.path.contains('META-INF')
}
}.each {
paths.add(it)
}
}
}
return paths
}
task natives(type: Sync) {
from listNativePaths()
into "$buildDir/libs"
}
tasks.withType(Test) {
dependsOn natives
systemProperty "java.library.path", "$buildDir/libs"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment