mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Adds JNI symbol check to ensure we don't miss any definitions (#19)
This commit is contained in:
committed by
Peter Johnson
parent
a19b1b9341
commit
1332ba3ad2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user