jhugman / uniffi-bindgen-react-native

A uniffi bindings generator for calling Rust from react-native
https://jhugman.github.io/uniffi-bindgen-react-native/
Other
50 stars 5 forks source link

Handle non-standard codegen output dirs #165

Open Johennes opened 4 days ago

Johennes commented 4 days ago

Fixes: #161

This includes the changes from https://github.com/jhugman/uniffi-bindgen-react-native/pull/163 but is currently based against main so that the workflows run.

This merges into #163 which should then become green and can be merged to main.

Johennes commented 4 days ago

This currently still fails for Android.

   CMake Error at /home/runner/work/uniffi-bindgen-react-native/turbo-module/example/android/app/build/generated/autolinking/src/main/jni/Android-autolinking.cmake:9 (add_subdirectory):
    add_subdirectory given source
    "/home/runner/work/uniffi-bindgen-react-native/turbo-module/android/generated/jni/"
    which is not an existing directory.

I haven't yet found out where the android/generated/jni is coming from.

Johennes commented 3 days ago

One possible source I found is in react-native.config.js which currently isn't generated by UBRN (and I'm unsure if it should be or not).

$ cat react-native.config.js
/**
 * @type {import('@react-native-community/cli-types').UserDependencyConfig}
 */
module.exports = {
  dependency: {
    platforms: {
      android: {
        cmakeListsPath: 'generated/jni/CMakeLists.txt',
      },
    },
  },
};