@@ -26,17 +26,13 @@ if [ -n "${CI}" ]; then
2626 CODESIGN_PARAMS=(CODE_SIGN_IDENTITY=' ' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO)
2727fi
2828
29- if [ -n " ${CI_XCODE_CLOUD} " ]; then
30- DERIVED_DATA=" $CI_DERIVED_DATA_PATH "
31- ROOT_WORKSPACE=" $CI_WORKSPACE "
32- BRANCH=" $CI_BRANCH "
33- elif [ -n " ${GITHUB_WORKSPACE} " ]; then
34- DERIVED_DATA=" $GITHUB_WORKSPACE /build/DerivedData/Realm"
29+ if [ -n " ${GITHUB_WORKSPACE} " ]; then
30+ DERIVED_DATA=" $GITHUB_WORKSPACE /build/DerivedData"
3531 ROOT_WORKSPACE=" $GITHUB_WORKSPACE "
36- BRANCH=" $GITHUB_REF "
32+ BRANCH=" ${GITHUB_HEAD_REF :- ${ GITHUB_REF} } "
3733else
3834 ROOT_WORKSPACE=" $( pwd) "
39- DERIVED_DATA=" $ROOT_WORKSPACE /build/DerivedData/Realm "
35+ DERIVED_DATA=" $ROOT_WORKSPACE /build/DerivedData"
4036 BRANCH=" $( git branch --show-current) "
4137fi
4238
@@ -69,7 +65,7 @@ command:
6965 test-swiftpm: tests ObjC and Swift macOS frameworks via SwiftPM
7066 test-ios-swiftui: tests SwiftUI framework UI tests
7167 test-swiftuiserver-osx: tests Server Sync in SwiftUI
72- verify: verifies docs, cocoapods, swiftpm, xcframework, swiftuiserver-osx, swiftlint, spm-ios, objectserver-osx , watchos in both Debug and Release configurations
68+ verify: verifies docs, cocoapods, swiftpm, xcframework, swiftuiserver-osx, swiftlint, spm-ios, sync , watchos in both Debug and Release configurations
7369
7470 docs: builds docs in docs/output
7571 examples: builds all examples
@@ -183,7 +179,7 @@ build_combined() {
183179 build_args=(-scheme " $product " -configuration " $config " build REALM_HIDE_SYMBOLS=YES)
184180
185181 # Derive build paths
186- local build_products_path=" $DERIVED_DATA /Build/Products"
182+ local build_products_path=" $DERIVED_DATA /Realm/ Build/Products"
187183 local product_name=" $product .framework"
188184 local os_path=" $build_products_path /$config ${config_suffix} /$product_name "
189185 local simulator_path=" $build_products_path /$config -$simulator_suffix /$product_name "
@@ -257,7 +253,7 @@ build_platform() {
257253 ;;
258254 esac
259255
260- build_products_path=" $DERIVED_DATA /Build/Products"
256+ build_products_path=" $DERIVED_DATA /Realm/ Build/Products"
261257 build_path=" $build_products_path /$config ${config_suffix} "
262258
263259 build_args=(-scheme " $product " -configuration " $config " build REALM_HIDE_SYMBOLS=YES)
@@ -533,11 +529,11 @@ case "$COMMAND" in
533529 done
534530
535531 # Assemble them into xcframeworks
536- rm -rf " $DERIVED_DATA /Build/Products" * .xcframework
537- find " $DERIVED_DATA /Build/Products" -name ' Realm.framework' \
532+ rm -rf " $DERIVED_DATA /Realm/ Build/Products" * .xcframework
533+ find " $DERIVED_DATA /Realm/ Build/Products" -name ' Realm.framework' \
538534 | sed ' s/.*/-framework &/' \
539535 | xargs xcodebuild -create-xcframework -allow-internal-distribution -output " build/$CONFIGURATION /Realm.xcframework"
540- find " $DERIVED_DATA /Build/Products" -name ' RealmSwift.framework' \
536+ find " $DERIVED_DATA /Realm/ Build/Products" -name ' RealmSwift.framework' \
541537 | sed ' s/.*/-framework &/' \
542538 | xargs xcodebuild -create-xcframework -allow-internal-distribution -output " build/$CONFIGURATION /RealmSwift.xcframework"
543539
@@ -648,7 +644,7 @@ case "$COMMAND" in
648644 exit 0
649645 ;;
650646
651- " test-objectserver-osx " )
647+ " test-sync " )
652648 xctest ' Object Server Tests' -configuration " $CONFIGURATION " -sdk macosx -destination " platform=macOS,arch=$( uname -m) "
653649 exit 0
654650 ;;
@@ -669,7 +665,7 @@ case "$COMMAND" in
669665 ;;
670666
671667 " test-ios-swiftui" )
672- xctest ' SwiftUITestHost' -configuration " $CONFIGURATION " -sdk iphonesimulator -destination ' name=iPhone 11 '
668+ xctest ' SwiftUITestHost' -configuration " $CONFIGURATION " -sdk iphonesimulator -destination ' name=iPhone 14 '
673669 exit 0
674670 ;;
675671
@@ -683,6 +679,16 @@ case "$COMMAND" in
683679 exit 0
684680 ;;
685681
682+ " test-visionos" )
683+ xctest Realm -configuration " $CONFIGURATION " -sdk xrsimulator -destination ' platform=visionOS Simulator,name=Apple Vision Pro' CODE_SIGN_IDENTITY=' '
684+ exit 0
685+ ;;
686+
687+ " test-visionos-swift" )
688+ xctest RealmSwift -configuration " $CONFIGURATION " -sdk xrsimulator -destination ' platform=visionOS Simulator,name=Apple Vision Pro' CODE_SIGN_IDENTITY=' '
689+ exit 0
690+ ;;
691+
686692 " test-swiftuiserver-osx" )
687693 xctest ' SwiftUISyncTestHost' -configuration " $CONFIGURATION " -sdk macosx -destination ' platform=macOS'
688694 exit 0
@@ -695,7 +701,7 @@ case "$COMMAND" in
695701 sh build.sh verify-cocoapods
696702 sh build.sh verify-docs
697703 sh build.sh verify-spm-ios
698- sh build.sh verify-objectserver-osx
704+ sh build.sh verify-sync
699705 sh build.sh verify-swiftlint
700706 sh build.sh verify-swiftpm
701707 sh build.sh verify-watchos
@@ -723,15 +729,15 @@ case "$COMMAND" in
723729 ;;
724730
725731 " verify-cocoapods" )
726- export REALM_TEST_BRANCH=" $sha "
732+ export REALM_TEST_BRANCH=" $BRANCH "
727733 if [[ -d .git ]]; then
728734 # Verify the current branch, unless one was already specified in the sha environment variable.
729- if [[ -z $sha ]]; then
735+ if [[ -z $BRANCH ]]; then
730736 export REALM_TEST_BRANCH=$( git rev-parse --abbrev-ref HEAD)
731737 fi
732738
733739 if [[ $( git log -1 ' @{push}..' ) != " " ]] || ! git diff-index --quiet HEAD; then
734- echo " WARNING: verify-cocoapods will test the latest revision of $sha found on GitHub."
740+ echo " WARNING: verify-cocoapods will test the latest revision of $BRANCH found on GitHub."
735741 echo " Any unpushed local changes will not be tested."
736742 echo " "
737743 sleep 1
@@ -751,7 +757,7 @@ case "$COMMAND" in
751757 PLATFORM=$( echo " $COMMAND " | cut -d - -f 3)
752758 cd examples/installation
753759
754- REALM_TEST_BRANCH=" $sha " ./build.rb " $PLATFORM " cocoapods " $LINKAGE "
760+ REALM_TEST_BRANCH=" $BRANCH " ./build.rb " $PLATFORM " cocoapods " $LINKAGE "
755761 ;;
756762
757763 " verify-docs" )
@@ -768,15 +774,15 @@ case "$COMMAND" in
768774 ;;
769775
770776 " verify-spm" )
771- export REALM_TEST_BRANCH=" $sha "
777+ export REALM_TEST_BRANCH=" $BRANCH "
772778 if [[ -d .git ]]; then
773779 # Verify the current branch, unless one was already specified in the sha environment variable.
774- if [[ -z $sha ]]; then
780+ if [[ -z $BRANCH ]]; then
775781 export REALM_TEST_BRANCH=$( git rev-parse --abbrev-ref HEAD)
776782 fi
777783
778784 if [[ $( git log -1 ' @{push}..' ) != " " ]] || ! git diff-index --quiet HEAD; then
779- echo " WARNING: verify-spm will test the latest revision of $sha found on GitHub."
785+ echo " WARNING: verify-spm will test the latest revision of $BRANCH found on GitHub."
780786 echo " Any unpushed local changes will not be tested."
781787 echo " "
782788 sleep 1
@@ -797,12 +803,7 @@ case "$COMMAND" in
797803 PLATFORM=$( echo " $COMMAND " | cut -d - -f 3)
798804 cd examples/installation
799805
800- REALM_TEST_BRANCH=" $sha " ./build.rb " $PLATFORM " spm " $LINKAGE "
801- exit 0
802- ;;
803-
804- " verify-objectserver-osx" )
805- REALM_TEST_BRANCH=" $sha " sh build.sh test-objectserver-osx
806+ REALM_TEST_BRANCH=" $BRANCH " ./build.rb " $PLATFORM " spm " $LINKAGE "
806807 exit 0
807808 ;;
808809
@@ -837,9 +838,7 @@ case "$COMMAND" in
837838 sh build.sh examples-osx
838839
839840 (
840- DERIVED_EXAMPLE_DATA=${DERIVED_DATA:- examples/ osx/ objc/ build/ DerivedData/ RealmExamples}
841-
842- cd $DERIVED_EXAMPLE_DATA /Build/Products/$CONFIGURATION
841+ cd examples/osx/objc/build/DerivedData/RealmExamples/Build/Products/Release
843842 DYLD_FRAMEWORK_PATH=. ./JSONImport > /dev/null
844843 )
845844 exit 0
0 commit comments