Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created January 12, 2022 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badsyntax/b9531b2b70c634ecf9286f3d794db4f7 to your computer and use it in GitHub Desktop.
Save badsyntax/b9531b2b70c634ecf9286f3d794db4f7 to your computer and use it in GitHub Desktop.
react native build benchmarks
#!/usr/bin/env bash
echo
echo "!!!! BUILDING IOS, PLEASE WAIT... !!!!!"
echo
npm ci
npm run lint
npm run markdown-link-check
sleep 1
npm run test -- --no-watchman
cd ios
pod install
RN_SRC_EXT=e2e.ts ENVFILE=.env.test xcodebuild -sdk iphonesimulator -derivedDataPath ./build -configuration Release -workspace ./NextGen.xcworkspace -scheme NextGen build
cd ../
npm run test:ios:release:ci
#!/usr/bin/env bash
# Clear watchman watches
watchman watch-del-all 2>/dev/null
# Delete metro cache
rm -rf "${TMPDIR:-/tmp}"/metro-*
# local xcodebuild cache
cd ios/
xcodebuild -alltargets clean 2>/dev/null
cd ..
# ensure all gradle daemons are stopped
cd android/
./gradlew --stop
cd ..
# project deps
find . -name node_modules -type d -exec rm -rf {} \; 2>/dev/null
find . -name Pods -type d -exec rm -rf {} \; 2>/dev/null
# project build files
find . -name build -type d -exec rm -rf {} \; 2>/dev/null
# local gradle
find . -name .gradle -type d -exec rm -rf {} \; 2>/dev/null
find . -name .idea -type d -exec rm -rf {} \; 2>/dev/null
# global gradle cache
rm -rf "$HOME/.gradle/caches/"
# global xcodebuild cache
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" 2>/dev/null
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" 2>/dev/null
rm -rf ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* 2>/dev/null
echo
echo "!! All project build cache and built files have been deleted. !!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment