Add MacOS build to ORT C Pod (#18550)

### Description
<!-- Describe your changes. -->

As title.

1. Add macos build as an optionally enabled arch for pod and changes to
exsiting build_ios_framework/assemble_c_pod scripts.
2. Enable macos build arch in ios packaging pipeline (currently for
variants other than Mobile) and check the output artifacts are correct.
3. Write MacOS Test Target scheme in the test app and integrate into ios
packaging CI testing pipeline.
Currently the changes only apply to onnxruntime-c pod. as the original
request was from ORT SPM which consumes the onnxruntime-c pod only as
the binary target. TODO: could look into adding macos platform to objc
pod as well.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Enable macos platform support in cocoapods. and also potentially produce
binary target for enabling macos platform in SPM as well.

Replace https://github.com/microsoft/onnxruntime/pull/18334

---------

Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
This commit is contained in:
Rachel Guo 2023-11-28 10:11:53 -08:00 committed by GitHub
parent 05046e5452
commit 288b80d363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 1512 additions and 197 deletions

View file

@ -282,11 +282,7 @@ endif()
# Assemble the Apple static framework (iOS and macOS)
if(onnxruntime_BUILD_APPLE_FRAMEWORK)
if(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
set(STATIC_FRAMEWORK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}-${CMAKE_OSX_SYSROOT})
else() # macOS
set(STATIC_FRAMEWORK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
set(STATIC_FRAMEWORK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}-${CMAKE_OSX_SYSROOT})
# Setup the various directories required. Remove any existing ones so we start with a clean directory.
set(STATIC_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/static_libraries)

View file

@ -344,13 +344,13 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
Full build:
```sh
python tools/ci_build/github/apple/build_ios_framework.py tools/ci_build/github/apple/default_full_ios_framework_build_settings.json --config Release
python tools/ci_build/github/apple/build_apple_framework.py tools/ci_build/github/apple/default_full_apple_framework_build_settings.json --config Release
```
Reduced size build:
```sh
python tools/ci_build/github/apple/build_ios_framework.py tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json --config MinSizeRel --include_ops_by_config <required_ops_and_types_for_your_models.config> --enable_reduced_operator_type_support
python tools/ci_build/github/apple/build_apple_framework.py tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json --config MinSizeRel --include_ops_by_config <required_ops_and_types_for_your_models.config> --enable_reduced_operator_type_support
```
The build creates `Headers`, `LICENSE`, and `onnxruntime.xcframework` in `build/iOS_framework/framework_out` directory. From `framework_out` directory, create an archive file named `onnxruntime-c.zip` for a full build or `onnxruntime-mobile-c.zip` for a reduced size build and copy to `<ORT_ROOT>/js/react_native/local_pods` directory.

View file

@ -1,14 +1,34 @@
platform :ios, '13.0'
def include_macos_target
if '@C_POD_NAME@' != 'onnxruntime-mobile-c'
return true
end
return false
end
target 'ios_package_test' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
platform :ios, '13.0'
target 'ios_package_testUITests' do
inherit! :search_paths
pod '@C_POD_NAME@', :podspec => '@C_POD_PODSPEC@'
end
end
if include_macos_target
target 'macos_package_test' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
platform :osx, '11.0'
target 'macos_package_testUITests' do
inherit! :search_paths
pod '@C_POD_NAME@', :podspec => '@C_POD_PODSPEC@'
end
end
end
# This is to prevent the pods to be code signed if enabled

View file

@ -14,6 +14,11 @@
229E595926586B4A006E41AE /* sigmoid.ort in Resources */ = {isa = PBXBuildFile; fileRef = 229E595826586B4A006E41AE /* sigmoid.ort */; };
22C1D8EA271A79FD002CEE67 /* ios_package_uitest_cpp_api.mm in Sources */ = {isa = PBXBuildFile; fileRef = 22C1D8E9271A79FD002CEE67 /* ios_package_uitest_cpp_api.mm */; };
22C1D8EB271A7A06002CEE67 /* sigmoid.ort in Resources */ = {isa = PBXBuildFile; fileRef = 229E595826586B4A006E41AE /* sigmoid.ort */; };
51C316BD2B0881450033C70B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C316BC2B0881450033C70B /* AppDelegate.m */; };
51C316C52B0881480033C70B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 51C316C32B0881480033C70B /* Main.storyboard */; };
51C316C72B0881480033C70B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C316C62B0881480033C70B /* main.m */; };
51C316DC2B0881490033C70B /* macos_package_uitest_cpp_api.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51C316DB2B0881490033C70B /* macos_package_uitest_cpp_api.mm */; };
51C316E82B0892EE0033C70B /* sigmoid.ort in Resources */ = {isa = PBXBuildFile; fileRef = 229E595826586B4A006E41AE /* sigmoid.ort */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -24,6 +29,13 @@
remoteGlobalIDString = 229E591B265869BF006E41AE;
remoteInfo = ios_package_test;
};
51C316D82B0881490033C70B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 229E5914265869BF006E41AE /* Project object */;
proxyType = 1;
remoteGlobalIDString = 51C316B82B0881450033C70B;
remoteInfo = macos_package_test;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@ -37,6 +49,14 @@
229E595826586B4A006E41AE /* sigmoid.ort */ = {isa = PBXFileReference; lastKnownFileType = file; path = sigmoid.ort; sourceTree = "<group>"; };
22C1D8DE271A79AF002CEE67 /* ios_package_testUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ios_package_testUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
22C1D8E9271A79FD002CEE67 /* ios_package_uitest_cpp_api.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ios_package_uitest_cpp_api.mm; sourceTree = "<group>"; };
51C316B92B0881450033C70B /* macos_package_test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = macos_package_test.app; sourceTree = BUILT_PRODUCTS_DIR; };
51C316BB2B0881450033C70B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
51C316BC2B0881450033C70B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
51C316C42B0881480033C70B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
51C316C62B0881480033C70B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
51C316C82B0881480033C70B /* macos_package_test.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macos_package_test.entitlements; sourceTree = "<group>"; };
51C316D72B0881490033C70B /* macos_package_testUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = macos_package_testUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
51C316DB2B0881490033C70B /* macos_package_uitest_cpp_api.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = macos_package_uitest_cpp_api.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -54,6 +74,20 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316B62B0881450033C70B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316D42B0881490033C70B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@ -63,7 +97,10 @@
229E595426586A77006E41AE /* models */,
229E591E265869BF006E41AE /* ios_package_test */,
22C1D8DF271A79AF002CEE67 /* ios_package_testUITests */,
51C316BA2B0881450033C70B /* macos_package_test */,
51C316DA2B0881490033C70B /* macos_package_testUITests */,
229E591D265869BF006E41AE /* Products */,
B49FE29C3625E88EDCCDD4BC /* Pods */,
);
sourceTree = "<group>";
};
@ -72,6 +109,8 @@
children = (
229E591C265869BF006E41AE /* ios_package_test.app */,
22C1D8DE271A79AF002CEE67 /* ios_package_testUITests.xctest */,
51C316B92B0881450033C70B /* macos_package_test.app */,
51C316D72B0881490033C70B /* macos_package_testUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -105,6 +144,33 @@
path = ios_package_testUITests;
sourceTree = "<group>";
};
51C316BA2B0881450033C70B /* macos_package_test */ = {
isa = PBXGroup;
children = (
51C316BB2B0881450033C70B /* AppDelegate.h */,
51C316BC2B0881450033C70B /* AppDelegate.m */,
51C316C32B0881480033C70B /* Main.storyboard */,
51C316C62B0881480033C70B /* main.m */,
51C316C82B0881480033C70B /* macos_package_test.entitlements */,
);
path = macos_package_test;
sourceTree = "<group>";
};
51C316DA2B0881490033C70B /* macos_package_testUITests */ = {
isa = PBXGroup;
children = (
51C316DB2B0881490033C70B /* macos_package_uitest_cpp_api.mm */,
);
path = macos_package_testUITests;
sourceTree = "<group>";
};
B49FE29C3625E88EDCCDD4BC /* Pods */ = {
isa = PBXGroup;
children = (
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -143,6 +209,41 @@
productReference = 22C1D8DE271A79AF002CEE67 /* ios_package_testUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
51C316B82B0881450033C70B /* macos_package_test */ = {
isa = PBXNativeTarget;
buildConfigurationList = 51C316DF2B0881490033C70B /* Build configuration list for PBXNativeTarget "macos_package_test" */;
buildPhases = (
51C316B52B0881450033C70B /* Sources */,
51C316B62B0881450033C70B /* Frameworks */,
51C316B72B0881450033C70B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = macos_package_test;
productName = macos_package_test;
productReference = 51C316B92B0881450033C70B /* macos_package_test.app */;
productType = "com.apple.product-type.application";
};
51C316D62B0881490033C70B /* macos_package_testUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 51C316E52B0881490033C70B /* Build configuration list for PBXNativeTarget "macos_package_testUITests" */;
buildPhases = (
51C316D32B0881490033C70B /* Sources */,
51C316D42B0881490033C70B /* Frameworks */,
51C316D52B0881490033C70B /* Resources */,
);
buildRules = (
);
dependencies = (
51C316D92B0881490033C70B /* PBXTargetDependency */,
);
name = macos_package_testUITests;
productName = macos_package_testUITests;
productReference = 51C316D72B0881490033C70B /* macos_package_testUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@ -158,9 +259,16 @@
CreatedOnToolsVersion = 13.0;
TestTargetID = 229E591B265869BF006E41AE;
};
51C316B82B0881450033C70B = {
CreatedOnToolsVersion = 15.0.1;
};
51C316D62B0881490033C70B = {
CreatedOnToolsVersion = 15.0.1;
TestTargetID = 51C316B82B0881450033C70B;
};
};
};
buildConfigurationList = 229E5917265869BF006E41AE /* Build configuration list for PBXProject "ios_package_test" */;
buildConfigurationList = 229E5917265869BF006E41AE /* Build configuration list for PBXProject "apple_package_test" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
@ -175,6 +283,8 @@
targets = (
229E591B265869BF006E41AE /* ios_package_test */,
22C1D8DD271A79AF002CEE67 /* ios_package_testUITests */,
51C316B82B0881450033C70B /* macos_package_test */,
51C316D62B0881490033C70B /* macos_package_testUITests */,
);
};
/* End PBXProject section */
@ -198,6 +308,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316B72B0881450033C70B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
51C316C52B0881480033C70B /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316D52B0881490033C70B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
51C316E82B0892EE0033C70B /* sigmoid.ort in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -218,6 +344,23 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316B52B0881450033C70B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
51C316C72B0881480033C70B /* main.m in Sources */,
51C316BD2B0881450033C70B /* AppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
51C316D32B0881490033C70B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
51C316DC2B0881490033C70B /* macos_package_uitest_cpp_api.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@ -226,6 +369,11 @@
target = 229E591B265869BF006E41AE /* ios_package_test */;
targetProxy = 22C1D8E4271A79AF002CEE67 /* PBXContainerItemProxy */;
};
51C316D92B0881490033C70B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 51C316B82B0881450033C70B /* macos_package_test */;
targetProxy = 51C316D82B0881490033C70B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@ -245,6 +393,14 @@
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
51C316C32B0881480033C70B /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
51C316C42B0881480033C70B /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@ -300,6 +456,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -353,6 +510,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
@ -365,6 +523,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_test/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -373,7 +532,10 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
@ -382,6 +544,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_test/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -390,7 +553,10 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
@ -398,6 +564,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
@ -420,6 +587,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
@ -438,10 +606,128 @@
};
name = Release;
};
51C316E02B0881490033C70B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = macos_package_test/macos_package_test.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
};
name = Debug;
};
51C316E12B0881490033C70B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = macos_package_test/macos_package_test.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
};
name = Release;
};
51C316E62B0881490033C70B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.MS.macos-package-testUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = NO;
TEST_TARGET_NAME = macos_package_test;
};
name = Debug;
};
51C316E72B0881490033C70B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.MS.macos-package-testUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = NO;
TEST_TARGET_NAME = macos_package_test;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
229E5917265869BF006E41AE /* Build configuration list for PBXProject "ios_package_test" */ = {
229E5917265869BF006E41AE /* Build configuration list for PBXProject "apple_package_test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
229E5949265869C2006E41AE /* Debug */,
@ -468,6 +754,24 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
51C316DF2B0881490033C70B /* Build configuration list for PBXNativeTarget "macos_package_test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
51C316E02B0881490033C70B /* Debug */,
51C316E12B0881490033C70B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
51C316E52B0881490033C70B /* Build configuration list for PBXNativeTarget "macos_package_testUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
51C316E62B0881490033C70B /* Debug */,
51C316E72B0881490033C70B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 229E5914265869BF006E41AE /* Project object */;

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

View file

@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// AppDelegate.h
// macos_package_test
//
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end

View file

@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// AppDelegate.h
// macos_package_test
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
// Insert code here to initialize your application
}
- (void)applicationWillTerminate:(NSNotification*)aNotification {
// Insert code here to tear down your application
}
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app {
return YES;
}
@end

View file

@ -0,0 +1,719 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="macos_package_test" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="macos_package_test" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About macos_package_test" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide macos_package_test" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit macos_package_test" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="bib-Uj-vzu">
<items>
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
<connections>
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
<connections>
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="tXI-mr-wws">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
<items>
<menuItem title="Clear Menu" id="vNY-rz-j42">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
<connections>
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
</connections>
</menuItem>
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
<connections>
<action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
<connections>
<action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
<connections>
<action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
<items>
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
<connections>
<action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
<connections>
<action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
<connections>
<action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
<connections>
<action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
<connections>
<action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
</connections>
</menuItem>
<menuItem title="Delete" id="pa3-QI-u2k">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
<connections>
<action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
<menuItem title="Find" id="4EN-yA-p0u">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="1b7-l0-nxx">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
<connections>
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
<connections>
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
<connections>
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
<connections>
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
<connections>
<action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
<connections>
<action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
<connections>
<action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="9ic-FL-obx">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
<items>
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
</connections>
</menuItem>
<menuItem title="Smart Links" id="cwL-P1-jid">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
</connections>
</menuItem>
<menuItem title="Data Detectors" id="tRr-pd-1PS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="2oI-Rn-ZJC">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
<items>
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="xrE-MZ-jX0">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
<items>
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Format" id="jxT-CU-nIS">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
<items>
<menuItem title="Font" id="Gi5-1S-RQB">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
<connections>
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
<connections>
<action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
<menuItem title="Kern" id="jBQ-r6-VK2">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
<items>
<menuItem title="Use Default" id="GUa-eO-cwY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
</connections>
</menuItem>
<menuItem title="Use None" id="cDB-IK-hbR">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="46P-cB-AYj">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="ogc-rX-tC1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Ligatures" id="o6e-r0-MWq">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
<items>
<menuItem title="Use Default" id="agt-UL-0e3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
</connections>
</menuItem>
<menuItem title="Use None" id="J7y-lM-qPV">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
</connections>
</menuItem>
<menuItem title="Use All" id="xQD-1f-W4t">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Baseline" id="OaQ-X3-Vso">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
<items>
<menuItem title="Use Default" id="3Om-Ey-2VK">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="Rqc-34-cIF">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="I0S-gh-46l">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
</connections>
</menuItem>
<menuItem title="Raise" id="2h7-ER-AoG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
</connections>
</menuItem>
<menuItem title="Lower" id="1tx-W0-xDw">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
<connections>
<action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Text" id="Fal-I4-PZk">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="d9c-me-L2H">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
<connections>
<action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
<connections>
<action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
</connections>
</menuItem>
<menuItem title="Justify" id="J5U-5w-g23">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
<connections>
<action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
<menuItem title="Writing Direction" id="H1b-Si-o9J">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
<items>
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="YGs-j5-SAR">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
</connections>
</menuItem>
<menuItem id="Lbh-J2-qVU">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
</connections>
</menuItem>
<menuItem id="jFq-tB-4Kx">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="Nop-cj-93Q">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
</connections>
</menuItem>
<menuItem id="BgM-ve-c93">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
</connections>
</menuItem>
<menuItem id="RB4-Sm-HuC">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
<menuItem title="Show Ruler" id="vLm-3I-IUL">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="HyV-fh-RgO">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
</connections>
</menuItem>
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
<connections>
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="macos_package_test Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
</connections>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
</view>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
</scenes>
</document>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// AppDelegate.h
// macos_package_test
//
#import <Cocoa/Cocoa.h>
int main(int argc, const char* argv[]) {
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
}
return NSApplicationMain(argc, argv);
}

View file

@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// macos_package_test_cpp_api.mm
// macos_package_test_cpp_api
//
// This file hosts the tests of ORT C++ API
//
#import <XCTest/XCTest.h>
#include <math.h>
#include <onnxruntime/onnxruntime_cxx_api.h>
#if __has_include(<onnxruntime/coreml_provider_factory.h>)
#define COREML_EP_AVAILABLE 1
#else
#define COREML_EP_AVAILABLE 0
#endif
#if COREML_EP_AVAILABLE
#include <onnxruntime/coreml_provider_factory.h>
#endif
void testSigmoid(const char* modelPath, bool useCoreML) {
// This is an e2e test for ORT C++ API
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "testCppAPI");
// initialize session options if needed
Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
#if COREML_EP_AVAILABLE
if (useCoreML) {
const uint32_t flags = COREML_FLAG_USE_CPU_ONLY;
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CoreML(session_options, flags));
}
#else
(void)useCoreML;
#endif
Ort::Session session(env, modelPath, session_options);
size_t input_tensor_size = 3 * 4 * 5;
float input_tensor_values[input_tensor_size];
float expected_output_values[input_tensor_size];
const char* input_node_names[] = {"x"};
const char* output_node_names[] = {"y"};
const int64_t input_node_dims[] = {3, 4, 5};
for (size_t i = 0; i < input_tensor_size; i++) {
input_tensor_values[i] = (float)i - 30;
expected_output_values[i] = 1.0f / (1 + exp(-input_tensor_values[i]));
}
auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
Ort::Value input_tensor =
Ort::Value::CreateTensor<float>(memory_info, input_tensor_values, input_tensor_size, input_node_dims, 3);
XCTAssert(input_tensor.IsTensor());
auto output_tensors = session.Run(Ort::RunOptions{nullptr}, input_node_names,
&input_tensor, 1, output_node_names, 1);
XCTAssertEqual(output_tensors.size(), 1);
XCTAssert(output_tensors.front().IsTensor());
// Get pointer to output tensor float values
float* output_values = output_tensors.front().GetTensorMutableData<float>();
for (size_t i = 0; i < input_tensor_size; i++) {
XCTAssertEqualWithAccuracy(expected_output_values[i], output_values[i], 1e-6);
}
}
@interface macos_package_testUITests : XCTestCase
@end
@implementation macos_package_testUITests
- (void)setUp {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
- (NSString*)getFilePath {
NSBundle* bundle = [NSBundle bundleForClass:[self class]];
NSString* ns_model_path = [bundle pathForResource:@"sigmoid" ofType:@"ort"];
XCTAssertNotNil(ns_model_path);
return ns_model_path;
}
- (void)testCppAPI_Basic {
testSigmoid([self getFilePath].UTF8String, false /* useCoreML */);
}
#if COREML_EP_AVAILABLE
- (void)testCppAPI_Basic_CoreML {
testSigmoid([self getFilePath].UTF8String, true /* useCoreML */);
}
#endif
@end

View file

@ -378,8 +378,9 @@ def parse_arguments():
parser.add_argument("--gdk_platform", default="Scarlett", help="Sets the GDK target platform.")
parser.add_argument("--ios", action="store_true", help="build for ios")
parser.add_argument(
"--ios_sysroot", default="", help="Specify the location name of the macOS platform SDK to be used"
"--apple_sysroot", default="", help="Specify the location name of the macOS platform SDK to be used"
)
parser.add_argument(
"--ios_toolchain_file",
@ -1273,33 +1274,38 @@ def generate_build_tree(
if args.use_snpe:
cmake_args += ["-Donnxruntime_USE_SNPE=ON"]
if args.ios:
if args.build_apple_framework or args.ios:
if not args.cmake_generator == "Xcode":
raise BuildError("iOS build requires use of the Xcode CMake generator ('--cmake_generator Xcode').")
raise BuildError(
"iOS/MacOS framework build requires use of the Xcode CMake generator ('--cmake_generator Xcode')."
)
needed_args = [
args.ios_sysroot,
args.apple_sysroot,
args.apple_deploy_target,
]
arg_names = [
"--ios_sysroot " + "<the location or name of the macOS platform SDK>",
"--apple_sysroot " + "<the location or name of the macOS platform SDK>",
"--apple_deploy_target " + "<the minimum version of the target platform>",
]
if not all(needed_args):
raise BuildError(
"iOS build on MacOS canceled due to missing arguments: "
"iOS/MacOS framework build on MacOS canceled due to missing arguments: "
+ ", ".join(val for val, cond in zip(arg_names, needed_args) if not cond)
)
cmake_args += [
"-DCMAKE_SYSTEM_NAME=iOS",
"-Donnxruntime_BUILD_SHARED_LIB=ON",
"-DCMAKE_OSX_SYSROOT=" + args.ios_sysroot,
"-DCMAKE_OSX_SYSROOT=" + args.apple_sysroot,
"-DCMAKE_OSX_DEPLOYMENT_TARGET=" + args.apple_deploy_target,
# we do not need protoc binary for ios cross build
"-Dprotobuf_BUILD_PROTOC_BINARIES=OFF",
"-DCMAKE_TOOLCHAIN_FILE="
+ (args.ios_toolchain_file if args.ios_toolchain_file else "../cmake/onnxruntime_ios.toolchain.cmake"),
]
if args.ios:
cmake_args += [
"-DCMAKE_SYSTEM_NAME=iOS",
"-DCMAKE_TOOLCHAIN_FILE="
+ (args.ios_toolchain_file if args.ios_toolchain_file else "../cmake/onnxruntime_ios.toolchain.cmake"),
]
if args.build_wasm:
emsdk_dir = os.path.join(cmake_dir, "external", "emsdk")
@ -1761,10 +1767,10 @@ def run_ios_tests(args, source_dir, config, cwd):
)
if args.build_apple_framework:
package_test_py = os.path.join(source_dir, "tools", "ci_build", "github", "apple", "test_ios_packages.py")
package_test_py = os.path.join(source_dir, "tools", "ci_build", "github", "apple", "test_apple_packages.py")
framework_info_file = os.path.join(cwd, "framework_info.json")
dynamic_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot)
static_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot, "static_framework")
dynamic_framework_dir = os.path.join(cwd, config + "-" + args.apple_sysroot)
static_framework_dir = os.path.join(cwd, config + "-" + args.apple_sysroot, "static_framework")
# test dynamic framework
run_subprocess(
[
@ -1774,6 +1780,8 @@ def run_ios_tests(args, source_dir, config, cwd):
dynamic_framework_dir,
"--framework_info_file",
framework_info_file,
"--variant",
"Mobile",
],
cwd=cwd,
)
@ -1786,6 +1794,8 @@ def run_ios_tests(args, source_dir, config, cwd):
static_framework_dir,
"--framework_info_file",
framework_info_file,
"--variant",
"Mobile",
],
cwd=cwd,
)

View file

@ -32,13 +32,13 @@ def parse_args():
parser.add_argument(
"--build-dir",
type=pathlib.Path,
default=REPO_DIR / "build" / "ios_framework",
default=REPO_DIR / "build" / "apple_framework",
help="The build directory. This will contain the iOS framework build output.",
)
parser.add_argument(
"--staging-dir",
type=pathlib.Path,
default=REPO_DIR / "build" / "ios_pod_staging",
default=REPO_DIR / "build" / "apple_pod_staging",
help="The staging directory. This will contain the iOS pod package files. "
"The pod package files do not have dependencies on files in the build directory.",
)
@ -60,20 +60,20 @@ def parse_args():
build_framework_group = parser.add_argument_group(
title="iOS framework build arguments",
description="See the corresponding arguments in build_ios_framework.py for details.",
description="See the corresponding arguments in build_apple_framework.py for details.",
)
build_framework_group.add_argument("--include-ops-by-config")
build_framework_group.add_argument(
"--build-settings-file", required=True, help="The positional argument of build_ios_framework.py."
"--build-settings-file", required=True, help="The positional argument of build_apple_framework.py."
)
build_framework_group.add_argument(
"-b",
"--build-ios-framework-arg",
"--build-apple-framework-arg",
action="append",
dest="build_ios_framework_extra_args",
dest="build_apple_framework_extra_args",
default=[],
help="Pass an argument through to build_ios_framework.py. This may be specified multiple times.",
help="Pass an argument through to build_apple_framework.py. This may be specified multiple times.",
)
args = parser.parse_args()
@ -101,27 +101,27 @@ def main():
# build framework
package_variant = PackageVariant[args.variant]
framework_info_file = build_dir / "framework_info.json"
framework_info_file = build_dir / "xcframework_info.json"
log.info("Building iOS framework.")
log.info("Building Apple framework.")
build_ios_framework_args = [
build_apple_framework_args = [
sys.executable,
str(SCRIPT_DIR / "build_ios_framework.py"),
*args.build_ios_framework_extra_args,
str(SCRIPT_DIR / "build_apple_framework.py"),
*args.build_apple_framework_extra_args,
]
if args.include_ops_by_config is not None:
build_ios_framework_args += ["--include_ops_by_config", args.include_ops_by_config]
build_apple_framework_args += ["--include_ops_by_config", args.include_ops_by_config]
build_ios_framework_args += ["--build_dir", str(build_dir), args.build_settings_file]
build_apple_framework_args += ["--build_dir", str(build_dir), args.build_settings_file]
run(build_ios_framework_args)
run(build_apple_framework_args)
if args.test:
test_ios_packages_args = [
test_apple_packages_args = [
sys.executable,
str(SCRIPT_DIR / "test_ios_packages.py"),
str(SCRIPT_DIR / "test_apple_packages.py"),
"--fail_if_cocoapods_missing",
"--framework_info_file",
str(framework_info_file),
@ -131,7 +131,7 @@ def main():
package_variant.name,
]
run(test_ios_packages_args)
run(test_apple_packages_args)
# assemble pods and then move them to their target locations (staging_dir/<pod_name>)
staging_dir.mkdir(parents=True, exist_ok=True)

View file

@ -30,19 +30,17 @@ def _parse_build_settings(args):
build_settings["build_osx_archs"] = build_settings_data.get("build_osx_archs", DEFAULT_BUILD_OSX_ARCHS)
build_params = []
if "build_params" in build_settings_data:
build_params += build_settings_data["build_params"]
build_settings["build_params"] = build_settings_data["build_params"]
else:
raise ValueError("build_params is required in the build config file")
build_settings["build_params"] = build_params
return build_settings
# Build fat framework for all archs of a single sysroot
# For example, arm64 and x86_64 for iphonesimulator
def _build_for_ios_sysroot(
def _build_for_apple_sysroot(
build_config, intermediates_dir, base_build_command, sysroot, archs, build_dynamic_framework
):
# paths of the onnxruntime libraries for different archs
@ -54,7 +52,7 @@ def _build_for_ios_sysroot(
build_dir_current_arch = os.path.join(intermediates_dir, sysroot + "_" + current_arch)
build_command = [
*base_build_command,
"--ios_sysroot=" + sysroot,
"--apple_sysroot=" + sysroot,
"--osx_arch=" + current_arch,
"--build_dir=" + build_dir_current_arch,
]
@ -103,6 +101,20 @@ def _build_for_ios_sysroot(
return framework_dir
def _merge_framework_info_files(files, output_file):
merged_data = {}
for file in files:
with open(file) as f:
data = json.load(f)
for platform, values in data.items():
assert platform not in merged_data, f"Duplicate platform value: {platform}"
merged_data[platform] = values
with open(output_file, "w") as f:
json.dump(merged_data, f, indent=2)
def _build_package(args):
build_settings = _parse_build_settings(args)
build_dir = os.path.abspath(args.build_dir)
@ -110,20 +122,26 @@ def _build_package(args):
# Temp dirs to hold building results
intermediates_dir = os.path.join(build_dir, "intermediates")
build_config = args.config
base_build_command = [sys.executable, BUILD_PY] + build_settings["build_params"] + ["--config=" + build_config]
if args.include_ops_by_config is not None:
base_build_command += ["--include_ops_by_config=" + str(args.include_ops_by_config.resolve())]
if args.path_to_protoc_exe is not None:
base_build_command += ["--path_to_protoc_exe=" + str(args.path_to_protoc_exe.resolve())]
# build framework for individual sysroot
framework_dirs = []
framework_info_path = ""
framework_info_files_to_merge = []
public_headers_path = ""
for sysroot in build_settings["build_osx_archs"]:
framework_dir = _build_for_ios_sysroot(
base_build_command = (
[sys.executable, BUILD_PY]
+ build_settings["build_params"]["base"]
+ build_settings["build_params"][sysroot]
+ ["--config=" + build_config]
)
if args.include_ops_by_config is not None:
base_build_command += ["--include_ops_by_config=" + str(args.include_ops_by_config.resolve())]
if args.path_to_protoc_exe is not None:
base_build_command += ["--path_to_protoc_exe=" + str(args.path_to_protoc_exe.resolve())]
framework_dir = _build_for_apple_sysroot(
build_config,
intermediates_dir,
base_build_command,
@ -132,17 +150,20 @@ def _build_package(args):
args.build_dynamic_framework,
)
framework_dirs.append(framework_dir)
# podspec and headers for each sysroot are the same, pick one of them
if not framework_info_path:
framework_info_path = os.path.join(os.path.dirname(framework_dir), "framework_info.json")
curr_framework_info_path = os.path.join(os.path.dirname(framework_dir), "framework_info.json")
framework_info_files_to_merge.append(curr_framework_info_path)
# headers for each sysroot are the same, pick one of them
if not public_headers_path:
public_headers_path = os.path.join(os.path.dirname(framework_dir), "onnxruntime.framework", "Headers")
# create the folder for xcframework and copy the LICENSE and podspec file
# create the folder for xcframework and copy the LICENSE and framework_info.json file
xcframework_dir = os.path.join(build_dir, "framework_out")
pathlib.Path(xcframework_dir).mkdir(parents=True, exist_ok=True)
shutil.copy(os.path.join(REPO_DIR, "LICENSE"), xcframework_dir)
shutil.copytree(public_headers_path, os.path.join(xcframework_dir, "Headers"), dirs_exist_ok=True)
shutil.copy(framework_info_path, build_dir)
_merge_framework_info_files(framework_info_files_to_merge, os.path.join(build_dir, "xcframework_info.json"))
# remove existing xcframework if any
xcframework_path = os.path.join(xcframework_dir, "onnxruntime.xcframework")
@ -171,7 +192,7 @@ def parse_args():
parser.add_argument(
"--build_dir",
type=pathlib.Path,
default=os.path.join(REPO_DIR, "build/iOS_framework"),
default=os.path.join(REPO_DIR, "build/apple_framework"),
help="Provide the root directory for build output",
)

View file

@ -28,8 +28,6 @@ def get_pod_config_file(package_variant: PackageVariant):
return _script_dir / "onnxruntime-c.config.json"
elif package_variant == PackageVariant.Mobile:
return _script_dir / "onnxruntime-mobile-c.config.json"
elif package_variant == PackageVariant.Test:
return _script_dir / "onnxruntime-test-c.config.json"
elif package_variant == PackageVariant.Training:
return _script_dir / "onnxruntime-training-c.config.json"
else:
@ -49,7 +47,7 @@ def assemble_c_pod_package(
:param staging_dir Path to the staging directory for the C/C++ pod files.
:param pod_version C/C++ pod version.
:param framework_info_file Path to the framework_info.json file containing additional values for the podspec.
:param framework_info_file Path to the framework_info.json or xcframework_info.json file containing additional values for the podspec.
:param public_headers_dir Path to the public headers directory to include in the pod.
:param framework_dir Path to the onnxruntime framework directory to include in the pod.
:param package_variant The pod package variant.
@ -77,14 +75,16 @@ def assemble_c_pod_package(
# generate the podspec file from the template
variable_substitutions = {
"DESCRIPTION": pod_config["description"],
"IOS_DEPLOYMENT_TARGET": framework_info["IOS_DEPLOYMENT_TARGET"],
# By default, we build both "iphoneos" and "iphonesimulator" architectures, and the deployment target should be the same between these two.
"IOS_DEPLOYMENT_TARGET": framework_info["iphonesimulator"]["APPLE_DEPLOYMENT_TARGET"],
"MACOSX_DEPLOYMENT_TARGET": framework_info.get("macosx", {}).get("APPLE_DEPLOYMENT_TARGET", ""),
"LICENSE_FILE": "LICENSE",
"NAME": pod_name,
"ORT_C_FRAMEWORK": framework_dir.name,
"ORT_C_HEADERS_DIR": public_headers_dir.name,
"SUMMARY": pod_config["summary"],
"VERSION": pod_version,
"WEAK_FRAMEWORK": framework_info["WEAK_FRAMEWORK"],
"WEAK_FRAMEWORK": framework_info["iphonesimulator"]["WEAK_FRAMEWORK"],
}
podspec_template = _script_dir / "c.podspec.template"
@ -114,7 +114,7 @@ def parse_args():
"--framework-info-file",
type=pathlib.Path,
required=True,
help="Path to the framework_info.json file containing additional values for the podspec. "
help="Path to the framework_info.json or xcframework_info.json file containing additional values for the podspec. "
"This file should be generated by CMake in the build directory.",
)
parser.add_argument(

View file

@ -6,7 +6,13 @@ Pod::Spec.new do |spec|
spec.homepage = "https://github.com/microsoft/onnxruntime"
spec.source = { :http => "file:///http_source_placeholder" }
spec.summary = "@SUMMARY@"
spec.platform = :ios, "@IOS_DEPLOYMENT_TARGET@"
spec.ios.deployment_target = "@IOS_DEPLOYMENT_TARGET@"
macosx_deployment_target = "@MACOSX_DEPLOYMENT_TARGET@"
if macosx_deployment_target != ""
spec.osx.deployment_target = macosx_deployment_target
end
spec.vendored_frameworks = "@ORT_C_FRAMEWORK@"
spec.static_framework = true
spec.weak_framework = [ @WEAK_FRAMEWORK@ ]

View file

@ -1,5 +0,0 @@
{
"name": "onnxruntime-test-c",
"summary": "TEST POD",
"description": "Pod for testing. Not for actual release."
}

View file

@ -0,0 +1,37 @@
{
"build_osx_archs": {
"iphoneos": [
"arm64"
],
"iphonesimulator": [
"arm64",
"x86_64"
],
"macosx": [
"arm64",
"x86_64"
]
},
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
],
"macosx": [
"--apple_deploy_target=11.0"
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
]
}
}

View file

@ -1,22 +0,0 @@
{
"build_osx_archs": {
"iphoneos": [
"arm64"
],
"iphonesimulator": [
"arm64",
"x86_64"
]
},
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
"--apple_deploy_target=12.0"
]
}

View file

@ -8,19 +8,27 @@
"x86_64"
]
},
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--minimal_build=extended",
"--disable_rtti",
"--disable_ml_ops",
"--disable_exceptions",
"--enable_reduced_operator_type_support",
"--use_coreml",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
"--apple_deploy_target=12.0"
]
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--minimal_build=extended",
"--disable_rtti",
"--disable_ml_ops",
"--disable_exceptions",
"--enable_reduced_operator_type_support",
"--use_coreml",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
]
}
}

View file

@ -6,18 +6,33 @@
"iphonesimulator": [
"arm64",
"x86_64"
],
"macosx": [
"arm64",
"x86_64"
]
},
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--enable_training_apis",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
"--apple_deploy_target=12.0"
]
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--enable_training_apis",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
],
"macosx": [
"--apple_deploy_target=11.0"
]
}
}

View file

@ -1,4 +1,6 @@
{
"IOS_DEPLOYMENT_TARGET": "@CMAKE_OSX_DEPLOYMENT_TARGET@",
"WEAK_FRAMEWORK": "@APPLE_WEAK_FRAMEWORK@"
}
"@CMAKE_OSX_SYSROOT@": {
"APPLE_DEPLOYMENT_TARGET": "@CMAKE_OSX_DEPLOYMENT_TARGET@",
"WEAK_FRAMEWORK": "@APPLE_WEAK_FRAMEWORK@"
}
}

View file

@ -119,7 +119,7 @@ def assemble_objc_pod_package(
:param staging_dir Path to the staging directory for the Objective-C pod files.
:param pod_version Objective-C pod version.
:param framework_info_file Path to the framework_info.json file containing additional values for the podspec.
:param framework_info_file Path to the framework_info.json or xcframework_info.json file containing additional values for the podspec.
:param package_variant The pod package variant.
:return Tuple of (package name, path to the podspec file).
"""
@ -153,7 +153,7 @@ def assemble_objc_pod_package(
"C_POD_NAME": c_pod_config["name"],
"DESCRIPTION": pod_config["description"],
"INCLUDE_DIR_LIST": path_patterns_as_variable_value(include_dirs),
"IOS_DEPLOYMENT_TARGET": framework_info["IOS_DEPLOYMENT_TARGET"],
"IOS_DEPLOYMENT_TARGET": framework_info["iphonesimulator"]["APPLE_DEPLOYMENT_TARGET"],
"LICENSE_FILE": license_file,
"NAME": pod_name,
"PUBLIC_HEADER_FILE_LIST": path_patterns_as_variable_value(pod_files["public_header_files"]),
@ -191,7 +191,7 @@ def parse_args():
"--framework-info-file",
type=pathlib.Path,
required=True,
help="Path to the framework_info.json file containing additional values for the podspec. "
help="Path to the framework_info.json or xcframework_info.json file containing additional values for the podspec. "
"This file should be generated by CMake in the build directory.",
)
parser.add_argument(

View file

@ -17,7 +17,6 @@ class PackageVariant(enum.Enum):
Full = 0 # full ORT build with all opsets, ops, and types
Mobile = 1 # minimal ORT build with reduced ops
Training = 2 # full ORT build with all opsets, ops, and types, plus training APIs
Test = -1 # for testing purposes only
@classmethod
def release_variant_names(cls):

View file

@ -19,7 +19,7 @@ SCRIPT_PATH = pathlib.Path(__file__).resolve(strict=True)
REPO_DIR = SCRIPT_PATH.parents[4]
def _test_ios_packages(args):
def _test_apple_packages(args):
# check if CocoaPods is installed
if shutil.which("pod") is None:
if args.fail_if_cocoapods_missing:
@ -58,10 +58,10 @@ def _test_ios_packages(args):
os.makedirs(stage_dir)
# assemble the test project here
target_proj_path = stage_dir / "ios_package_test"
target_proj_path = stage_dir / "apple_package_test"
# copy the test project source files to target_proj_path
test_proj_path = pathlib.Path(REPO_DIR, "onnxruntime/test/platform/ios/ios_package_test")
test_proj_path = pathlib.Path(REPO_DIR, "onnxruntime/test/platform/apple/apple_package_test")
shutil.copytree(test_proj_path, target_proj_path)
# assemble local pod files here
@ -133,7 +133,7 @@ def _test_ios_packages(args):
"xcodebuild",
"test",
"-workspace",
"./ios_package_test.xcworkspace",
"./apple_package_test.xcworkspace",
"-scheme",
"ios_package_test",
"-destination",
@ -144,6 +144,24 @@ def _test_ios_packages(args):
cwd=target_proj_path,
)
if PackageVariant[args.variant] != PackageVariant.Mobile:
subprocess.run(
[
"xcrun",
"xcodebuild",
"test",
"-workspace",
"./apple_package_test.xcworkspace",
"-scheme",
"macos_package_test",
"-destination",
"platform=macos",
],
shell=False,
check=True,
cwd=target_proj_path,
)
def parse_args():
parser = argparse.ArgumentParser(
@ -161,7 +179,7 @@ def parse_args():
"--framework_info_file",
type=pathlib.Path,
required=True,
help="Path to the framework_info.json file containing additional values for the podspec. "
help="Path to the framework_info.json or xcframework_info.json file containing additional values for the podspec. "
"This file should be generated by CMake in the build directory.",
)
@ -172,7 +190,7 @@ def parse_args():
parser.add_argument(
"--variant",
choices=PackageVariant.all_variant_names(),
default=PackageVariant.Test.name,
required=True,
help="Pod package variant.",
)
@ -193,7 +211,7 @@ def parse_args():
def main():
args = parse_args()
_test_ios_packages(args)
_test_apple_packages(args)
if __name__ == "__main__":

View file

@ -2,9 +2,9 @@
If you require a custom build of ONNX Runtime, you can create CocoaPods pods with your custom build locally and use them from a Podfile.
**Prerequisite** - The custom build must be able to be done with [build_ios_framework.py](./build_ios_framework.py).
**Prerequisite** - The custom build must be able to be done with [build_apple_framework.py](./build_apple_framework.py).
To do a custom build and create the pods, run [build_and_assemble_ios_pods.py](./build_and_assemble_ios_pods.py).
To do a custom build and create the pods, run [build_and_assemble_apple_pods.py](./build_and_assemble_apple_pods.py).
Use the `--help` argument to see more information.
## Example usage
@ -15,7 +15,7 @@ Our custom build will use a custom reduced operator kernel config file: `/path/t
Run the script:
```bash
python3 tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
python3 tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
--staging-dir /path/to/staging/dir \
--include-ops-by-config /path/to/custom.config \
--build-settings-file tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json

View file

@ -54,7 +54,7 @@ jobs:
--use_coreml \
--use_xnnpack \
--ios \
--ios_sysroot iphonesimulator \
--apple_sysroot iphonesimulator \
--osx_arch x86_64 \
--apple_deploy_target 12.0 \
--use_xcode \

View file

@ -286,14 +286,15 @@ stages:
displayName: "Install Python requirements"
- script: |
python tools/ci_build/github/apple/build_ios_framework.py \
python tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
--build_dynamic_framework \
tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json
displayName: "Build iOS dynamic framework"
- script: |
python tools/ci_build/github/apple/test_ios_packages.py \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/framework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out"
python tools/ci_build/github/apple/test_apple_packages.py \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--variant Mobile
displayName: "Test pod with iOS dynamic framework"

View file

@ -117,32 +117,32 @@ stages:
- script: |
set -e -x
python3 tools/ci_build/github/apple/build_ios_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
python3 tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/apple_framework" \
--path_to_protoc_exe $(Build.BinariesDirectory)/protobuf_install/bin/protoc \
tools/ci_build/github/apple/default_full_ios_framework_build_settings.json
tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
mkdir $(Build.BinariesDirectory)/artifacts
mkdir -p $(Build.BinariesDirectory)/artifacts_staging/onnxruntime-ios-xcframework-$(OnnxRuntimeVersion)
cp -R $(Build.BinariesDirectory)/ios_framework/framework_out/onnxruntime.xcframework \
$(Build.BinariesDirectory)/artifacts_staging/onnxruntime-ios-xcframework-$(OnnxRuntimeVersion)
mkdir -p $(Build.BinariesDirectory)/artifacts_staging/onnxruntime-apple-xcframework-$(OnnxRuntimeVersion)
cp -R $(Build.BinariesDirectory)/apple_framework/framework_out/onnxruntime.xcframework \
$(Build.BinariesDirectory)/artifacts_staging/onnxruntime-apple-xcframework-$(OnnxRuntimeVersion)
pushd $(Build.BinariesDirectory)/artifacts_staging
zip -vr $(Build.BinariesDirectory)/artifacts/onnxruntime_xcframework.zip \
onnxruntime-ios-xcframework-$(OnnxRuntimeVersion)
onnxruntime-apple-xcframework-$(OnnxRuntimeVersion)
popd
displayName: "Build iOS xcframework"
displayName: "Build Apple xcframework"
- script: |
python3 tools/ci_build/github/apple/test_ios_packages.py \
python3 tools/ci_build/github/apple/test_apple_packages.py \
--fail_if_cocoapods_missing \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/framework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--framework_info_file "$(Build.BinariesDirectory)/apple_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/apple_framework/framework_out" \
--variant Full
displayName: "Test iOS framework"
displayName: "Test Apple framework"
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.BinariesDirectory)/artifacts'
artifactName: 'onnxruntime-ios-full-xcframework'
artifactName: 'onnxruntime-apple-full-xcframework'
- template: component-governance-component-detection-steps.yml
parameters:

View file

@ -126,7 +126,7 @@ stages:
BuildStep:
- script: |
set -e -x
python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
--build-dir "$(Build.BinariesDirectory)/ios_framework_full" \
--staging-dir "$(Build.BinariesDirectory)/staging" \
--variant Full \
@ -134,7 +134,7 @@ stages:
-b="--path_to_protoc_exe" -b "$(Build.BinariesDirectory)/installed/bin/protoc"
# Mobile build:
# python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
# python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
# --build_dir $(Build.BinariesDirectory)/ios_framework_mobile \
# --staging-dir "$(Build.BinariesDirectory)/staging" \
# --include_ops_by_config $(Build.SourcesDirectory)/tools/ci_build/github/android/mobile_package.required_operators.config \

View file

@ -29,7 +29,7 @@ stages:
objcPodName: onnxruntime-mobile-objc
${{ if eq(parameters.packageVariant, 'Full') }}:
buildSettingsFile: "tools/ci_build/github/apple/default_full_ios_framework_build_settings.json"
buildSettingsFile: "tools/ci_build/github/apple/default_full_apple_framework_build_settings.json"
cPodName: onnxruntime-c
objcPodName: onnxruntime-objc
@ -38,7 +38,7 @@ stages:
cPodName: onnxruntime-training-c
objcPodName: onnxruntime-training-objc
timeoutInMinutes: 120
timeoutInMinutes: 180
steps:
- script: |
@ -84,8 +84,8 @@ stages:
# create and test mobile pods
- script: |
python tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
--build-dir "$(Build.BinariesDirectory)/ios_framework" \
python tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
--build-dir "$(Build.BinariesDirectory)/apple_framework" \
--staging-dir "$(Build.BinariesDirectory)/staging" \
--pod-version "$(ortPodVersion)" \
--test \
@ -93,13 +93,13 @@ stages:
--build-settings-file "${{ variables.buildSettingsFile }}" \
${{ variables.optionalIncludeOpsByConfigOption }} \
-b="--path_to_protoc_exe=$(Build.BinariesDirectory)/protobuf_install/bin/protoc"
displayName: "Build iOS framework and assemble pod package files"
displayName: "Build macOS/iOS framework and assemble pod package files"
- script: |
python tools/ci_build/github/apple/test_ios_packages.py \
python tools/ci_build/github/apple/test_apple_packages.py \
--fail_if_cocoapods_missing \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/framework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--framework_info_file "$(Build.BinariesDirectory)/apple_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/apple_framework/framework_out" \
--variant ${{ parameters.packageVariant }} \
--test_project_stage_dir "$(Build.BinariesDirectory)/app_center_test" \
--prepare_test_project_only
@ -109,7 +109,7 @@ stages:
inputs:
actions: 'build-for-testing'
configuration: 'Debug'
xcWorkspacePath: '$(Build.BinariesDirectory)/app_center_test/ios_package_test/ios_package_test.xcworkspace'
xcWorkspacePath: '$(Build.BinariesDirectory)/app_center_test/apple_package_test/apple_package_test.xcworkspace'
sdk: 'iphoneos'
scheme: 'ios_package_test'
xcodeVersion: 'specifyPath'
@ -118,8 +118,8 @@ stages:
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileName: 'temporary *' # temporary name, change it back to the original below later
#provisioningProfileName: 'iOS Team Provisioning Profile'
args: '-derivedDataPath $(Build.BinariesDirectory)/app_center_test/ios_package_test/DerivedData'
workingDirectory: '$(Build.BinariesDirectory)/app_center_test/ios_package_test/'
args: '-derivedDataPath $(Build.BinariesDirectory)/app_center_test/apple_package_test/DerivedData'
workingDirectory: '$(Build.BinariesDirectory)/app_center_test/apple_package_test/'
useXcpretty: false # xcpretty can hide useful error output so we will disable it
displayName: 'Build App Center iPhone arm64 tests'
@ -130,7 +130,7 @@ stages:
--devices $(app_center_test_devices) \
--test-series "master" \
--locale "en_US" \
--build-dir $(Build.BinariesDirectory)/app_center_test/ios_package_test/DerivedData/Build/Products/Debug-iphoneos \
--build-dir $(Build.BinariesDirectory)/app_center_test/apple_package_test/DerivedData/Build/Products/Debug-iphoneos \
--token $(app_center_api_token)
displayName: "Run E2E tests on App Center"
@ -139,7 +139,7 @@ stages:
for POD_NAME in "${{ variables.cPodName}}" "${{ variables.objcPodName }}";
do
./tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh \
./tools/ci_build/github/apple/assemble_apple_packaging_artifacts.sh \
"$(Build.BinariesDirectory)/staging" \
"$(Build.ArtifactStagingDirectory)" \
"${POD_NAME}" \

View file

@ -4,13 +4,17 @@
"x86_64"
]
},
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--skip_tests",
"--apple_deploy_target=12.0"
]
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--skip_tests"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
]
}
}

View file

@ -4,18 +4,22 @@
"x86_64"
]
},
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--minimal_build=extended",
"--disable_rtti",
"--disable_ml_ops",
"--disable_exceptions",
"--enable_reduced_operator_type_support",
"--use_coreml",
"--skip_tests",
"--apple_deploy_target=12.0"
]
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--minimal_build=extended",
"--disable_rtti",
"--disable_ml_ops",
"--disable_exceptions",
"--enable_reduced_operator_type_support",
"--use_coreml",
"--skip_tests"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
]
}
}