0.5.1 Correctly publish the -java-only artifact and the -headers artifact

Summary:
Fixes #85

I've realized that 0.5.0 was published successfully, but the `fbjni-java-only` artifact and the `headers`
artifacts are missing. This is because the publishing plugin was not applied to the host build, and
changes on the maven publish plugin required a bit more changes on the build files.

I've fixed them all and verified on maven local that everything publishes correctly.

I'm also bumping the version to 0.5.1 to publish a new version.

Reviewed By: cipolleschi

Differential Revision: D47718649

fbshipit-source-id: bcc95fb6011867d61bbeac26c9f61b4149bf0e49
3 files changed
tree: d989f34698f78fccef63a9fde67b43c38160f4e4
  1. .github/
  2. cxx/
  3. docs/
  4. gradle/
  5. java/
  6. scripts/
  7. test/
  8. .gitignore
  9. build.gradle
  10. CMakeLists.txt
  11. CODE_OF_CONDUCT.md
  12. CONTRIBUTING.md
  13. googletest-CMakeLists.txt.in
  14. gradle.properties
  15. gradlew
  16. gradlew.bat
  17. host.gradle
  18. LICENSE
  19. README.md
  20. settings.gradle
README.md

fbjni

The Facebook JNI helpers library is designed to simplify usage of the Java Native Interface. The helpers were implemented to ease the integration of cross-platform mobile code on Android, but there are no Android specifics in the design. It can be used with any Java VM that supports JNI.

struct JMyClass : JavaClass<JMyClass> {
  static constexpr auto kJavaDescriptor = "Lcom/example/MyClass;";

  // Automatic inference of Java method descriptors.
  static std::string concatenate(
      alias_ref<JClass> clazz,
      // Automatic conversion to std::string.
      std::string prefix) {
    // Call methods easily.
    static const auto getSuffix = clazz->getStaticMethod<JString()>("getSuffix");
    // Manage JNI references automatically.
    local_ref<JString> jstr = getSuffix(clazz);
    // Automatic exception translation between Java and C++ (both ways).
    // No need to check exception state after each call.
    result += jstr->toStdString();
    // Automatic conversion from std::string.
    return result;
  }
};

Documentation

License

fbjni is Apache-2 licensed, as found in the LICENSE file.