Skip to content

Commit 5afe564

Browse files
authored
Remove bitcode from iOS and make available on SPM (#71)
1 parent c071e0e commit 5afe564

File tree

26 files changed

+187
-461
lines changed

26 files changed

+187
-461
lines changed

.github/workflows/ios-browserstack.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,17 @@ jobs:
3535
- run:
3636
pip3 install requests
3737

38-
- name: Install Cocoapods
39-
run: gem install cocoapods
40-
4138
- name: Make build dir
4239
run: mkdir ddp
4340

44-
- name: Run Cocoapods
45-
run: pod install
46-
47-
- name: Inject AppID
41+
- name: Inject AccessKey
4842
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
4943
KoalaAppTestUITests/KoalaAppTestUITests.swift
5044

5145
- name: XCode Build
5246
run: xcrun xcodebuild build-for-testing
5347
-configuration Debug
54-
-workspace KoalaAppTest.xcworkspace
48+
-project KoalaAppTest.xcodeproj
5549
-sdk iphoneos
5650
-scheme KoalaAppTest
5751
-derivedDataPath ddp

.github/workflows/ios-demos.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,10 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v3
2727

28-
- name: Set up Node.js LTS
29-
uses: actions/setup-node@v3
30-
with:
31-
node-version: lts/*
32-
33-
- name: Install Cocoapods
34-
run: gem install cocoapods
35-
36-
- name: Make build dir
37-
run: mkdir ddp
38-
39-
- name: Run Cocoapods
40-
run: pod install
41-
4228
- name: Build
4329
run: xcrun xcodebuild build
4430
-configuration Debug
45-
-workspace KoalaDemo.xcworkspace
31+
-project KoalaDemo.xcodeproj
4632
-sdk iphoneos
4733
-scheme KoalaDemo
4834
-derivedDataPath ddp

.github/workflows/ios-perf.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ jobs:
4242
- run:
4343
pip3 install requests
4444

45-
- name: Install Cocoapods
46-
run: gem install cocoapods
47-
4845
- name: Make build dir
4946
run: mkdir ddp
5047

51-
- name: Run Cocoapods
52-
run: pod install
53-
5448
- name: Inject AccessKey
5549
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
5650
PerformanceTest/PerformanceTest.swift
@@ -67,7 +61,7 @@ jobs:
6761
- name: XCode Build
6862
run: xcrun xcodebuild build-for-testing
6963
-configuration Debug
70-
-workspace KoalaAppTest.xcworkspace
64+
-project KoalaAppTest.xcodeproj
7165
-sdk iphoneos
7266
-scheme PerformanceTest
7367
-derivedDataPath ddp

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.DS_Store
2-
.idea
2+
.idea
3+
.build
4+
Package.resolved
5+
.swiftpm

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "demo/c/dr_libs"]
22
path = demo/c/dr_libs
3-
url = ../../mackron/dr_libs.git
3+
url = https://github.com/mackron/dr_libs.git
44
[submodule "demo/c/pvrecorder"]
55
path = demo/c/pvrecorder
6-
url = ../../Picovoice/pvrecorder.git
6+
url = https://github.com/Picovoice/pvrecorder.git

Package.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// swift-tools-version:5.3
2+
import PackageDescription
3+
let package = Package(
4+
name: "Koala-iOS",
5+
platforms: [
6+
.iOS(.v13)
7+
],
8+
products: [
9+
.library(
10+
name: "Koala",
11+
targets: ["Koala"]
12+
)
13+
],
14+
targets: [
15+
.binaryTarget(
16+
name: "PvKoala",
17+
path: "lib/ios/PvKoala.xcframework"
18+
),
19+
.target(
20+
name: "Koala",
21+
dependencies: ["PvKoala"],
22+
path: ".",
23+
exclude: [
24+
"binding/ios/KoalaAppTest",
25+
"demo"
26+
],
27+
sources: [
28+
"binding/ios/Koala.swift",
29+
"binding/ios/KoalaErrors.swift"
30+
],
31+
resources: [
32+
.copy("lib/common/koala_params.pv")
33+
]
34+
)
35+
]
36+
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Before building the demo app, run the following from [`KoalaDemo`](./demo/ios/Ko
9292
pod install
9393
```
9494

95-
Open [KoalaDemo.xcworkspace](./demo/ios/KoalaDemo/KoalaDemo.xcworkspace) and run the demo.
95+
Open [KoalaDemo.xcodeproj](./demo/ios/KoalaDemo/KoalaDemo.xcodeproj) and run the demo.
9696

9797

9898
### C Demos

binding/ios/Koala-iOS.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'Koala-iOS'
33
s.module_name = 'Koala'
4-
s.version = '2.0.0'
4+
s.version = '2.0.1'
55
s.license = {:type => 'Apache 2.0'}
66
s.summary = 'iOS SDK for Picovoice\'s Koala Noise Suppression Engine'
77
s.description =
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818
DESC
1919
s.homepage = 'https://github.com/Picovoice/koala/tree/main/binding/ios'
2020
s.author = { 'Picovoice' => 'hello@picovoice.ai' }
21-
s.source = { :git => "https://github.com/Picovoice/koala.git", :tag => "Koala-iOS-v2.0.0" }
21+
s.source = { :git => "https://github.com/Picovoice/koala.git", :tag => s.version.to_s }
2222
s.ios.deployment_target = '13.0'
2323
s.swift_version = '5.0'
2424
s.vendored_frameworks = 'lib/ios/PvKoala.xcframework'

binding/ios/Koala.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
//
2-
// Copyright 2023 Picovoice Inc.
2+
// Copyright 2023-2024 Picovoice Inc.
33
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
44
// file accompanying this source.
55
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
66
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
77
// specific language governing permissions and limitations under the License.
88
//
99

10+
import Foundation
11+
1012
import PvKoala
1113

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

17+
#if SWIFT_PACKAGE
18+
19+
static let resourceBundle = Bundle.module
20+
21+
#else
22+
1523
static let resourceBundle: Bundle = {
1624
let myBundle = Bundle(for: Koala.self)
1725

@@ -29,6 +37,8 @@ public class Koala {
2937
return resourceBundle
3038
}()
3139

40+
#endif
41+
3242
private var handle: OpaquePointer?
3343

3444
/// The number of audio samples per frame.

0 commit comments

Comments
 (0)