Skip to content

Commit 6f75f55

Browse files
chore: use build-android/ios commands in added scripts inside example app (#569)
### Summary With fairly new commands `build-android/ios` added inside React Native Community CLI we can replace manually calling `./gradlew` and `xcodebuild` inside `build:android` and `build:ios` scripts. ### Test plan 1. Generate new project with `create-react-native-library` 2. `build:android` and `build:ios` scripts should have the same result as before ✅
1 parent 923435b commit 6f75f55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/create-react-native-library/src/utils/generateExampleApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export default async function generateExampleApp({
109109

110110
const SCRIPTS_TO_ADD = {
111111
'build:android':
112-
'cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a',
113-
'build:ios': `cd ios && xcodebuild -workspace ${projectName}Example.xcworkspace -scheme ${projectName}Example -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO`,
112+
'react-native build-android --extra-params "--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a"',
113+
'build:ios': `react-native build-ios --scheme ${projectName}Example --mode Debug --extra-params "-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"`,
114114
};
115115

116116
if (type === 'native') {

0 commit comments

Comments
 (0)