Created
September 6, 2014 21:05
-
-
Save tom-bell/c9e79b5d53267fc76870 to your computer and use it in GitHub Desktop.
lwjgl natives with Gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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