12345678910111213141516171819202122232425262728293031323334353637383940 |
- const _ = require('lodash');
- const exec = require('shell-utils').exec;
-
- const release = _.includes(process.argv, '--release');
-
- function run() {
- const conf = release ? `Release` : `Debug`;
-
- execWithXcprettyIfPossible(`cd ./playground/ios &&
- RCT_NO_LAUNCH_PACKAGER=true
- xcodebuild build build-for-testing
- -scheme "ReactNativeNavigation"
- -project playground.xcodeproj
- -sdk iphonesimulator
- -configuration ${conf}
- -derivedDataPath ./DerivedData/playground
- ONLY_ACTIVE_ARCH=YES`);
-
- execWithXcprettyIfPossible(`cd ./playground/ios &&
- RCT_NO_LAUNCH_PACKAGER=true
- xcodebuild test-without-building
- -scheme "ReactNativeNavigation"
- -project playground.xcodeproj
- -sdk iphonesimulator
- -configuration ${conf}
- -destination 'platform=iOS Simulator,name=iPhone 7'
- -derivedDataPath ./DerivedData/playground
- ONLY_ACTIVE_ARCH=YES`);
- }
-
- function execWithXcprettyIfPossible(cmd) {
- if (exec.which('xcpretty')) {
- exec.execSync(`${cmd} | xcpretty`);
- } else {
- exec.execSync(cmd);
- }
- }
-
- run();
|