diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea48f000a1a5251286403a45c5d724a3c81a998b..3a788adb5348628f3dfc1fdbe4046fe8c36b919c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,16 @@ stages: - test -tests: +package-tests: stage: test tags: - ios script: - ./run-tests.sh + +examples-tests: + stage: test + tags: + - ios + script: + - ./run-tests.sh examples diff --git a/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj b/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj index 48ab32e161ebe4a729ed9473c83f522eb376a019..f0505c12949959289b70b0fc9e45c8f1d1f7079c 100644 --- a/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj +++ b/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj @@ -256,7 +256,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = P38XW29864; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -269,7 +269,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = pl.darrarski.XXMessenger; + PRODUCT_BUNDLE_IDENTIFIER = xx.network.XXMessengerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -283,7 +283,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = P38XW29864; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -296,7 +296,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = pl.darrarski.XXMessenger; + PRODUCT_BUNDLE_IDENTIFIER = xx.network.XXMessengerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; diff --git a/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift b/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift index 6b1df10d25b421f5530cc0b8b77146acdee6023b..ff97f80333da243e0dd39008f16d58587a094463 100644 --- a/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift +++ b/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift @@ -44,7 +44,9 @@ extension AppEnvironment { }, home: { HomeEnvironment( - messenger: messenger + messenger: messenger, + mainQueue: mainQueue, + bgQueue: bgQueue ) } ) diff --git a/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift b/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift index 4aad88dac7cb70cac5908b50bce45a6367b91ca8..6b61b0997c784eafc891d11cf46a15a22ba4549d 100644 --- a/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift +++ b/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift @@ -12,17 +12,25 @@ public enum HomeAction: Equatable { public struct HomeEnvironment { public init( - messenger: Messenger + messenger: Messenger, + mainQueue: AnySchedulerOf<DispatchQueue>, + bgQueue: AnySchedulerOf<DispatchQueue> ) { self.messenger = messenger + self.mainQueue = mainQueue + self.bgQueue = bgQueue } public var messenger: Messenger + public var mainQueue: AnySchedulerOf<DispatchQueue> + public var bgQueue: AnySchedulerOf<DispatchQueue> } extension HomeEnvironment { public static let unimplemented = HomeEnvironment( - messenger: .unimplemented + messenger: .unimplemented, + mainQueue: .unimplemented, + bgQueue: .unimplemented ) } diff --git a/run-tests.sh b/run-tests.sh index 80f7cd7ee032c01a5826cd995efdd3ae0072b8f3..107defb31e0fb391c8b4b6dd38c7b8258d0689b5 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,3 +1,21 @@ #!/bin/sh set -e -set -o pipefail && xcodebuild -scheme 'elixxir-dapps-sdk-swift-Package' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify + +if [ ! -n "$1" ]; then + + echo "\n\033[1;32mâ–¶ Running package tests on iOS Simulator...\033[0m" + set -o pipefail && xcodebuild -scheme 'elixxir-dapps-sdk-swift-Package' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify + +elif [ "$1" = "examples" ]; then + + echo "\n\033[1;32mâ–¶ Running XXMessenger example tests on iOS Simulator...\033[0m" + set -o pipefail && xcodebuild -workspace 'Examples/xx-messenger/XXMessenger.xcworkspace' -scheme 'XXMessenger' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify + +else + + echo "Invalid option. Usage:" + echo " run-tests.sh - Run package tests" + echo " run-tests.sh examples - Run examples tests" + exit 1 + +fi