Skip to content

Commit de254c6

Browse files
withSangatlj
andauthored
fix: typo in cmakeListsPath for turbo native modules (#629)
<!-- 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 <[email protected]> Co-authored-by: Burak Güner <[email protected]>
1 parent 639f545 commit de254c6

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

packages/create-react-native-library/templates/native-library-mixed/react-native.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ module.exports = {
55
dependency: {
66
platforms: {
77
android: {
8+
<%_ if (example === 'vanilla') { -%>
89
cmakeListsPath: 'generated/jni/CMakeLists.txt',
10+
<%_ } else { -%>
11+
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
12+
<%_ } -%>
913
},
1014
},
1115
},

packages/create-react-native-library/templates/native-library-new/react-native.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ module.exports = {
55
dependency: {
66
platforms: {
77
android: {
8+
<%_ if (example === 'vanilla') { -%>
89
cmakeListsPath: 'generated/jni/CMakeLists.txt',
10+
<%_ } else { -%>
11+
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
12+
<%_ } -%>
913
},
1014
},
1115
},

packages/create-react-native-library/templates/native-view-mixed/react-native.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ module.exports = {
55
dependency: {
66
platforms: {
77
android: {
8+
<%_ if (example === 'vanilla') { -%>
89
cmakeListsPath: 'generated/jni/CMakeLists.txt',
10+
<%_ } else { -%>
11+
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
12+
<%_ } -%>
913
},
1014
},
1115
},

packages/create-react-native-library/templates/native-view-new/react-native.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ module.exports = {
55
dependency: {
66
platforms: {
77
android: {
8+
<%_ if (example === 'vanilla') { -%>
89
cmakeListsPath: 'generated/jni/CMakeLists.txt',
10+
<%_ } else { -%>
11+
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
12+
<%_ } -%>
913
},
1014
},
1115
},

0 commit comments

Comments
 (0)