Adds JNI symbol check to ensure we don't miss any definitions (#19)

This commit is contained in:
Thad House
2016-11-27 23:17:26 -08:00
committed by Peter Johnson
parent a19b1b9341
commit 1332ba3ad2
6 changed files with 104 additions and 0 deletions

View File

@@ -98,6 +98,27 @@ task jniHeadersCscore {
}
}
ext.getNativeJNISymbols = {
def symbolsList = []
jniHeadersCscore.outputs.files.each {
FileTree tree = fileTree(dir: it)
tree.each { File file ->
file.eachLine { line ->
if (line.trim()) {
if (line.startsWith("JNIEXPORT ") && line.contains('JNICALL')) {
def (p1, p2) = line.split('JNICALL').collect { it.trim() }
// p2 is our JNI call
symbolsList << p2
}
}
}
}
}
return symbolsList
}
clean {
delete generatedJNIHeaderLoc
}