OpenBW / BWAPI4J

BWAPI wrapper for Java
GNU Lesser General Public License v3.0
24 stars 9 forks source link

Create a test for verifying the presence of native method definitions in the bridge #83

Open adakitesystems opened 5 years ago

adakitesystems commented 5 years ago

When marking a method as native in Java, our Gradle task generateJniHeaders will generate its prototype declaration in a JNI header file for the C++ bridge to include and implement. It would be nice if we could verify that all of our native methods have been at least defined in the bridge somewhere.

Example flow:

  1. Scan all JNI header files and parse each method signature. (e.g. files in BWAPI4J/src/native/include/)
  2. Scan all bridge C++ files for the implementation. (e.g. files in BWAPI4JBridge/src/)
  3. Throw an error message if an implementation is missing.
  4. Throw an error message if an implementation is present but has no corresponding prototype declaration found in the JNI header files.