Skip to content

Commit

Permalink
Remove bitcode from iOS and make available on SPM (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
albho authored Nov 29, 2024
1 parent c071e0e commit 5afe564
Show file tree
Hide file tree
Showing 26 changed files with 187 additions and 461 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ios-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,17 @@ jobs:
- run:
pip3 install requests

- name: Install Cocoapods
run: gem install cocoapods

- name: Make build dir
run: mkdir ddp

- name: Run Cocoapods
run: pod install

- name: Inject AppID
- name: Inject AccessKey
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
KoalaAppTestUITests/KoalaAppTestUITests.swift

- name: XCode Build
run: xcrun xcodebuild build-for-testing
-configuration Debug
-workspace KoalaAppTest.xcworkspace
-project KoalaAppTest.xcodeproj
-sdk iphoneos
-scheme KoalaAppTest
-derivedDataPath ddp
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,10 @@ jobs:
- 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: Make build dir
run: mkdir ddp

- name: Run Cocoapods
run: pod install

- name: Build
run: xcrun xcodebuild build
-configuration Debug
-workspace KoalaDemo.xcworkspace
-project KoalaDemo.xcodeproj
-sdk iphoneos
-scheme KoalaDemo
-derivedDataPath ddp
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/ios-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ jobs:
- run:
pip3 install requests

- name: Install Cocoapods
run: gem install cocoapods

- 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}}:'
PerformanceTest/PerformanceTest.swift
Expand All @@ -67,7 +61,7 @@ jobs:
- name: XCode Build
run: xcrun xcodebuild build-for-testing
-configuration Debug
-workspace KoalaAppTest.xcworkspace
-project KoalaAppTest.xcodeproj
-sdk iphoneos
-scheme PerformanceTest
-derivedDataPath ddp
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.DS_Store
.idea
.idea
.build
Package.resolved
.swiftpm
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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 = ../../Picovoice/pvrecorder.git
url = https://github.com/Picovoice/pvrecorder.git
36 changes: 36 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "Koala-iOS",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "Koala",
targets: ["Koala"]
)
],
targets: [
.binaryTarget(
name: "PvKoala",
path: "lib/ios/PvKoala.xcframework"
),
.target(
name: "Koala",
dependencies: ["PvKoala"],
path: ".",
exclude: [
"binding/ios/KoalaAppTest",
"demo"
],
sources: [
"binding/ios/Koala.swift",
"binding/ios/KoalaErrors.swift"
],
resources: [
.copy("lib/common/koala_params.pv")
]
)
]
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Before building the demo app, run the following from [`KoalaDemo`](./demo/ios/Ko
pod install
```

Open [KoalaDemo.xcworkspace](./demo/ios/KoalaDemo/KoalaDemo.xcworkspace) and run the demo.
Open [KoalaDemo.xcodeproj](./demo/ios/KoalaDemo/KoalaDemo.xcodeproj) and run the demo.


### C Demos
Expand Down
4 changes: 2 additions & 2 deletions binding/ios/Koala-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'Koala-iOS'
s.module_name = 'Koala'
s.version = '2.0.0'
s.version = '2.0.1'
s.license = {:type => 'Apache 2.0'}
s.summary = 'iOS SDK for Picovoice\'s Koala Noise Suppression Engine'
s.description =
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
DESC
s.homepage = 'https://github.com/Picovoice/koala/tree/main/binding/ios'
s.author = { 'Picovoice' => '[email protected]' }
s.source = { :git => "https://github.com/Picovoice/koala.git", :tag => "Koala-iOS-v2.0.0" }
s.source = { :git => "https://github.com/Picovoice/koala.git", :tag => s.version.to_s }
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvKoala.xcframework'
Expand Down
12 changes: 11 additions & 1 deletion binding/ios/Koala.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
//
// Copyright 2023 Picovoice Inc.
// Copyright 2023-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
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
//

import Foundation

import PvKoala

/// iOS binding for Koala Noise Suppression Engine. Provides a Swift interface to the Koala library.
public class Koala {

#if SWIFT_PACKAGE

static let resourceBundle = Bundle.module

#else

static let resourceBundle: Bundle = {
let myBundle = Bundle(for: Koala.self)

Expand All @@ -29,6 +37,8 @@ public class Koala {
return resourceBundle
}()

#endif

private var handle: OpaquePointer?

/// The number of audio samples per frame.
Expand Down
Loading

0 comments on commit 5afe564

Please sign in to comment.