Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-standard codegen output dirs #165

Merged

Conversation

Johennes
Copy link
Collaborator

@Johennes Johennes commented Nov 18, 2024

Fixes: #161

This includes the changes from #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 Johennes changed the base branch from johannes/compatibility-matrix to main November 18, 2024 14:10
@Johennes
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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',
      },
    },
  },
};

@Johennes Johennes changed the base branch from main to johannes/compatibility-matrix November 21, 2024 13:56
@Johennes Johennes marked this pull request as ready for review November 21, 2024 13:57
@Johennes Johennes force-pushed the johannes/custom-codegen-output-path branch from b0f5ea3 to 16681fc Compare November 25, 2024 07:36
@Johennes Johennes requested a review from jhugman November 25, 2024 07:37
Copy link
Owner

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice, thank you.

I have left a couple of nits, which you can ignore or not.

Also: the checks don't seem to have run on this PR. Is that something I missed?

.output_dir
.ios
.clone()
.unwrap_or("ios/generated".to_string())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only thing I'd suggest, and it is the smallest of nits, is to default this in RnOutputDirCodegenConfig.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it might take a good deal more boiler plate, so I wouldn't be upset if you ignored this suggestion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've addressed this now.

@Johennes
Copy link
Collaborator Author

Johennes commented Nov 26, 2024

Also: the checks don't seem to have run on this PR. Is that something I missed?

Yes, you're right. They only run when merging to main but this PR is set up to merge into johannes/compatibility-matrix.

Let me actually merge this PR into the other one and we can continue the discussion there and see the CI jobs actually running.

@Johennes Johennes merged commit 59bc61e into johannes/compatibility-matrix Nov 26, 2024
@Johennes Johennes deleted the johannes/custom-codegen-output-path branch November 26, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work anymore with create-react-native-library@0.41.2 & react-native@0.76.1
2 participants