update comments, variable names, increase min ios version to 13.

This commit is contained in:
edgchen1
2024-08-19 11:12:07 -07:00
parent 68c6912edf
commit 88bd5af009
3 changed files with 27 additions and 28 deletions
@@ -49,7 +49,7 @@
cd "$(Build.SourcesDirectory)" cd "$(Build.SourcesDirectory)"
cp "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}" swift/ cp "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}" swift/
export ORT_IOS_POD_LOCAL_PATH="swift/${POD_ARCHIVE}" export ORT_POD_LOCAL_PATH="swift/${POD_ARCHIVE}"
xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14' xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14'
xcodebuild test -scheme onnxruntime-Package -destination 'platform=macosx' xcodebuild test -scheme onnxruntime-Package -destination 'platform=macosx'
@@ -83,9 +83,9 @@
cp -r "$(Build.SourcesDirectory)/extensions" . cp -r "$(Build.SourcesDirectory)/extensions" .
cp "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}" swift/ cp "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}" swift/
export ORT_IOS_POD_LOCAL_PATH="swift/${POD_ARCHIVE}" export ORT_POD_LOCAL_PATH="swift/${POD_ARCHIVE}"
cp "$(Build.ArtifactStagingDirectory)/$(artifactsNameForExt)/${POD_ARCHIVE_EXT}" swift/ cp "$(Build.ArtifactStagingDirectory)/$(artifactsNameForExt)/${POD_ARCHIVE_EXT}" swift/
export ORT_EXTENSIONS_IOS_POD_LOCAL_PATH="swift/${POD_ARCHIVE_EXT}" export ORT_EXTENSIONS_POD_LOCAL_PATH="swift/${POD_ARCHIVE_EXT}"
xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14' xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14'
+18 -19
View File
@@ -6,13 +6,14 @@
// Licensed under the MIT License. // Licensed under the MIT License.
// //
// A user of the Swift Package Manager (SPM) package will consume this file directly from the ORT SPM github repository. // A user of the Swift Package Manager (SPM) package will consume this file directly from the ORT SPM github repository.
// For context, the end user's config will look something like: // For example, the end user's config will look something like:
// //
// dependencies: [ // dependencies: [
// .package(url: "https://github.com/microsoft/onnxruntime-swift-package-manager", from: "1.16.0"), // .package(url: "https://github.com/microsoft/onnxruntime-swift-package-manager", from: "1.16.0"),
// ... // ...
// ], // ],
// NOTE: For specifying valid and latest release version above, please refer to this page: //
// NOTE: For valid version numbers, please refer to this page:
// https://github.com/microsoft/onnxruntime-swift-package-manager/releases // https://github.com/microsoft/onnxruntime-swift-package-manager/releases
import PackageDescription import PackageDescription
@@ -20,7 +21,7 @@ import class Foundation.ProcessInfo
let package = Package( let package = Package(
name: "onnxruntime", name: "onnxruntime",
platforms: [.iOS(.v12), platforms: [.iOS(.v13),
.macOS(.v11)], .macOS(.v11)],
products: [ products: [
.library(name: "onnxruntime", .library(name: "onnxruntime",
@@ -68,30 +69,28 @@ let package = Package(
cxxLanguageStandard: .cxx17 cxxLanguageStandard: .cxx17
) )
// Add the ORT iOS Pod archive as a binary target. // Add the ORT CocoaPods C/C++ pod archive as a binary target.
// //
// There are 2 scenarios: // There are 2 scenarios:
// - Target will be set to a released pod archive and its checksum.
// //
// Release version of ORT SPM github repo: // - Target will be set to a local pod archive.
// Target will be set to the latest released ORT iOS pod archive and its checksum. // This can be used to test with the latest (not yet released) ORT Objective-C source code.
//
// Current main of ORT SPM github repo:
// Target will be set to the pod archive built in sync with the current main objective-c source code.
// CI or local testing where you have built/obtained the iOS Pod archive matching the current source code. // CI or local testing where you have built/obtained the pod archive matching the current source code.
// Requires the ORT_IOS_POD_LOCAL_PATH environment variable to be set to specify the location of the pod. // Requires the ORT_POD_LOCAL_PATH environment variable to be set to specify the location of the pod.
if let pod_archive_path = ProcessInfo.processInfo.environment["ORT_IOS_POD_LOCAL_PATH"] { if let pod_archive_path = ProcessInfo.processInfo.environment["ORT_POD_LOCAL_PATH"] {
// ORT_IOS_POD_LOCAL_PATH MUST be a path that is relative to Package.swift. // ORT_POD_LOCAL_PATH MUST be a path that is relative to Package.swift.
// //
// To build locally, tools/ci_build/github/apple/build_and_assemble_ios_pods.py can be used // To build locally, tools/ci_build/github/apple/build_and_assemble_apple_pods.py can be used
// See https://onnxruntime.ai/docs/build/custom.html#ios // See https://onnxruntime.ai/docs/build/custom.html#ios
// Example command: // Example command:
// python3 tools/ci_build/github/apple/build_and_assemble_ios_pods.py \ // python tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
// --variant Full \ // --variant Full \
// --build-settings-file tools/ci_build/github/apple/default_full_ios_framework_build_settings.json // --build-settings-file tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
// //
// This should produce the pod archive in build/ios_pod_staging, and ORT_IOS_POD_LOCAL_PATH can be set to // This should produce the pod archive in build/apple_pod_staging, and ORT_POD_LOCAL_PATH can be set to
// "build/ios_pod_staging/pod-archive-onnxruntime-c-???.zip" where '???' is replaced by the version info in the // "build/apple_pod_staging/pod-archive-onnxruntime-c-???.zip" where '???' is replaced by the version info in the
// actual filename. // actual filename.
package.targets.append(Target.binaryTarget(name: "onnxruntime", path: pod_archive_path)) package.targets.append(Target.binaryTarget(name: "onnxruntime", path: pod_archive_path))
@@ -104,7 +103,7 @@ if let pod_archive_path = ProcessInfo.processInfo.environment["ORT_IOS_POD_LOCAL
) )
} }
if let ext_pod_archive_path = ProcessInfo.processInfo.environment["ORT_EXTENSIONS_IOS_POD_LOCAL_PATH"] { if let ext_pod_archive_path = ProcessInfo.processInfo.environment["ORT_EXTENSIONS_POD_LOCAL_PATH"] {
package.targets.append(Target.binaryTarget(name: "onnxruntime_extensions", path: ext_pod_archive_path)) package.targets.append(Target.binaryTarget(name: "onnxruntime_extensions", path: ext_pod_archive_path))
} else { } else {
// ORT Extensions 0.11.0 release // ORT Extensions 0.11.0 release