From acda1babebec95f63d1108e2416b3e66723a4644 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 14:40:16 +0100
Subject: [PATCH 1/5] Add schedulers to HomeEnvironment

---
 .../Sources/AppFeature/AppEnvironment+Live.swift     |  4 +++-
 .../Sources/HomeFeature/HomeFeature.swift            | 12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift b/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift
index 6b1df10d..ff97f803 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 4aad88da..6b61b099 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
   )
 }
 
-- 
GitLab


From 6ae574d9352d1a6cc430410867a93f2200b9a4b8 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 14:42:45 +0100
Subject: [PATCH 2/5] Update code signing config for XXMessenger example

---
 .../Project/XXMessenger.xcodeproj/project.pbxproj         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj b/Examples/xx-messenger/Project/XXMessenger.xcodeproj/project.pbxproj
index 48ab32e1..f0505c12 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;
-- 
GitLab


From b8df9506360e191afaebfb014cf29a2b24498c3b Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 14:50:18 +0100
Subject: [PATCH 3/5] Run XXMessenger example tests with run-tests.sh

---
 run-tests.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/run-tests.sh b/run-tests.sh
index 80f7cd7e..4e75d7ee 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,3 +1,8 @@
 #!/bin/sh
 set -e
+
+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
+
+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
-- 
GitLab


From b6bc7c704a5de01ef35dce5f54dbfc4583dbe904 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 15:02:28 +0100
Subject: [PATCH 4/5] Update run-tests.sh

---
 run-tests.sh | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/run-tests.sh b/run-tests.sh
index 4e75d7ee..107defb3 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,8 +1,21 @@
 #!/bin/sh
 set -e
 
-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
+if [ ! -n "$1" ]; 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
+  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
-- 
GitLab


From b19fe5d9c0354788d1c75707470e4d89c91f1fb8 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 15:03:47 +0100
Subject: [PATCH 5/5] Update GitLab CI config

---
 .gitlab-ci.yml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ea48f000..3a788adb 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
-- 
GitLab