Skip to content

Commit

Permalink
Add fixture for react-native.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennes committed Nov 21, 2024
1 parent c4f9a4c commit b0f5ea3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ jobs:
--builder-bob-version ${{ matrix.bob-version }} \
--rn-version ${{ matrix.rn-version }} \
--packgage-json-mixin integration/fixtures/compat/package.json \
--react-native-config integration/fixtures/compat/react-native.config.js \
--${{ matrix.runner == 'macos-latest' && 'ios' || 'android' }} \
../turbo-module
9 changes: 9 additions & 0 deletions integration/fixtures/compat/react-native.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
dependency: {
platforms: {
android: {
cmakeListsPath: "tmp/jni/CMakeLists.txt",
},
},
},
};
9 changes: 9 additions & 0 deletions scripts/test-turbo-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ reset_args() {
SKIP_ANDROID=true
UBRN_CONFIG=
PACKAGE_JSON_MIXIN=
REACT_NATIVE_CONFIG=
APP_TSX=
}

Expand All @@ -26,6 +27,7 @@ usage() {
echo " -I, --ios Build for iOS."
echo " -C, --ubrn-config Use a ubrn config file."
echo " -P, --packgage-json-mixin Merge another JSON file into package.json"
echo " -R, --react-native-config Use a react-native.config.js file"
echo " -T, --app-tsx Use a App.tsx file."
echo
echo " -s, --slug PROJECT_SLUG Specify the project slug (default: my-test-library)."
Expand Down Expand Up @@ -105,6 +107,10 @@ parse_cli_options() {
PACKAGE_JSON_MIXIN=$(join_paths "$PWD" "$2")
shift
;;
-R|--react-native-config)
REACT_NATIVE_CONFIG=$(join_paths "$PWD" "$2")
shift
;;
-T|--app-tsx)
APP_TSX=$(join_paths "$PWD" "$2")
shift
Expand Down Expand Up @@ -302,6 +308,9 @@ generate_turbo_module_for_compiling() {
jq -s '.[0] * .[1]' ./package.json "$PACKAGE_JSON_MIXIN" > ./package.json.new
mv ./package.json.new ./package.json
fi
if [ -f "$REACT_NATIVE_CONFIG" ] ; then
cp "$REACT_NATIVE_CONFIG" ./react-native.config.js
fi
if [ -f "$APP_TSX" ] ; then
cp "$APP_TSX" ./example/src/App.tsx
fi
Expand Down

0 comments on commit b0f5ea3

Please sign in to comment.