|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | | -NAME="OBTableViewController" |
4 | 3 |
|
5 | | -IOS_ARCHIVE_PATH="./build/archive/ios.xcarchive" |
6 | | -IOS_SIMULATOR_ARCHIVE_PATH="./build/archive/ios_simulator.xcarchive" |
| 4 | +NAME=OBTableViewController |
| 5 | +PROJECT=$NAME.xcodeproj |
| 6 | +SCHEME=$NAME |
| 7 | +SIMULATOR_NAME="iPhone 16 Pro" |
7 | 8 |
|
8 | | -echo "Build" |
9 | | -xcodebuild archive -scheme ${NAME} -archivePath ${IOS_ARCHIVE_PATH} -sdk iphoneos SKIP_INSTALL=NO -destination 'generic/platform=iOS' |
10 | | -xcodebuild archive -scheme ${NAME} -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} -sdk iphonesimulator SKIP_INSTALL=NO -destination 'generic/platform=iOS Simulator' |
| 9 | +build() { |
11 | 10 |
|
| 11 | + xcodebuild build-for-testing -scheme $SCHEME -configuration Debug \ |
| 12 | + -UseNewBuildSystem=YES \ |
| 13 | + -derivedDataPath ./build -disable-concurrent-destination-testing \ |
| 14 | + -destination platform="iOS Simulator,name=$SIMULATOR_NAME" \ |
| 15 | + -parallel-testing-enabled NO \ |
| 16 | + -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO \ |
| 17 | + -enableCodeCoverage NO COMPILER_INDEX_STORE_ENABLE=NO \ |
| 18 | + -skipMacroValidation \ |
| 19 | + ARCH=arm64 \ |
| 20 | + CODE_SIGN_IDENTITY= \ |
| 21 | + CODE_SIGNING_REQUIRED=NO \ |
| 22 | + CODE_SIGNING_ALLOWED=NO | xcbeautify -qq --disable-colored-output |
| 23 | +} |
12 | 24 |
|
13 | | -echo "Create xcframework" |
14 | | -xcodebuild -create-xcframework \ |
15 | | - -framework ${IOS_ARCHIVE_PATH}/Products/Library/Frameworks/${NAME}.framework \ |
16 | | - -framework ${IOS_SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${NAME}.framework \ |
17 | | - -output "./build/${NAME}.xcframework" |
18 | 25 |
|
| 26 | +unitTest() { |
| 27 | + xcodebuild test-without-building -scheme $SCHEME -configuration Debug \ |
| 28 | + -UseNewBuildSystem=YES \ |
| 29 | + -derivedDataPath ./build -disable-concurrent-destination-testing \ |
| 30 | + -destination platform="iOS Simulator,name=$SIMULATOR_NAME" \ |
| 31 | + -parallel-testing-enabled NO \ |
| 32 | + -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO \ |
| 33 | + -enableCodeCoverage NO COMPILER_INDEX_STORE_ENABLE=NO \ |
| 34 | + -collect-test-diagnostics never \ |
| 35 | + -skipMacroValidation \ |
| 36 | + ARCH=arm64 \ |
| 37 | + $ONLY_TEST | xcbeautify --disable-colored-output |
19 | 38 |
|
| 39 | +} |
| 40 | + |
| 41 | +build |
| 42 | + |
| 43 | +if [ $? != 0 ]; then |
| 44 | + echo "Build failed" |
| 45 | + exit 1 |
| 46 | +fi |
| 47 | + |
| 48 | +unitTest |
0 commit comments