Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="('$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True')">
<NativeReference Include="$(MSBuildThisFileDirectory)..\..\runtimes\ios\native\onnxruntime.xcframework">
<NativeReference Include="$(MSBuildThisFileDirectory)..\..\runtimes\ios\native\onnxruntime.xcframework.zip">
<Kind>Static</Kind>
<IsCxx>True</IsCxx>
<SmartLink>True</SmartLink>
Expand All @@ -10,4 +10,4 @@
<WeakFrameworks>CoreML</WeakFrameworks>
</NativeReference>
</ItemGroup>
</Project>
</Project>
9 changes: 3 additions & 6 deletions tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,9 @@ stages:
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
tools/ci_build/github/apple/default_full_ios_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)
pushd $(Build.BinariesDirectory)/artifacts_staging
zip -vry $(Build.BinariesDirectory)/artifacts/onnxruntime_xcframework.zip \
onnxruntime-ios-xcframework-$(OnnxRuntimeVersion)
pushd $(Build.BinariesDirectory)/ios_framework/framework_out
zip -vry $(Build.BinariesDirectory)/artifacts/onnxruntime_ios_xcframework.$(OnnxRuntimeVersion).zip \
onnxruntime.xcframework
popd
displayName: "Build Apple xcframework"

Expand Down
20 changes: 19 additions & 1 deletion tools/ci_build/github/windows/extract_nuget_files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ New-Item -Path $nuget_artifacts_dir -ItemType directory

## .zip files
# unzip directly
Get-ChildItem $Env:BUILD_BINARIESDIRECTORY\nuget-artifact -Filter *.zip |
# exclude the iOS xcframework as we need to leave that zipped up to preserve symlinks
Get-ChildItem -Path $Env:BUILD_BINARIESDIRECTORY\nuget-artifact\* -Include *.zip -Exclude onnxruntime_ios_xcframework.*.zip |
Foreach-Object {
$cmd = "7z.exe x $($_.FullName) -y -o$nuget_artifacts_dir"
Write-Output $cmd
Expand All @@ -34,6 +35,23 @@ Foreach-Object {
Invoke-Expression -Command $cmd
}

# process iOS xcframework
$xcframeworks = Get-ChildItem $Env:BUILD_BINARIESDIRECTORY\nuget-artifact -Filter onnxruntime_ios_xcframework.*.zip
if ($xcframeworks.Count -eq 1) {
$xcframework = $xcframeworks[0]
$target_dir = "$nuget_artifacts_dir\onnxruntime-ios-xcframework"
# remove version info from filename and use required filename format
$target_file = "$target_dir\onnxruntime.xcframework.zip"
New-Item -Path $target_dir -ItemType directory

Write-Output "Copy-Item $($xcframework.FullName) $target_file"
Copy-Item $xcframework.FullName $target_file
}
elseif ($xcframeworks.Count -gt 1) {
Write-Error "Expected at most one onnxruntime_ios_xcframework*.zip file but got: [$xcframeworks]"
}


# copy android AAR.
# for full build of onnxruntime Android AAR, there should only be one .aar file
# called onnxruntime-android-x.y.z.aar or onnxruntime-training-android-x.y.z.aar but sanity check that
Expand Down
6 changes: 4 additions & 2 deletions tools/nuget/generate_nuspec_for_native_nuget.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ def generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list, include_pdbs,
if child_file.suffix in [".aar"]:
files_list.append('<file src="' + str(child_file) + '" target="runtimes/android/native"/>')

if child.name == "onnxruntime-ios-xcframework":
files_list.append('<file src="' + str(child) + "\\**" '" target="runtimes/ios/native"/>') # noqa: ISC001
if child.name == "onnxruntime-ios":
for child_file in child.iterdir():
if child_file.suffix in [".zip"]:
files_list.append('<file src="' + str(child_file) + '" target="runtimes/ios/native"/>')


def parse_arguments():
Expand Down