diff --git a/native_client/swift/deepspeech_ios.xcworkspace/contents.xcworkspacedata b/native_client/swift/deepspeech_ios.xcworkspace/contents.xcworkspacedata index 73975e36..8aec54f0 100644 --- a/native_client/swift/deepspeech_ios.xcworkspace/contents.xcworkspacedata +++ b/native_client/swift/deepspeech_ios.xcworkspace/contents.xcworkspacedata @@ -5,6 +5,6 @@ location = "group:deepspeech_ios.xcodeproj"> + location = "group:deepspeech_ios_test.xcodeproj"> diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.pbxproj b/native_client/swift/deepspeech_ios_test.xcodeproj/project.pbxproj similarity index 99% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.pbxproj rename to native_client/swift/deepspeech_ios_test.xcodeproj/project.pbxproj index e9a7d0a2..eadc4fae 100644 --- a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.pbxproj +++ b/native_client/swift/deepspeech_ios_test.xcodeproj/project.pbxproj @@ -53,7 +53,7 @@ /* Begin PBXFileReference section */ 507CD3A024B61FE400409BBB /* deepspeech_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = deepspeech_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 507CD3A224B61FEA00409BBB /* libdeepspeech.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libdeepspeech.so; path = ../libdeepspeech.so; sourceTree = ""; }; + 507CD3A224B61FEA00409BBB /* libdeepspeech.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libdeepspeech.so; path = libdeepspeech.so; sourceTree = ""; }; 50F787EF2497683900D52237 /* deepspeech_ios_test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = deepspeech_ios_test.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50F787F22497683900D52237 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50F787F42497683900D52237 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/native_client/swift/deepspeech_ios_test.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to native_client/swift/deepspeech_ios_test.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/native_client/swift/deepspeech_ios_test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to native_client/swift/deepspeech_ios_test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/xcshareddata/xcschemes/deepspeech_ios_test.xcscheme b/native_client/swift/deepspeech_ios_test.xcodeproj/xcshareddata/xcschemes/deepspeech_ios_test.xcscheme similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test.xcodeproj/xcshareddata/xcschemes/deepspeech_ios_test.xcscheme rename to native_client/swift/deepspeech_ios_test.xcodeproj/xcshareddata/xcschemes/deepspeech_ios_test.xcscheme diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/AppDelegate.swift b/native_client/swift/deepspeech_ios_test/AppDelegate.swift similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/AppDelegate.swift rename to native_client/swift/deepspeech_ios_test/AppDelegate.swift diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Assets.xcassets/AppIcon.appiconset/Contents.json b/native_client/swift/deepspeech_ios_test/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Assets.xcassets/AppIcon.appiconset/Contents.json rename to native_client/swift/deepspeech_ios_test/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Assets.xcassets/Contents.json b/native_client/swift/deepspeech_ios_test/Assets.xcassets/Contents.json similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Assets.xcassets/Contents.json rename to native_client/swift/deepspeech_ios_test/Assets.xcassets/Contents.json diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Base.lproj/LaunchScreen.storyboard b/native_client/swift/deepspeech_ios_test/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Base.lproj/LaunchScreen.storyboard rename to native_client/swift/deepspeech_ios_test/Base.lproj/LaunchScreen.storyboard diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/ContentView.swift b/native_client/swift/deepspeech_ios_test/ContentView.swift similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/ContentView.swift rename to native_client/swift/deepspeech_ios_test/ContentView.swift diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Info.plist b/native_client/swift/deepspeech_ios_test/Info.plist similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Info.plist rename to native_client/swift/deepspeech_ios_test/Info.plist diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Preview Content/Preview Assets.xcassets/Contents.json b/native_client/swift/deepspeech_ios_test/Preview Content/Preview Assets.xcassets/Contents.json similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/Preview Content/Preview Assets.xcassets/Contents.json rename to native_client/swift/deepspeech_ios_test/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_test/SceneDelegate.swift b/native_client/swift/deepspeech_ios_test/SceneDelegate.swift similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_test/SceneDelegate.swift rename to native_client/swift/deepspeech_ios_test/SceneDelegate.swift diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_testTests/Info.plist b/native_client/swift/deepspeech_ios_testTests/Info.plist similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_testTests/Info.plist rename to native_client/swift/deepspeech_ios_testTests/Info.plist diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_testTests/deepspeech_ios_testTests.swift b/native_client/swift/deepspeech_ios_testTests/deepspeech_ios_testTests.swift similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_testTests/deepspeech_ios_testTests.swift rename to native_client/swift/deepspeech_ios_testTests/deepspeech_ios_testTests.swift diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_testUITests/Info.plist b/native_client/swift/deepspeech_ios_testUITests/Info.plist similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_testUITests/Info.plist rename to native_client/swift/deepspeech_ios_testUITests/Info.plist diff --git a/native_client/swift/deepspeech_ios_test/deepspeech_ios_testUITests/deepspeech_ios_testUITests.swift b/native_client/swift/deepspeech_ios_testUITests/deepspeech_ios_testUITests.swift similarity index 100% rename from native_client/swift/deepspeech_ios_test/deepspeech_ios_testUITests/deepspeech_ios_testUITests.swift rename to native_client/swift/deepspeech_ios_testUITests/deepspeech_ios_testUITests.swift diff --git a/taskcluster/ios-arm64-tflite-opt.yml b/taskcluster/ios-arm64-tflite-opt.yml index cd85ca7f..0d8da19b 100644 --- a/taskcluster/ios-arm64-tflite-opt.yml +++ b/taskcluster/ios-arm64-tflite-opt.yml @@ -13,7 +13,7 @@ build: tensorflow: ${system.tensorflow.ios_arm64.url} scripts: build: "taskcluster/ios-build.sh --arm64" - package: "taskcluster/package.sh" + package: "taskcluster/ios-package.sh --arm64" nc_asset_name: "native_client.arm64.tflite.ios.tar.xz" maxRunTime: 14400 metadata: diff --git a/taskcluster/ios-build.sh b/taskcluster/ios-build.sh index ed99cb60..282f8c32 100755 --- a/taskcluster/ios-build.sh +++ b/taskcluster/ios-build.sh @@ -2,7 +2,7 @@ set -xe -platform=$1 +arch=$1 source $(dirname "$0")/tc-tests-utils.sh @@ -12,7 +12,7 @@ BAZEL_TARGETS=" //native_client:libdeepspeech.so " -if [ "${platform}" = "--arm64" ]; then +if [ "${arch}" = "--arm64" ]; then BAZEL_BUILD_FLAGS="${BAZEL_IOS_ARM64_FLAGS}" else BAZEL_BUILD_FLAGS="${BAZEL_IOS_X86_64_FLAGS}" @@ -21,3 +21,5 @@ fi BAZEL_ENV_FLAGS="TF_NEED_CUDA=0" do_bazel_build + +do_deepspeech_ios_framework_build "${arch}" diff --git a/taskcluster/ios-package.sh b/taskcluster/ios-package.sh new file mode 100755 index 00000000..16cc9f96 --- /dev/null +++ b/taskcluster/ios-package.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -xe + +arch=$1 + +source $(dirname "$0")/tc-tests-utils.sh + +mkdir -p ${TASKCLUSTER_ARTIFACTS} || true + +cp ${DS_ROOT_TASK}/DeepSpeech/ds/tensorflow/bazel*.log ${TASKCLUSTER_ARTIFACTS}/ + +package_native_client "native_client.tar.xz" + +package_libdeepspeech_as_zip "libdeepspeech.zip" + +case $arch in +"--x86_64") + release_folder="Release-iphonesimulator" + artifact_name="deepspeech_ios.framework.x86_64.tar.xz" + ;; +"--arm64") + release_folder="Release-iphoneos" + artifact_name="deepspeech_ios.framework.arm64.tar.xz" +;; +esac + +${TAR} -cf - \ + -C ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/swift/DerivedData/Build/Products/${release_folder}/ deepspeech_ios.framework \ + | ${XZ} > "${TASKCLUSTER_ARTIFACTS}/${artifact_name}" \ No newline at end of file diff --git a/taskcluster/ios-x86_64-tflite-opt.yml b/taskcluster/ios-x86_64-tflite-opt.yml index b55cebe7..22acb435 100644 --- a/taskcluster/ios-x86_64-tflite-opt.yml +++ b/taskcluster/ios-x86_64-tflite-opt.yml @@ -13,7 +13,7 @@ build: tensorflow: ${system.tensorflow.ios_x86_64.url} scripts: build: "taskcluster/ios-build.sh --x86_64" - package: "taskcluster/package.sh" + package: "taskcluster/ios-package.sh --x86_64" nc_asset_name: "native_client.x86_64.tflite.ios.tar.xz" maxRunTime: 14400 metadata: diff --git a/taskcluster/scriptworker-task-github.yml b/taskcluster/scriptworker-task-github.yml index 3003baad..f740a39d 100644 --- a/taskcluster/scriptworker-task-github.yml +++ b/taskcluster/scriptworker-task-github.yml @@ -20,6 +20,8 @@ build: - "win-amd64-cpu-opt" - "win-amd64-gpu-opt" - "win-amd64-ctc-opt" + - "ios-x86_64-tflite-opt" + - "ios-arm64-tflite-opt" allowed: - "tag" ref_match: "refs/tags/" @@ -66,6 +68,9 @@ build: - "win-amd64-cpu-opt" - "win-amd64-gpu-opt" - "win-amd64-tflite-opt" + ios: + - "ios-x86_64-tflite-opt" + - "ios-arm64-tflite-opt" metadata: name: "DeepSpeech GitHub Packages" description: "Trigger Uploading of DeepSpeech Packages to GitHub release page" diff --git a/taskcluster/tc-build-utils.sh b/taskcluster/tc-build-utils.sh index 4088a7ce..ea592dc0 100755 --- a/taskcluster/tc-build-utils.sh +++ b/taskcluster/tc-build-utils.sh @@ -325,3 +325,21 @@ do_nuget_build() nuget pack nupkg/deepspeech.nuspec } + +do_deepspeech_ios_framework_build() +{ + arch=$1 + cp ${DS_TFDIR}/bazel-bin/native_client/libdeepspeech.so ${DS_DSDIR}/native_client/swift/libdeepspeech.so + cd ${DS_DSDIR}/native_client/swift + case $arch in + "--x86_64") + iosSDK="iphonesimulator" + xcodeArch="x86_64" + ;; + "--arm64") + iosSDK="iphoneos" + xcodeArch="arm64" + ;; + esac + xcodebuild -workspace deepspeech_ios.xcworkspace -scheme deepspeech_ios_test -configuration Release -arch "${xcodeArch}" -sdk "${iosSDK}" -derivedDataPath DerivedData CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO +}