Skip to content

Commit

Permalink
fix: typo in cmakeListsPath for turbo native modules (#629)
Browse files Browse the repository at this point in the history
<!-- Please provide enough information so that others can review your
pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

<!-- What existing problem does the pull request solve? Can you solve
the issue with a different approach? -->

It fixes #627, as we were having the same issue in our react native
project.
When opting in Turbo Native Modules or Fabric Views, `cmakeListPath` in
generated `react-native.config.js` was not consistent with the hierarchy
generated by CodeGen.
This fix corrects the path as stated by document.

If my fix isn't correct, feel free to correct me.
Thank you.

### Test plan

<!-- List the steps with which we can test this change. Provide
screenshots if this changes anything visual. -->

- Select 'Turbo module - requires new arch (experimental)' to create
Turbo native module and include it into the project
- Build for android with `npx react-native run-android` to validate the
fix was correct.

---------

Co-authored-by: withSang <withsang@mpaghq.com>
Co-authored-by: Burak Güner <md.burak.guner@gmail.com>
  • Loading branch information
3 people authored Sep 13, 2024
1 parent 639f545 commit de254c6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module.exports = {
dependency: {
platforms: {
android: {
<%_ if (example === 'vanilla') { -%>
cmakeListsPath: 'generated/jni/CMakeLists.txt',
<%_ } else { -%>
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
<%_ } -%>
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module.exports = {
dependency: {
platforms: {
android: {
<%_ if (example === 'vanilla') { -%>
cmakeListsPath: 'generated/jni/CMakeLists.txt',
<%_ } else { -%>
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
<%_ } -%>
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module.exports = {
dependency: {
platforms: {
android: {
<%_ if (example === 'vanilla') { -%>
cmakeListsPath: 'generated/jni/CMakeLists.txt',
<%_ } else { -%>
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
<%_ } -%>
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module.exports = {
dependency: {
platforms: {
android: {
<%_ if (example === 'vanilla') { -%>
cmakeListsPath: 'generated/jni/CMakeLists.txt',
<%_ } else { -%>
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
<%_ } -%>
},
},
},
Expand Down

0 comments on commit de254c6

Please sign in to comment.