diff --git a/.github/workflows/android-appcenter.yml b/.github/workflows/android-browserstack.yml similarity index 62% rename from .github/workflows/android-appcenter.yml rename to .github/workflows/android-browserstack.yml index 608a83be..b6759d4e 100644 --- a/.github/workflows/android-appcenter.yml +++ b/.github/workflows/android-browserstack.yml @@ -1,4 +1,4 @@ -name: Android AppCenter Tests +name: Android BrowserStack Tests on: workflow_dispatch: @@ -6,13 +6,13 @@ on: branches: [ main ] paths: - 'binding/android/CobraTestApp/cobra-test-app/build.gradle' - - '.github/workflows/android-appcenter.yml' + - '.github/workflows/android-browserstack.yml' pull_request: branches: [ main, 'v[0-9]+.[0-9]+' ] paths: - 'binding/android/CobraTestApp/cobra-test-app/build.gradle' - - '.github/workflows/android-appcenter.yml' + - '.github/workflows/android-browserstack.yml' defaults: run: @@ -20,19 +20,18 @@ defaults: jobs: build: - name: Run Android Tests on AppCenter + name: Run Android Tests on BrowserStack runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Node.js LTS - uses: actions/setup-node@v3 + - name: Installing Python + uses: actions/setup-python@v5 with: - node-version: lts/* - - - name: Install AppCenter CLI - run: npm install -g appcenter-cli + python-version: '3.10' + - run: + pip3 install requests - name: set up JDK 11 uses: actions/setup-java@v3 @@ -62,30 +61,29 @@ jobs: - name: Build androidTest run: ./gradlew assembleAndroidTest - - name: Run tests on AppCenter - run: appcenter test run espresso - --token ${{secrets.APPCENTERAPITOKEN}} - --app "Picovoice/Cobra-Android-Activity" - --devices "Picovoice/android-min-max" - --app-path cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk - --test-series "cobra-android" - --locale "en_US" - --build-dir cobra-test-app/build/outputs/apk/androidTest/debug + - name: Run tests on BrowserStack + run: python3 ../../../script/automation/browserstack.py + --type espresso + --username "${{secrets.BROWSERSTACK_USERNAME}}" + --access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}" + --project_name "Cobra-Android" + --devices "android-min-max" + --app_path "cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk" + --test_path "cobra-test-app/build/outputs/apk/androidTest/debug/cobra-test-app-debug-androidTest.apk" build-integ: - name: Run Android Integration Tests on AppCenter + name: Run Android Integration Tests on BrowserStack runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Node.js LTS - uses: actions/setup-node@v3 + - name: Installing Python + uses: actions/setup-python@v5 with: - node-version: lts/* - - - name: Install AppCenter CLI - run: npm install -g appcenter-cli + python-version: '3.10' + - run: + pip3 install requests - name: set up JDK 11 uses: actions/setup-java@v3 @@ -118,12 +116,12 @@ jobs: - name: Build androidTest run: ./gradlew assembleReleaseAndroidTest -DtestBuildType=integ - - name: Run tests on AppCenter - run: appcenter test run espresso - --token ${{secrets.APPCENTERAPITOKEN}} - --app "Picovoice/Cobra-Android-Activity" - --devices "Picovoice/android-min-max" - --app-path cobra-test-app/build/outputs/apk/release/cobra-test-app-release.apk - --test-series "cobra-android" - --locale "en_US" - --build-dir cobra-test-app/build/outputs/apk/androidTest/release + - name: Run tests on BrowserStack + run: python3 ../../../script/automation/browserstack.py + --type espresso + --username "${{secrets.BROWSERSTACK_USERNAME}}" + --access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}" + --project_name "Cobra-Android-Integration" + --devices "android-min-max" + --app_path "cobra-test-app/build/outputs/apk/release/cobra-test-app-release.apk" + --test_path "cobra-test-app/build/outputs/apk/androidTest/release/cobra-test-app-release-androidTest.apk" \ No newline at end of file diff --git a/.github/workflows/android-perf.yml b/.github/workflows/android-perf.yml index 85ec23b2..5f7a44aa 100644 --- a/.github/workflows/android-perf.yml +++ b/.github/workflows/android-perf.yml @@ -19,28 +19,25 @@ defaults: jobs: build: - name: Run Android Speed Tests on AppCenter + name: Run Android Speed Tests on BrowserStack runs-on: ubuntu-latest strategy: matrix: - device: [single-android, 32bit-android] + device: [ android-perf ] include: - - device: single-android + - device: android-perf performanceThresholdSec: 0.005 - - device: 32bit-android - performanceThresholdSec: 0.015 steps: - uses: actions/checkout@v3 - - name: Set up Node.js LTS - uses: actions/setup-node@v3 + - name: Installing Python + uses: actions/setup-python@v5 with: - node-version: lts/* - - - name: Install AppCenter CLI - run: npm install -g appcenter-cli + python-version: '3.10' + - run: + pip3 install requests - name: set up JDK 11 uses: actions/setup-java@v3 @@ -79,12 +76,12 @@ jobs: - name: Build androidTest run: ./gradlew assembleAndroidTest -DtestBuildType=perf - - name: Run tests on AppCenter - run: appcenter test run espresso - --token ${{secrets.APPCENTERAPITOKEN}} - --app "Picovoice/Cobra-Android-Activity" - --devices "Picovoice/${{ matrix.device }}" - --app-path cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk - --test-series "cobra-android" - --locale "en_US" - --build-dir cobra-test-app/build/outputs/apk/androidTest/debug + - name: Run tests on BrowserStack + run: python3 ../../../script/automation/browserstack.py + --type espresso + --username "${{secrets.BROWSERSTACK_USERNAME}}" + --access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}" + --project_name "Cobra-Android-Performance" + --devices "${{ matrix.device }}" + --app_path "cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk" + --test_path "cobra-test-app/build/outputs/apk/androidTest/debug/cobra-test-app-debug-androidTest.apk" \ No newline at end of file diff --git a/.github/workflows/ios-appcenter.yml b/.github/workflows/ios-appcenter.yml deleted file mode 100644 index 20e60ed0..00000000 --- a/.github/workflows/ios-appcenter.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: iOS AppCenter Tests - -on: - workflow_dispatch: - push: - branches: [ main ] - paths: - - 'binding/ios/CobraAppTest/Podfile.lock' - - '.github/workflows/ios-appcenter.yml' - - pull_request: - branches: [ main, 'v[0-9]+.[0-9]+' ] - paths: - - 'binding/ios/CobraAppTest/Podfile.lock' - - '.github/workflows/ios-appcenter.yml' - - -defaults: - run: - working-directory: binding/ios/CobraAppTest - -jobs: - build: - name: Run iOS Tests on AppCenter - runs-on: macos-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Node.js LTS - uses: actions/setup-node@v3 - with: - node-version: lts/* - - - name: Install Cocoapods - run: gem install cocoapods - - - name: Install AppCenter CLI - run: npm install -g appcenter-cli - - - name: Make build dir - run: mkdir ddp - - - name: Run Cocoapods - run: pod install - - - name: Inject AccessKey - run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' - CobraAppTestUITests/CobraAppTestUITests.swift - - - name: XCode Build - run: xcrun xcodebuild build-for-testing - -configuration Debug - -workspace CobraAppTest.xcworkspace - -sdk iphoneos - -scheme CobraAppTest - -derivedDataPath ddp - CODE_SIGNING_ALLOWED=NO - - - name: Run Tests on AppCenter - run: appcenter test run xcuitest - --token ${{secrets.APPCENTERAPITOKEN}} - --app "Picovoice/Cobra-iOS" - --devices "Picovoice/ios-min-max" - --test-series "cobra-ios" - --locale "en_US" - --build-dir ddp/Build/Products/Debug-iphoneos diff --git a/.github/workflows/ios-browserstack.yml b/.github/workflows/ios-browserstack.yml new file mode 100644 index 00000000..4b79ef8e --- /dev/null +++ b/.github/workflows/ios-browserstack.yml @@ -0,0 +1,71 @@ +name: iOS BrowserStack Tests + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - '.github/workflows/ios-browserstack.yml' + + pull_request: + branches: [ main, 'v[0-9]+.[0-9]+' ] + paths: + - '.github/workflows/ios-browserstack.yml' + + +defaults: + run: + working-directory: binding/ios/CobraAppTest + +jobs: + build: + name: Run iOS Tests on BrowserStack + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Installing Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - run: + pip3 install requests + + - name: Make build dir + run: mkdir ddp + + - name: Inject AccessKey + run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' + CobraAppTestUITests/CobraAppTestUITests.swift + + - name: XCode Build + run: xcrun xcodebuild build-for-testing + -configuration Debug + -project CobraAppTest.xcodeproj + -sdk iphoneos + -scheme CobraAppTest + -derivedDataPath ddp + CODE_SIGNING_ALLOWED=NO + + - name: Generating ipa + run: cd ddp/Build/Products/Debug-iphoneos/ && + mkdir Payload && + cp -r CobraAppTest.app Payload && + zip --symlinks -r CobraAppTest.ipa Payload && + rm -r Payload + + - name: Zipping Tests + run: cd ddp/Build/Products/Debug-iphoneos/ && + zip --symlinks -r CobraAppTestUITests.zip CobraAppTestUITests-Runner.app + + - name: Run tests on BrowserStack + run: python3 ../../../script/automation/browserstack.py + --type xcuitest + --username "${{secrets.BROWSERSTACK_USERNAME}}" + --access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}" + --project_name "Cobra-iOS" + --devices "ios-min-max" + --app_path "ddp/Build/Products/Debug-iphoneos/CobraAppTest.ipa" + --test_path "ddp/Build/Products/Debug-iphoneos/CobraAppTestUITests.zip" \ No newline at end of file diff --git a/.github/workflows/ios-demos.yml b/.github/workflows/ios-demos.yml index 8ea26251..275a46c7 100644 --- a/.github/workflows/ios-demos.yml +++ b/.github/workflows/ios-demos.yml @@ -25,16 +25,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install Cocoapods - run: gem install cocoapods - - - name: Run Cocoapods - run: pod install - - name: Build run: xcrun xcodebuild build -configuration Debug - -workspace CobraDemo.xcworkspace + -project CobraDemo.xcodeproj -sdk iphoneos -scheme CobraDemo -derivedDataPath ddp diff --git a/.github/workflows/ios-perf.yml b/.github/workflows/ios-perf.yml index fb54a3c8..9eb52e93 100644 --- a/.github/workflows/ios-perf.yml +++ b/.github/workflows/ios-perf.yml @@ -19,7 +19,7 @@ defaults: jobs: build: - name: Run iOS Tests on AppCenter + name: Run iOS Tests on BrowserStack runs-on: macos-latest strategy: @@ -33,23 +33,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Node.js LTS - uses: actions/setup-node@v3 + - name: Installing Python + uses: actions/setup-python@v5 with: - node-version: lts/* - - - name: Install Cocoapods - run: gem install cocoapods - - - name: Install AppCenter CLI - run: npm install -g appcenter-cli + python-version: '3.10' + - run: + pip3 install requests - name: Make build dir run: mkdir ddp - - name: Run Cocoapods - run: pod install - - name: Inject AppID run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' PerformanceTest/PerformanceTest.swift @@ -59,23 +52,36 @@ jobs: PerformanceTest/PerformanceTest.swift - name: Inject Performance Threshold - run: sed -i '.bak' 's:{PERFORMANCE_THRESHOLD_SEC}:${{ matrix.performanceThresholdSec }}:' + run: sed -i '.bak' + '1,/{PERFORMANCE_THRESHOLD_SEC}/s/{PERFORMANCE_THRESHOLD_SEC}/${{ matrix.performanceThresholdSec }}/' PerformanceTest/PerformanceTest.swift - name: XCode Build run: xcrun xcodebuild build-for-testing -configuration Debug - -workspace CobraAppTest.xcworkspace + -project CobraAppTest.xcodeproj -sdk iphoneos -scheme PerformanceTest -derivedDataPath ddp CODE_SIGNING_ALLOWED=NO - - name: Run Tests on AppCenter - run: appcenter test run xcuitest - --token ${{secrets.APPCENTERAPITOKEN}} - --app "Picovoice/Cobra-iOS" - --devices "Picovoice/${{ matrix.device }}" - --test-series "cobra-ios" - --locale "en_US" - --build-dir ddp/Build/Products/Debug-iphoneos \ No newline at end of file + - name: Generating ipa + run: cd ddp/Build/Products/Debug-iphoneos/ && + mkdir Payload && + cp -r CobraAppTest.app Payload && + zip --symlinks -r CobraAppTest.ipa Payload && + rm -r Payload + + - name: Zipping Tests + run: cd ddp/Build/Products/Debug-iphoneos/ && + zip --symlinks -r PerformanceTest.zip PerformanceTest-Runner.app + + - name: Run tests on BrowserStack + run: python3 ../../../script/automation/browserstack.py + --type xcuitest + --username "${{secrets.BROWSERSTACK_USERNAME}}" + --access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}" + --project_name "Cobra-iOS-Performance" + --devices "${{ matrix.device }}" + --app_path "ddp/Build/Products/Debug-iphoneos/CobraAppTest.ipa" + --test_path "ddp/Build/Products/Debug-iphoneos/PerformanceTest.zip" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ca3e57f1..50c9905e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ .idea demo/c/cobra_demo_file demo/c/cobra_demo_mic -__pycache__ \ No newline at end of file +__pycache__ +.build +Package.resolved +.swiftpm \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index a2038094..eeb6f358 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "demo/c/dr_libs"] path = demo/c/dr_libs - url = ../../mackron/dr_libs.git + url = https://github.com/mackron/dr_libs.git [submodule "demo/c/pvrecorder"] path = demo/c/pvrecorder - url = ../pvrecorder.git + url = https://github.com/Picovoice/pvrecorder.git diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..f3ec9a67 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "Cobra-iOS", + platforms: [ + .iOS(.v13) + ], + products: [ + .library( + name: "Cobra", + targets: ["Cobra"] + ) + ], + targets: [ + .binaryTarget( + name: "PvCobra", + path: "lib/ios/PvCobra.xcframework" + ), + .target( + name: "Cobra", + dependencies: ["PvCobra"], + path: ".", + exclude: [ + "binding/ios/CobraAppTest", + "demo" + ], + sources: [ + "binding/ios/Cobra.swift", + "binding/ios/CobraErrors.swift" + ] + ) + ] +) diff --git a/binding/android/CobraTestApp/cobra-test-app/build.gradle b/binding/android/CobraTestApp/cobra-test-app/build.gradle index 952da1c4..6cf4cef4 100644 --- a/binding/android/CobraTestApp/cobra-test-app/build.gradle +++ b/binding/android/CobraTestApp/cobra-test-app/build.gradle @@ -96,6 +96,7 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + lint { abortOnError false } @@ -114,7 +115,6 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - androidTestImplementation('com.microsoft.appcenter:espresso-test-extension:1.4') androidTestImplementation('androidx.test.espresso:espresso-intents:3.5.1') } diff --git a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java index 8d6a0d16..da8babc5 100644 --- a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java +++ b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java @@ -1,5 +1,5 @@ /* - Copyright 2021-2023 Picovoice Inc. + Copyright 2021-2024 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -16,13 +16,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.platform.app.InstrumentationRegistry; -import com.microsoft.appcenter.espresso.Factory; -import com.microsoft.appcenter.espresso.ReportHelper; - -import org.junit.After; -import org.junit.Assume; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,8 +42,6 @@ @RunWith(AndroidJUnit4.class) public class CobraTest { - @Rule - public ReportHelper reportHelper = Factory.getReportHelper(); Context testContext; Context appContext; AssetManager assetManager; @@ -57,11 +49,6 @@ public class CobraTest { String accessKey = ""; - @After - public void TearDown() { - reportHelper.label("Stopping App"); - } - @Before public void Setup() throws IOException { testContext = InstrumentationRegistry.getInstrumentation().getContext(); @@ -78,7 +65,6 @@ public void testProcess() throws CobraException { Cobra cobra = new Cobra(accessKey); File testAudio = new File(testResourcesPath, "audio/sample.wav"); - ArrayList detectionResults = new ArrayList<>(); List probs = new ArrayList<>(); diff --git a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/IntegrationTest.java b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/IntegrationTest.java index 79fff3b6..3d7be0a4 100644 --- a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/IntegrationTest.java +++ b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/IntegrationTest.java @@ -16,9 +16,6 @@ import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; -import com.microsoft.appcenter.espresso.Factory; -import com.microsoft.appcenter.espresso.ReportHelper; - import org.hamcrest.Matcher; import org.junit.After; import org.junit.Before; @@ -74,9 +71,6 @@ public void perform(UiController uiController, View view) { @RunWith(AndroidJUnit4.class) public class IntegrationTest { - @Rule - public ReportHelper reportHelper = Factory.getReportHelper(); - @Rule public ActivityScenarioRule activityScenarioRule = new ActivityScenarioRule<>(MainActivity.class); @@ -91,13 +85,8 @@ public void intentsTeardown() { Intents.release(); } - @After - public void TearDown() { - reportHelper.label("Stopping App"); - } - @Test - public void testPorcupine() { + public void testCobra() { onView(withId(R.id.testButton)).perform(click()); onView(withId(R.id.testResult)).perform(waitForText("Passed", 60000)); } diff --git a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java index 9f48c31e..eadb1406 100644 --- a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java +++ b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java @@ -8,13 +8,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.platform.app.InstrumentationRegistry; -import com.microsoft.appcenter.espresso.Factory; -import com.microsoft.appcenter.espresso.ReportHelper; - -import org.junit.After; import org.junit.Assume; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,18 +28,13 @@ @RunWith(AndroidJUnit4.class) public class PerformanceTest { - @Rule - public ReportHelper reportHelper = Factory.getReportHelper(); + Context testContext; Context appContext; AssetManager assetManager; String testResourcesPath; - String accessKey; - @After - public void TearDown() { - reportHelper.label("Stopping App"); - } + String accessKey; @Before public void Setup() throws IOException { @@ -57,8 +47,6 @@ public void Setup() throws IOException { accessKey = appContext.getString(R.string.pvTestingAccessKey); } - - @Test public void testPerformance() throws Exception { String iterationString = appContext.getString(R.string.numTestIterations); diff --git a/binding/ios/Cobra-iOS.podspec b/binding/ios/Cobra-iOS.podspec index 5ce02d9f..8db91811 100644 --- a/binding/ios/Cobra-iOS.podspec +++ b/binding/ios/Cobra-iOS.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'Cobra-iOS' s.module_name = 'Cobra' - s.version = '2.0.1' + s.version = '2.0.2' s.license = {:type => 'Apache 2.0'} s.summary = 'iOS binding for Picovoice\'s Cobra voice activity detection (VAD) engine.' s.description = @@ -12,7 +12,7 @@ Pod::Spec.new do |s| DESC s.homepage = 'https://github.com/Picovoice/cobra/tree/master/binding/ios' s.author = { 'Picovoice' => 'hello@picovoice.ai' } - s.source = { :git => "https://github.com/Picovoice/cobra.git", :tag => "Cobra-iOS-v2.0.1" } + s.source = { :git => "https://github.com/Picovoice/cobra.git", :tag => s.version.to_s } s.ios.deployment_target = '13.0' s.swift_version = '5.0' s.vendored_frameworks = 'lib/ios/PvCobra.xcframework' diff --git a/binding/ios/Cobra.swift b/binding/ios/Cobra.swift index 15dc6693..e85a2a00 100644 --- a/binding/ios/Cobra.swift +++ b/binding/ios/Cobra.swift @@ -1,5 +1,5 @@ // -// Copyright 2021-2023 Picovoice Inc. +// Copyright 2021-2024 Picovoice Inc. // You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" // file accompanying this source. // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on @@ -7,6 +7,8 @@ // specific language governing permissions and limitations under the License. // +import Foundation + import PvCobra /// iOS (Swift) binding for Cobra voice activity detection (VAD) engine. It detects speech signals within an incoming diff --git a/binding/ios/CobraAppTest/CobraAppTest.xcodeproj/project.pbxproj b/binding/ios/CobraAppTest/CobraAppTest.xcodeproj/project.pbxproj index 17d8e586..0322bd88 100644 --- a/binding/ios/CobraAppTest/CobraAppTest.xcodeproj/project.pbxproj +++ b/binding/ios/CobraAppTest/CobraAppTest.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -16,10 +16,9 @@ 1E00647D27CEE658006FF6E9 /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = 1E00647C27CEE658006FF6E9 /* sample.wav */; }; 1E5B7AEE2800B2CF00F8BDDB /* PerformanceTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E5B7AED2800B2CF00F8BDDB /* PerformanceTest.swift */; }; 1E5B7AF12800B4A600F8BDDB /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = 1E5B7AF02800B4A600F8BDDB /* sample.wav */; }; - 392C5FC2C59B4299F5FB7D3B /* libPods-CobraAppTestUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B340446EF573C72BC1349E8E /* libPods-CobraAppTestUITests.a */; }; - 50CC58C08AAD59C8922AC105 /* libPods-PerformanceTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C6572CB2CB09D2183B5C6617 /* libPods-PerformanceTest.a */; }; - 6A9164E4B0B1626D27DBA0A1 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; - 837665FCC740E76ED8323395 /* libPods-CobraAppTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FFAEF3E81D2B0623D6C31C0 /* libPods-CobraAppTest.a */; }; + E14CDF492CE4349C00E6494C /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF482CE4349C00E6494C /* Cobra */; }; + E14CDF4B2CE434D700E6494C /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF4A2CE434D700E6494C /* Cobra */; }; + E1CE29CB2CE5173900C4B43A /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E1CE29CA2CE5173900C4B43A /* Cobra */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -40,7 +39,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0402F655F9B10F18A7CE7EE2 /* Pods-PerformanceTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformanceTest.debug.xcconfig"; path = "Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest.debug.xcconfig"; sourceTree = ""; }; 1E00644827CEDF9B006FF6E9 /* CobraAppTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CobraAppTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1E00644B27CEDF9B006FF6E9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 1E00644F27CEDF9B006FF6E9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -56,14 +54,7 @@ 1E5B7AED2800B2CF00F8BDDB /* PerformanceTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PerformanceTest.swift; sourceTree = ""; }; 1E5B7AEF2800B2E300F8BDDB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1E5B7AF02800B4A600F8BDDB /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../../../res/audio/sample.wav; sourceTree = ""; }; - 239D8F7DFD3E66DB68DD74C7 /* Pods-CobraAppTestUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraAppTestUITests.release.xcconfig"; path = "Target Support Files/Pods-CobraAppTestUITests/Pods-CobraAppTestUITests.release.xcconfig"; sourceTree = ""; }; - 2C1B5037B36B1A9C62AE0816 /* Pods-CobraAppTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraAppTest.debug.xcconfig"; path = "Target Support Files/Pods-CobraAppTest/Pods-CobraAppTest.debug.xcconfig"; sourceTree = ""; }; - 7F000751C879143D6999BEC4 /* Pods-CobraAppTestUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraAppTestUITests.debug.xcconfig"; path = "Target Support Files/Pods-CobraAppTestUITests/Pods-CobraAppTestUITests.debug.xcconfig"; sourceTree = ""; }; - 8FFAEF3E81D2B0623D6C31C0 /* libPods-CobraAppTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CobraAppTest.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B340446EF573C72BC1349E8E /* libPods-CobraAppTestUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CobraAppTestUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B9DD6D6C983DB5CCF60FA7F1 /* Pods-PerformanceTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformanceTest.release.xcconfig"; path = "Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest.release.xcconfig"; sourceTree = ""; }; - C6572CB2CB09D2183B5C6617 /* libPods-PerformanceTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PerformanceTest.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - FBAD61DE59260B66EB60F57A /* Pods-CobraAppTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraAppTest.release.xcconfig"; path = "Target Support Files/Pods-CobraAppTest/Pods-CobraAppTest.release.xcconfig"; sourceTree = ""; }; + E1CE29C82CE5173000C4B43A /* cobra */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = cobra; path = ../../..; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -71,7 +62,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 837665FCC740E76ED8323395 /* libPods-CobraAppTest.a in Frameworks */, + E14CDF492CE4349C00E6494C /* Cobra in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,8 +70,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6A9164E4B0B1626D27DBA0A1 /* BuildFile in Frameworks */, - 392C5FC2C59B4299F5FB7D3B /* libPods-CobraAppTestUITests.a in Frameworks */, + E14CDF4B2CE434D700E6494C /* Cobra in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -88,7 +78,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 50CC58C08AAD59C8922AC105 /* libPods-PerformanceTest.a in Frameworks */, + E1CE29CB2CE5173900C4B43A /* Cobra in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -101,9 +91,8 @@ 1E5B7ADD2800B28C00F8BDDB /* PerformanceTest */, 1E00644A27CEDF9B006FF6E9 /* CobraAppTest */, 1E00646B27CEDF9C006FF6E9 /* CobraAppTestUITests */, + E14CDF452CE4349900E6494C /* Frameworks */, 1E00644927CEDF9B006FF6E9 /* Products */, - FA7D97C92E04F06D3273CCF3 /* Pods */, - D7256B2AE1CB33B60277231D /* Frameworks */, ); sourceTree = ""; }; @@ -150,29 +139,14 @@ path = PerformanceTest; sourceTree = ""; }; - D7256B2AE1CB33B60277231D /* Frameworks */ = { + E14CDF452CE4349900E6494C /* Frameworks */ = { isa = PBXGroup; children = ( - 8FFAEF3E81D2B0623D6C31C0 /* libPods-CobraAppTest.a */, - C6572CB2CB09D2183B5C6617 /* libPods-PerformanceTest.a */, - B340446EF573C72BC1349E8E /* libPods-CobraAppTestUITests.a */, + E1CE29C82CE5173000C4B43A /* cobra */, ); name = Frameworks; sourceTree = ""; }; - FA7D97C92E04F06D3273CCF3 /* Pods */ = { - isa = PBXGroup; - children = ( - 2C1B5037B36B1A9C62AE0816 /* Pods-CobraAppTest.debug.xcconfig */, - FBAD61DE59260B66EB60F57A /* Pods-CobraAppTest.release.xcconfig */, - 7F000751C879143D6999BEC4 /* Pods-CobraAppTestUITests.debug.xcconfig */, - 239D8F7DFD3E66DB68DD74C7 /* Pods-CobraAppTestUITests.release.xcconfig */, - 0402F655F9B10F18A7CE7EE2 /* Pods-PerformanceTest.debug.xcconfig */, - B9DD6D6C983DB5CCF60FA7F1 /* Pods-PerformanceTest.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -180,11 +154,9 @@ isa = PBXNativeTarget; buildConfigurationList = 1E00647227CEDF9C006FF6E9 /* Build configuration list for PBXNativeTarget "CobraAppTest" */; buildPhases = ( - EC36C0D4EA212BA0832C79AF /* [CP] Check Pods Manifest.lock */, 1E00644427CEDF9B006FF6E9 /* Sources */, 1E00644527CEDF9B006FF6E9 /* Frameworks */, 1E00644627CEDF9B006FF6E9 /* Resources */, - 676B5C752F03BA675A1EB67A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -199,11 +171,9 @@ isa = PBXNativeTarget; buildConfigurationList = 1E00647827CEDF9C006FF6E9 /* Build configuration list for PBXNativeTarget "CobraAppTestUITests" */; buildPhases = ( - 111DBCFB7BC184413D3B26CE /* [CP] Check Pods Manifest.lock */, 1E00646427CEDF9C006FF6E9 /* Sources */, 1E00646527CEDF9C006FF6E9 /* Frameworks */, 1E00646627CEDF9C006FF6E9 /* Resources */, - 29E6F72AA55D35729B883608 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -219,11 +189,9 @@ isa = PBXNativeTarget; buildConfigurationList = 1E5B7AE92800B29F00F8BDDB /* Build configuration list for PBXNativeTarget "PerformanceTest" */; buildPhases = ( - 1E5B7AE12800B29F00F8BDDB /* [CP] Check Pods Manifest.lock */, 1E5B7AE22800B29F00F8BDDB /* Sources */, 1E5B7AE42800B29F00F8BDDB /* Frameworks */, 1E5B7AE62800B29F00F8BDDB /* Resources */, - 1E5B7AE82800B29F00F8BDDB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -267,6 +235,9 @@ Base, ); mainGroup = 1E00643F27CEDF9B006FF6E9; + packageReferences = ( + E14CDF442CE425EC00E6494C /* XCLocalSwiftPackageReference "../../../../cobra" */, + ); productRefGroup = 1E00644927CEDF9B006FF6E9 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -307,126 +278,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 111DBCFB7BC184413D3B26CE /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CobraAppTestUITests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 1E5B7AE12800B29F00F8BDDB /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PerformanceTest-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 1E5B7AE82800B29F00F8BDDB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 29E6F72AA55D35729B883608 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraAppTestUITests/Pods-CobraAppTestUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraAppTestUITests/Pods-CobraAppTestUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CobraAppTestUITests/Pods-CobraAppTestUITests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 676B5C752F03BA675A1EB67A /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraAppTest/Pods-CobraAppTest-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraAppTest/Pods-CobraAppTest-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CobraAppTest/Pods-CobraAppTest-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - EC36C0D4EA212BA0832C79AF /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CobraAppTest-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 1E00644427CEDF9B006FF6E9 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -604,7 +455,6 @@ }; 1E00647327CEDF9C006FF6E9 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2C1B5037B36B1A9C62AE0816 /* Pods-CobraAppTest.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -633,7 +483,6 @@ }; 1E00647427CEDF9C006FF6E9 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FBAD61DE59260B66EB60F57A /* Pods-CobraAppTest.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -662,7 +511,6 @@ }; 1E00647927CEDF9C006FF6E9 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7F000751C879143D6999BEC4 /* Pods-CobraAppTestUITests.debug.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -685,7 +533,6 @@ }; 1E00647A27CEDF9C006FF6E9 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 239D8F7DFD3E66DB68DD74C7 /* Pods-CobraAppTestUITests.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -708,7 +555,6 @@ }; 1E5B7AEA2800B29F00F8BDDB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0402F655F9B10F18A7CE7EE2 /* Pods-PerformanceTest.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; @@ -733,7 +579,6 @@ }; 1E5B7AEB2800B29F00F8BDDB /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B9DD6D6C983DB5CCF60FA7F1 /* Pods-PerformanceTest.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; @@ -795,6 +640,30 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + E14CDF442CE425EC00E6494C /* XCLocalSwiftPackageReference "../../../../cobra" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../../../cobra; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E14CDF482CE4349C00E6494C /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + package = E14CDF442CE425EC00E6494C /* XCLocalSwiftPackageReference "../../../../cobra" */; + productName = Cobra; + }; + E14CDF4A2CE434D700E6494C /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + package = E14CDF442CE425EC00E6494C /* XCLocalSwiftPackageReference "../../../../cobra" */; + productName = Cobra; + }; + E1CE29CA2CE5173900C4B43A /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + productName = Cobra; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 1E00644027CEDF9B006FF6E9 /* Project object */; } diff --git a/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/contents.xcworkspacedata b/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 66cfc597..00000000 --- a/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/binding/ios/CobraAppTest/CobraAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/binding/ios/CobraAppTest/Podfile b/binding/ios/CobraAppTest/Podfile deleted file mode 100644 index 96ac748e..00000000 --- a/binding/ios/CobraAppTest/Podfile +++ /dev/null @@ -1,14 +0,0 @@ -source 'https://cdn.cocoapods.org/' -platform :ios, '13.0' - -target 'CobraAppTest' do - pod 'Cobra-iOS', '~> 2.0.1' -end - -target 'CobraAppTestUITests' do - pod 'Cobra-iOS', '~> 2.0.1' -end - -target 'PerformanceTest' do - pod 'Cobra-iOS', '~> 2.0.1' -end diff --git a/binding/ios/CobraAppTest/Podfile.lock b/binding/ios/CobraAppTest/Podfile.lock deleted file mode 100644 index 12613f6e..00000000 --- a/binding/ios/CobraAppTest/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - Cobra-iOS (2.0.1) - -DEPENDENCIES: - - Cobra-iOS (~> 2.0.1) - -SPEC REPOS: - trunk: - - Cobra-iOS - -SPEC CHECKSUMS: - Cobra-iOS: 0305d7b8eea41122bdb5f71e4534c523d4d68dac - -PODFILE CHECKSUM: 8d0b35f955399e979896710f3514fccdddb0520e - -COCOAPODS: 1.11.3 diff --git a/binding/ios/CobraErrors.swift b/binding/ios/CobraErrors.swift index dde9ae44..ebc117eb 100644 --- a/binding/ios/CobraErrors.swift +++ b/binding/ios/CobraErrors.swift @@ -1,5 +1,5 @@ // -// Copyright 2021-2023 Picovoice Inc. +// Copyright 2021-2024 Picovoice Inc. // You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" // file accompanying this source. // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on @@ -7,6 +7,8 @@ // specific language governing permissions and limitations under the License. // +import Foundation + public class CobraError: LocalizedError { private let message: String private let messageStack: [String] diff --git a/binding/ios/README.md b/binding/ios/README.md index 75222291..82861a3d 100644 --- a/binding/ios/README.md +++ b/binding/ios/README.md @@ -11,9 +11,16 @@ Cobra is a highly accurate and lightweight voice activity detection (VAD) engine ## Installation -The Cobra iOS binding is available via [Cocoapods](https://cocoapods.org/pods/Cobra-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`: +The Cobra iOS binding is available via [Swift Package Manager](https://www.swift.org/documentation/package-manager/) or [CocoaPods](https://cocoapods.org/pods/Cobra-iOS). +To import the package using SPM, open up your project's Package Dependencies in XCode and add: +``` +https://github.com/Picovoice/cobra.git +``` + +To import it into your iOS project using CocoaPods, add the following line to your Podfile: + ```ruby pod 'Cobra-iOS' ``` @@ -75,7 +82,7 @@ handle.delete() ## Running Unit Tests -Copy your `AccessKey` into the `accessKey` variable in [`CobraAppTestUITests.swift`](CobraAppTest/CobraAppTestUITests/CobraAppTestUITests.swift). Open `CobraAppTest.xcworkspace` with XCode and run the tests with `Product > Test`. +Copy your `AccessKey` into the `accessKey` variable in [`CobraAppTestUITests.swift`](CobraAppTest/CobraAppTestUITests/CobraAppTestUITests.swift). Open [`CobraAppTest.xcodeproj`](CobraAppTest/CobraAppTest.xcodeproj) with XCode and run the tests with `Product > Test`. ## Demo App diff --git a/demo/ios/CobraDemo/CobraDemo.xcodeproj/project.pbxproj b/demo/ios/CobraDemo/CobraDemo.xcodeproj/project.pbxproj index 4955bbaa..b39f2622 100644 --- a/demo/ios/CobraDemo/CobraDemo.xcodeproj/project.pbxproj +++ b/demo/ios/CobraDemo/CobraDemo.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -11,7 +11,10 @@ 02A1194B268D39A700A2AC99 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1194A268D39A700A2AC99 /* ContentView.swift */; }; 02A1194D268D39AB00A2AC99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02A1194C268D39AB00A2AC99 /* Assets.xcassets */; }; 02A1195F268D3FD600A2AC99 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1195E268D3FD600A2AC99 /* ViewModel.swift */; }; - 4A00B7EF2D4C1FA9D1C474E1 /* libPods-CobraDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C8FD0A21A7AA22B5EB1EB2D /* libPods-CobraDemo.a */; }; + E14CDF4E2CE43A7600E6494C /* ios_voice_processor in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF4D2CE43A7600E6494C /* ios_voice_processor */; }; + E14CDF512CE43AB600E6494C /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF502CE43AB600E6494C /* Cobra */; }; + E14CDF592CE43D5F00E6494C /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF582CE43D5F00E6494C /* Cobra */; }; + E14CDF5B2CE43D6600E6494C /* Cobra in Frameworks */ = {isa = PBXBuildFile; productRef = E14CDF5A2CE43D6600E6494C /* Cobra */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -21,12 +24,6 @@ 02A1194C268D39AB00A2AC99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 02A11951268D39AB00A2AC99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 02A1195E268D3FD600A2AC99 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; - 25220F02E797CC78BF7E6619 /* libPods-CobraDemoUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CobraDemoUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 544345CBBDA09211F4620F3E /* Pods-CobraDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraDemo.release.xcconfig"; path = "Target Support Files/Pods-CobraDemo/Pods-CobraDemo.release.xcconfig"; sourceTree = ""; }; - 72F8162D9843C0A1C546BE64 /* Pods-CobraDemoUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraDemoUITests.debug.xcconfig"; path = "Target Support Files/Pods-CobraDemoUITests/Pods-CobraDemoUITests.debug.xcconfig"; sourceTree = ""; }; - 7C8FD0A21A7AA22B5EB1EB2D /* libPods-CobraDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CobraDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 8DC160B174C3E4AE3F56942D /* Pods-CobraDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraDemo.debug.xcconfig"; path = "Target Support Files/Pods-CobraDemo/Pods-CobraDemo.debug.xcconfig"; sourceTree = ""; }; - D2D9DCA10D9D1AB213098AEF /* Pods-CobraDemoUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CobraDemoUITests.release.xcconfig"; path = "Target Support Files/Pods-CobraDemoUITests/Pods-CobraDemoUITests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -34,7 +31,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4A00B7EF2D4C1FA9D1C474E1 /* libPods-CobraDemo.a in Frameworks */, + E14CDF5B2CE43D6600E6494C /* Cobra in Frameworks */, + E14CDF592CE43D5F00E6494C /* Cobra in Frameworks */, + E14CDF512CE43AB600E6494C /* Cobra in Frameworks */, + E14CDF4E2CE43A7600E6494C /* ios_voice_processor in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -46,7 +46,6 @@ children = ( 02A11947268D39A700A2AC99 /* CobraDemo */, 02A11946268D39A700A2AC99 /* Products */, - 02A11957268D39D100A2AC99 /* Frameworks */, 8DB92FF3DC81AB04D3FF7242 /* Pods */, ); sourceTree = ""; @@ -71,22 +70,9 @@ path = CobraDemo; sourceTree = ""; }; - 02A11957268D39D100A2AC99 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7C8FD0A21A7AA22B5EB1EB2D /* libPods-CobraDemo.a */, - 25220F02E797CC78BF7E6619 /* libPods-CobraDemoUITests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; 8DB92FF3DC81AB04D3FF7242 /* Pods */ = { isa = PBXGroup; children = ( - 8DC160B174C3E4AE3F56942D /* Pods-CobraDemo.debug.xcconfig */, - 544345CBBDA09211F4620F3E /* Pods-CobraDemo.release.xcconfig */, - 72F8162D9843C0A1C546BE64 /* Pods-CobraDemoUITests.debug.xcconfig */, - D2D9DCA10D9D1AB213098AEF /* Pods-CobraDemoUITests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -98,11 +84,9 @@ isa = PBXNativeTarget; buildConfigurationList = 02A11954268D39AB00A2AC99 /* Build configuration list for PBXNativeTarget "CobraDemo" */; buildPhases = ( - 9E7C8E83BA330F7017CD5C56 /* [CP] Check Pods Manifest.lock */, 02A11941268D39A700A2AC99 /* Sources */, 02A11942268D39A700A2AC99 /* Frameworks */, 02A11943268D39A700A2AC99 /* Resources */, - B387D574F16D312B6FFB5B42 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -136,6 +120,10 @@ Base, ); mainGroup = 02A1193C268D39A700A2AC99; + packageReferences = ( + E14CDF4C2CE43A7600E6494C /* XCRemoteSwiftPackageReference "ios-voice-processor" */, + E14CDF542CE43B5B00E6494C /* XCLocalSwiftPackageReference "cobra" */, + ); productRefGroup = 02A11946268D39A700A2AC99 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -156,48 +144,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 9E7C8E83BA330F7017CD5C56 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CobraDemo-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - B387D574F16D312B6FFB5B42 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraDemo/Pods-CobraDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-CobraDemo/Pods-CobraDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CobraDemo/Pods-CobraDemo-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 02A11941268D39A700A2AC99 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -330,7 +276,6 @@ }; 02A11955268D39AB00A2AC99 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8DC160B174C3E4AE3F56942D /* Pods-CobraDemo.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -353,7 +298,6 @@ }; 02A11956268D39AB00A2AC99 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 544345CBBDA09211F4620F3E /* Pods-CobraDemo.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -396,6 +340,46 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + E14CDF542CE43B5B00E6494C /* XCLocalSwiftPackageReference "cobra" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../../../cobra; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCRemoteSwiftPackageReference section */ + E14CDF4C2CE43A7600E6494C /* XCRemoteSwiftPackageReference "ios-voice-processor" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Picovoice/ios-voice-processor"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.2.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E14CDF4D2CE43A7600E6494C /* ios_voice_processor */ = { + isa = XCSwiftPackageProductDependency; + package = E14CDF4C2CE43A7600E6494C /* XCRemoteSwiftPackageReference "ios-voice-processor" */; + productName = ios_voice_processor; + }; + E14CDF502CE43AB600E6494C /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + productName = Cobra; + }; + E14CDF582CE43D5F00E6494C /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + package = E14CDF542CE43B5B00E6494C /* XCLocalSwiftPackageReference "cobra" */; + productName = Cobra; + }; + E14CDF5A2CE43D6600E6494C /* Cobra */ = { + isa = XCSwiftPackageProductDependency; + package = E14CDF542CE43B5B00E6494C /* XCLocalSwiftPackageReference "cobra" */; + productName = Cobra; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 02A1193D268D39A700A2AC99 /* Project object */; } diff --git a/demo/ios/CobraDemo/CobraDemo/ViewModel.swift b/demo/ios/CobraDemo/CobraDemo/ViewModel.swift index d0188d71..bb7ac14e 100644 --- a/demo/ios/CobraDemo/CobraDemo/ViewModel.swift +++ b/demo/ios/CobraDemo/CobraDemo/ViewModel.swift @@ -10,6 +10,7 @@ import ios_voice_processor import Cobra import Combine +import Foundation class ViewModel: ObservableObject { diff --git a/demo/ios/CobraDemo/Podfile b/demo/ios/CobraDemo/Podfile deleted file mode 100644 index 3819ef5f..00000000 --- a/demo/ios/CobraDemo/Podfile +++ /dev/null @@ -1,7 +0,0 @@ -source 'https://cdn.cocoapods.org/' -platform :ios, '13.0' - -target 'CobraDemo' do - pod 'Cobra-iOS', '~> 2.0.1' - pod 'ios-voice-processor', '~> 1.1.0' -end diff --git a/demo/ios/CobraDemo/Podfile.lock b/demo/ios/CobraDemo/Podfile.lock deleted file mode 100644 index 50e17bc9..00000000 --- a/demo/ios/CobraDemo/Podfile.lock +++ /dev/null @@ -1,20 +0,0 @@ -PODS: - - Cobra-iOS (2.0.1) - - ios-voice-processor (1.1.0) - -DEPENDENCIES: - - Cobra-iOS (~> 2.0.1) - - ios-voice-processor (~> 1.1.0) - -SPEC REPOS: - trunk: - - Cobra-iOS - - ios-voice-processor - -SPEC CHECKSUMS: - Cobra-iOS: 0305d7b8eea41122bdb5f71e4534c523d4d68dac - ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 - -PODFILE CHECKSUM: 0c39f02ee5dc224f3058e7966192f38d9c78785d - -COCOAPODS: 1.11.3 diff --git a/lib/ios/PvCobra.xcframework/Info.plist b/lib/ios/PvCobra.xcframework/Info.plist index 12b28142..426dec2e 100644 --- a/lib/ios/PvCobra.xcframework/Info.plist +++ b/lib/ios/PvCobra.xcframework/Info.plist @@ -5,31 +5,35 @@ AvailableLibraries + BinaryPath + PvCobra.framework/PvCobra LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath PvCobra.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator + BinaryPath + PvCobra.framework/PvCobra LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath PvCobra.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator CFBundlePackageType diff --git a/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/Info.plist b/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/Info.plist index 8ce18ab0..202ed19b 100644 Binary files a/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/Info.plist and b/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/Info.plist differ diff --git a/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/PvCobra b/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/PvCobra index 04c34521..7be5cb55 100755 Binary files a/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/PvCobra and b/lib/ios/PvCobra.xcframework/ios-arm64/PvCobra.framework/PvCobra differ diff --git a/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/Info.plist b/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/Info.plist index 6c691585..a6227b75 100644 Binary files a/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/Info.plist and b/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/Info.plist differ diff --git a/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/PvCobra b/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/PvCobra index 423498a1..a0e3f4cf 100755 Binary files a/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/PvCobra and b/lib/ios/PvCobra.xcframework/ios-arm64_x86_64-simulator/PvCobra.framework/PvCobra differ diff --git a/res/.lint/spell-check/dict.txt b/res/.lint/spell-check/dict.txt index ac35e73a..b636e366 100644 --- a/res/.lint/spell-check/dict.txt +++ b/res/.lint/spell-check/dict.txt @@ -49,5 +49,8 @@ testapp vtable wargv wavspec +xcframework xcworkspace +xcodeproj +xcuitest wavefile diff --git a/script/automation/browserstack.py b/script/automation/browserstack.py new file mode 100644 index 00000000..933d2538 --- /dev/null +++ b/script/automation/browserstack.py @@ -0,0 +1,131 @@ +import argparse +import requests +import time + +APP_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/app' +TEST_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/test-suite' +BUILD_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/build' +STATUS_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/builds/{}' + +devices_dict = { + 'android-min-max': [ + 'Samsung Galaxy S8-7.0', + 'Samsung Galaxy M52-11.0', + 'Google Pixel 9-15.0' + ], + 'android-perf': [ + 'Google Pixel 6 Pro-15.0' + ], + 'ios-min-max': [ + 'iPhone SE 2020-13', + 'iPhone 14 Pro-16', + 'iPhone 14-18' + ], + 'ios-perf': [ + 'iPhone 13-18', + ] +} + +def main(args: argparse.Namespace) -> None: + app_files = { + 'file': open(args.app_path, 'rb') + } + + app_response = requests.post( + APP_URI.format(args.type), + files=app_files, + auth=(args.username, args.access_key) + ) + app_response_json = app_response.json() + + if not app_response.ok: + print('App Upload Failed', app_response_json) + exit(1) + + test_files = { + 'file': open(args.test_path, 'rb') + } + test_response = requests.post( + TEST_URI.format(args.type), + files=test_files, + auth=(args.username, args.access_key) + ) + test_response_json = test_response.json() + + if not test_response.ok: + print('Test Upload Failed', test_response_json) + exit(1) + + build_headers = { + 'Content-Type': 'application/json' + } + build_data = { + 'app': app_response_json['app_url'], + 'testSuite': test_response_json['test_suite_url'], + 'project': args.project_name, + 'devices': devices_dict[args.devices] + } + + while True: + build_response = requests.post( + BUILD_URI.format(args.type), + headers=build_headers, + json=build_data, + auth=(args.username, args.access_key) + ) + if (build_response is not None and 'message' in build_response.json() and '[BROWSERSTACK_ALL_PARALLELS_IN_USE]' + in build_response.json()['message']): + print('Parallel threads limit reached. Waiting...', flush=True) + time.sleep(60) + else: + break + + if build_response is None: + print('Build Failed') + exit(1) + + build_response_json = build_response.json() + + if not build_response.ok: + print('Build Failed', build_response.json()) + exit(1) + + if build_response_json['message'] != 'Success': + print('Build Unsuccessful') + exit(1) + + print('View build results at https://app-automate.browserstack.com/dashboard/v2/builds/{}'.format(build_response_json['build_id'])) + + while True: + time.sleep(60) + status_response = requests.get( + STATUS_URI.format(args.type, build_response_json['build_id']), + auth=(args.username, args.access_key) + ) + status_response_json = status_response.json() + status = status_response_json['status'] + + if not status_response.ok: + print('Status Request Failed', status_response_json) + exit(1) + + if status != 'queued' and status != 'running': + break + + print('Status:', status) + if status != 'passed': + exit(1) + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--type', choices=['espresso', 'xcuitest'], required=True) + parser.add_argument('--username', required=True) + parser.add_argument('--access_key', required=True) + + parser.add_argument('--project_name', required=True) + parser.add_argument('--devices', choices=devices_dict.keys(), required=True) + parser.add_argument('--app_path', required=True) + parser.add_argument('--test_path', required=True) + args = parser.parse_args() + + main(args)