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

This commit is contained in:
Thad House
2016-11-25 18:07:58 -07:00
committed by Peter Johnson
parent b8e9439d32
commit bc06c843c7
6 changed files with 104 additions and 0 deletions

View File

@@ -93,6 +93,27 @@ task jniHeadersNetworkTables {
}
}
ext.getNativeJNISymbols = {
def symbolsList = []
jniHeadersNetworkTables.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
}