Skip to content

Commit

Permalink
Remove bitcode from iOS and make available on SPM (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Oct 28, 2024
1 parent 5fcb3fa commit 08829fb
Show file tree
Hide file tree
Showing 49 changed files with 835 additions and 1,034 deletions.
32 changes: 2 additions & 30 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,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: Install AppCenter CLI
run: npm install -g appcenter-cli

- name: Make build dir
run: mkdir ddp

- name: Run Cocoapods
run: pod install

- name: Build English
run: xcrun xcodebuild build
-configuration Debug
-workspace PorcupineForegroundAppDemo.xcworkspace
-project PorcupineForegroundAppDemo.xcodeproj
-sdk iphoneos
-scheme _enDemo
-derivedDataPath ddp
Expand All @@ -53,7 +36,7 @@ jobs:
- name: Build Other Language
run: xcrun xcodebuild build
-configuration Debug
-workspace PorcupineForegroundAppDemo.xcworkspace
-project PorcupineForegroundAppDemo.xcodeproj
-sdk iphoneos
-scheme deDemo
-derivedDataPath ddp
Expand All @@ -69,20 +52,9 @@ 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: Install AppCenter CLI
run: npm install -g appcenter-cli

- name: Make build dir
run: mkdir ddp

- name: Run Cocoapods
run: pod install

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/react-native-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# REMOVE
- name: Build binding
run: yarn && yarn pkg
working-directory: binding/react-native

- name: Build binding
run: yarn add ../../binding/react-native/pkg/picovoice-porcupine-react-native-3.0.3.tgz
# REMOVE

- name: Install dependencies
run: yarn android-install

Expand All @@ -60,6 +69,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# REMOVE
- name: Build binding
run: yarn && yarn pkg
working-directory: binding/react-native

- name: Build binding
run: yarn add ../../binding/react-native/pkg/picovoice-porcupine-react-native-3.0.3.tgz
# REMOVE

- name: Install dependencies
run: yarn ios-install

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ _ReSharper.Caches/
build
dist
pvporcupine.egg-info
demo/c/cmake-build-debug/
demo/c/cmake-build-debug/
.build
Package.resolved
.swiftpm
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "binding/unity/VoiceProcessor"]
path = binding/unity/VoiceProcessor
url = ../unity-voice-processor.git
url = https://github.com/Picovoice/unity-voice-processor.git
[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
64 changes: 64 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "Porcupine-iOS",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "Porcupine",
targets: ["Porcupine"]
)
],
dependencies: [
.package(
url: "https://github.com/Picovoice/ios-voice-processor.git",
.upToNextMajor(from: "1.2.0")
)
],
targets: [
.binaryTarget(
name: "PvPorcupine",
path: "lib/ios/PvPorcupine.xcframework"
),
.target(
name: "Porcupine",
dependencies: [
"PvPorcupine",
.product(name: "ios_voice_processor", package: "ios-voice-processor")
],
path: ".",
exclude: [
"binding/ios/PorcupineAppTest",
"binding/flutter",
"binding/react-native",
"binding/unity",
"demo"
],
sources: [
"binding/ios/Porcupine.swift",
"binding/ios/PorcupineErrors.swift",
"binding/ios/PorcupineManager.swift"
],
resources: [
.copy("resources/keyword_files/ios/alexa_ios.ppn"),
.copy("resources/keyword_files/ios/americano_ios.ppn"),
.copy("resources/keyword_files/ios/blueberry_ios.ppn"),
.copy("resources/keyword_files/ios/bumblebee_ios.ppn"),
.copy("resources/keyword_files/ios/computer_ios.ppn"),
.copy("resources/keyword_files/ios/grapefruit_ios.ppn"),
.copy("resources/keyword_files/ios/grasshopper_ios.ppn"),
.copy("resources/keyword_files/ios/hey google_ios.ppn"),
.copy("resources/keyword_files/ios/hey siri_ios.ppn"),
.copy("resources/keyword_files/ios/jarvis_ios.ppn"),
.copy("resources/keyword_files/ios/ok google_ios.ppn"),
.copy("resources/keyword_files/ios/picovoice_ios.ppn"),
.copy("resources/keyword_files/ios/porcupine_ios.ppn"),
.copy("resources/keyword_files/ios/terminator_ios.ppn"),
.copy("lib/common/porcupine_params.pv")
]
)
]
)
5 changes: 4 additions & 1 deletion binding/flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@
* Address locale issue

## [3.0.3] - 2024-02-08
* Additional gradle plugin build support
* Additional gradle plugin build support

## [3.0.4] - 2024-10-28
* Update native packages
4 changes: 2 additions & 2 deletions binding/flutter/ios/porcupine_flutter.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'porcupine_flutter'
s.version = '3.0.3'
s.version = '3.0.4'
s.summary = 'A Flutter package plugin for Picovoice\'s Porcupine wake word engine'
s.description = <<-DESC
A Flutter package plugin for Picovoice\'s Porcupine wake word engine.
Expand All @@ -12,6 +12,6 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.platform = :ios, '13.0'
s.dependency 'Flutter'
s.dependency 'Porcupine-iOS', '~> 3.0.1'
s.dependency 'Porcupine-iOS', '~> 3.0.4'
s.swift_version = '5.0'
end
4 changes: 2 additions & 2 deletions binding/flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ packages:
dependency: "direct main"
description:
name: flutter_voice_processor
sha256: "3c91d8ab34b33016643ae7586a305b81c47c1b66a95b489807c34f127537fcbc"
sha256: "8ae3fc196d6060a13392e4ca557f7a2f4a6b87898ae519787f6929f986538572"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
lints:
dependency: "direct dev"
description:
Expand Down
4 changes: 2 additions & 2 deletions binding/flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: porcupine_flutter
description: A Flutter plugin for Picovoice's Porcupine offline wake word engine.
version: 3.0.3
version: 3.0.4
homepage: https://picovoice.ai/
repository: https://github.com/Picovoice/porcupine/
documentation: https://picovoice.ai/docs/porcupine/
Expand All @@ -14,7 +14,7 @@ dependencies:
flutter:
sdk: flutter

flutter_voice_processor: ^1.1.1
flutter_voice_processor: ^1.1.2

dev_dependencies:
flutter_test:
Expand Down
6 changes: 3 additions & 3 deletions binding/ios/Porcupine-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'Porcupine-iOS'
s.module_name = 'Porcupine'
s.version = '3.0.2'
s.version = '3.0.4'
s.license = {:type => 'Apache 2.0'}
s.summary = 'iOS SDK for Picovoice\'s Porcupine wake word engine'
s.description =
Expand All @@ -22,7 +22,7 @@ Pod::Spec.new do |s|
DESC
s.homepage = 'https://github.com/Picovoice/porcupine/tree/master/binding/ios'
s.author = { 'Picovoice' => '[email protected]' }
s.source = { :git => "https://github.com/Picovoice/porcupine.git", :tag => "Porcupine-iOS-v3.0.2" }
s.source = { :git => "https://github.com/Picovoice/porcupine.git", :tag => s.version.to_s }
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvPorcupine.xcframework'
Expand All @@ -35,5 +35,5 @@ Pod::Spec.new do |s|
s.source_files = 'binding/ios/*.{swift}'
s.exclude_files = 'binding/ios/PorcupineAppTest/**'

s.dependency 'ios-voice-processor', '~> 1.1.1'
s.dependency 'ios-voice-processor', '~> 1.2.0'
end
10 changes: 10 additions & 0 deletions binding/ios/Porcupine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
// specific language governing permissions and limitations under the License.
//

import Foundation

import PvPorcupine

/// Low-level iOS binding for Porcupine wake word engine. Provides a Swift interface to the Porcupine library.
public class Porcupine {

#if SWIFT_PACKAGE

static let resourceBundle = Bundle.module

#else

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

Expand All @@ -25,6 +33,8 @@ public class Porcupine {
return resourceBundle
}()

#endif

public enum BuiltInKeyword: String, CaseIterable {
case alexa = "Alexa"
case americano = "Americano"
Expand Down
14 changes: 0 additions & 14 deletions binding/ios/PorcupineAppTest/Podfile

This file was deleted.

20 changes: 0 additions & 20 deletions binding/ios/PorcupineAppTest/Podfile.lock

This file was deleted.

Loading

0 comments on commit 08829fb

Please sign in to comment.