Add store builds to nuget packaging (#5040)

* Nuget store packaging

* Move DNNL workaround to EP

* Fix warning as error

* Disable store tests

* Skip store tests

* msbuild target

* Cross compile protoc in Store

* Disable DML in store

* Move store builds to CPU queue

* Copy uap10 to final nuget

* Fix pip8 error

* Remove extra dml copies

* Fix argparse

* pep8

* Forward IsStoreBuild

* Apply is_store_build to duplicate generate_nuspec

* runtimes

* Refactor uap10

* Store .NET

* uap

* PR feedback
This commit is contained in:
Tiago Koji Castro Shibata 2020-09-09 21:38:14 -07:00 committed by GitHub
parent 9ba56dcfed
commit 62848c4de5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 291 additions and 128 deletions

View file

@ -18,6 +18,7 @@ CMake creates a target to this project
<IsReleaseBuild Condition=" '$(IsReleaseBuild)' == '' ">false</IsReleaseBuild>
<IsLinuxBuild Condition=" '$(IsLinuxBuild)' == '' ">false</IsLinuxBuild>
<ExecutionProvider Condition=" '$(ExecutionProvider)' == '' ">None</ExecutionProvider>
<IsStoreBuild Condition=" '$(IsStoreBuild)' == '' ">false</IsStoreBuild>
<!--internal build related properties-->
<OnnxRuntimeSourceDirectory Condition="'$(OnnxRuntimeSourceDirectory)'==''">..</OnnxRuntimeSourceDirectory>
@ -125,7 +126,7 @@ CMake creates a target to this project
Properties="NoBuild=true;Platform=AnyCPU;PackageVersion=$(PackageVersion);OrtPackageId=$(OrtPackageId)"/>
<Message Importance="High" Text="Generating nuspec for the native Nuget package ..." />
<Exec ContinueOnError="False" Command="python $(GenerateNuspecScript) --package_version $(PackageVersion) --package_name $(OrtPackageId) --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --packages_path $(OnnxRuntimePackagesDirectoryAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild) --execution_provider $(ExecutionProvider)" ConsoleToMSBuild="true">
<Exec ContinueOnError="False" Command="python $(GenerateNuspecScript) --package_version $(PackageVersion) --package_name $(OrtPackageId) --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --packages_path $(OnnxRuntimePackagesDirectoryAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild) --execution_provider $(ExecutionProvider) --is_store_build $(IsStoreBuild)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GenerateNuspecOutput" />
</Exec>
@ -148,7 +149,7 @@ CMake creates a target to this project
<Copy SourceFiles="@(LicenseFile)" DestinationFiles="@(LicenseFile->'$(OnnxRuntimeSourceDirectory)\%(Filename).txt')"/>
<Message Importance="High" Text="Generating nuspec for the Microsoft.AI.MachineLearning Nuget package ..." />
<Exec ContinueOnError="False" Command="python ..\tools\nuget\generate_nuspec_for_native_nuget.py --package_version $(PackageVersion) --package_name Microsoft.AI.MachineLearning --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --packages_path $(OnnxRuntimePackagesDirectoryAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild)" ConsoleToMSBuild="true">
<Exec ContinueOnError="False" Command="python ..\tools\nuget\generate_nuspec_for_native_nuget.py --package_version $(PackageVersion) --package_name Microsoft.AI.MachineLearning --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --packages_path $(OnnxRuntimePackagesDirectoryAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild) --is_store_build $(IsStoreBuild)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GenerateNuspecOutput" />
</Exec>

View file

@ -9,9 +9,11 @@
</PropertyGroup>
<PropertyGroup>
<WindowsAIBinary>$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\Microsoft.AI.MachineLearning.dll</WindowsAIBinary>
<OnnxRuntimeBinary>$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\onnxruntime.dll</OnnxRuntimeBinary>
<DirectMLBinary>$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\directml.dll</DirectMLBinary>
<RuntimesDirectory Condition="'$(OutputType)' == 'AppContainerExe'">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\uap</RuntimesDirectory>
<RuntimesDirectory Condition="'$(RuntimesDirectory)' == ''">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native</RuntimesDirectory>
<WindowsAIBinary>$(RuntimesDirectory)\Microsoft.AI.MachineLearning.dll</WindowsAIBinary>
<OnnxRuntimeBinary>$(RuntimesDirectory)\onnxruntime.dll</OnnxRuntimeBinary>
<DirectMLBinary>$(RuntimesDirectory)\directml.dll</DirectMLBinary>
</PropertyGroup>
<PropertyGroup>
@ -20,7 +22,7 @@
<PropertyGroup Condition="'$(WindowsAI-Platform)' == x64 OR '$(WindowsAI-Platform)' == x86">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary);$(DirectMLBinary)</MLBinaries>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsAI-Platform)' == arm OR '$(WindowsAI-Platform)' == arm64">
<PropertyGroup Condition="'$(OutputType)' == 'AppContainerExe' OR '$(WindowsAI-Platform)' == arm OR '$(WindowsAI-Platform)' == arm64">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary)</MLBinaries>
</PropertyGroup>

View file

@ -6,19 +6,20 @@
</PropertyGroup>
<PropertyGroup>
<WindowsAIBinary>$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\Microsoft.AI.MachineLearning.dll</WindowsAIBinary>
</PropertyGroup>
<RuntimesDirectory Condition="'$(OutputType)' == 'AppContainerExe'">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\uap</RuntimesDirectory>
<RuntimesDirectory Condition="'$(RuntimesDirectory)' == ''">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native</RuntimesDirectory>
<WindowsAIBinary>$(RuntimesDirectory)\Microsoft.AI.MachineLearning.dll</WindowsAIBinary>
<PropertyGroup>
<OnnxRuntimeBinary Condition="'$(OnnxRuntimePathOverride)' != ''">$(OnnxRuntimePathOverride)</OnnxRuntimeBinary>
<OnnxRuntimeBinary Condition="'$(OnnxRuntimeBinary)' == ''">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\onnxruntime.dll</OnnxRuntimeBinary>
<OnnxRuntimeBinary Condition="'$(OnnxRuntimeBinary)' == ''">$(RuntimesDirectory)\onnxruntime.dll</OnnxRuntimeBinary>
<DirectMLBinary Condition="'$(DirectMLPathOverride)' != ''">$(DirectMLPathOverride)</DirectMLBinary>
<DirectMLBinary Condition="'$(DirectMLBinary)' == ''">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native\directml.dll</DirectMLBinary>
<DirectMLBinary Condition="'$(DirectMLBinary)' == ''">$(RuntimesDirectory)\directml.dll</DirectMLBinary>
</PropertyGroup>
<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)\..\..\lib\uap10.0\Microsoft.AI.MachineLearning.winmd">
<Reference Include="$(MSBuildThisFileDirectory)\..\..\lib\uap\Microsoft.AI.MachineLearning.winmd">
<Implementation>$(WindowsAIBinary)</Implementation>
</Reference>
</ItemGroup>
@ -26,7 +27,7 @@
<PropertyGroup Condition="'$(WindowsAI-Platform)' == x64 OR '$(WindowsAI-Platform)' == x86">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary);$(DirectMLBinary)</MLBinaries>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsAI-Platform)' == arm OR '$(WindowsAI-Platform)' == arm64">
<PropertyGroup Condition="'$(OutputType)' == 'AppContainerExe' OR '$(WindowsAI-Platform)' == arm OR '$(WindowsAI-Platform)' == arm64">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary)</MLBinaries>
</PropertyGroup>

View file

@ -176,6 +176,9 @@ def parse_arguments():
"--cmake_extra_defines", nargs="+",
help="Extra definitions to pass to CMake during build system "
"generation. These are just CMake -D options without the leading -D.")
parser.add_argument(
"--target",
help="Build a specific target, e.g. winml_dll")
parser.add_argument(
"--x86", action='store_true',
help="Create x86 makefiles. Requires --update and no existing cache "
@ -893,13 +896,15 @@ def clean_targets(cmake_path, build_dir, configs):
run_subprocess(cmd_args)
def build_targets(args, cmake_path, build_dir, configs, parallel):
def build_targets(args, cmake_path, build_dir, configs, parallel, target=None):
for config in configs:
log.info("Building targets for %s configuration", config)
build_dir2 = get_config_build_dir(build_dir, config)
cmd_args = [cmake_path,
"--build", build_dir2,
"--config", config]
if target:
cmd_args.extend(['--target', target])
build_tool_args = []
if parallel:
@ -1506,10 +1511,10 @@ def run_csharp_tests(use_cuda, use_openvino, use_tensorrt, use_dnnl):
def build_protoc_for_host(cmake_path, source_dir, build_dir, args):
if (args.arm or args.arm64) and (not is_windows() and not args.ios):
if (args.arm or args.arm64 or args.enable_windows_store) and (not is_windows() and not args.ios):
raise BuildError(
'Currently only support building protoc for Windows host while '
'cross-compiling for ARM/ARM64 arch and linux cross-compiling iOS')
'cross-compiling for ARM/ARM64/Store and linux cross-compiling iOS')
log.info(
"Building protoc for host to be used in cross-compiled build process")
@ -1747,7 +1752,7 @@ def main():
elif is_macOS() and args.use_xcode:
cmake_extra_args += ['-G', 'Xcode']
if (args.android or args.ios) and args.path_to_protoc_exe is None:
if (args.android or args.ios or args.enable_windows_store) and args.path_to_protoc_exe is None:
# Cross-compiling for Android and iOS
path_to_protoc_exe = build_protoc_for_host(
cmake_path, source_dir, build_dir, args)
@ -1776,7 +1781,7 @@ def main():
setup_dml_build(args, cmake_path, build_dir, configs)
if args.build:
build_targets(args, cmake_path, build_dir, configs, args.parallel)
build_targets(args, cmake_path, build_dir, configs, args.parallel, args.target)
if args.test:
run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs)

View file

@ -47,58 +47,57 @@ jobs:
parameters:
BuildArch: 'arm'
- ${{ if eq('false', 'true') }}:
- job: WindowsAI_DirectML_X64_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-GPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'x64'
BuildForStore: 'true'
- job: WindowsAI_CPU_X64_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'x64'
BuildForStore: 'true'
- job: WindowsAI_DirectML_X86_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-GPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'x86'
BuildForStore: 'true'
- job: WindowsAI_CPU_X86_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'x86'
BuildForStore: 'true'
- job: WindowsAI_CPU_ARM64_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'arm64'
BuildForStore: 'true'
- job: WindowsAI_CPU_ARM_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'arm'
BuildForStore: 'true'
- job: WindowsAI_CPU_ARM64_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'arm64'
BuildForStore: 'true'
- job: WindowsAI_CPU_ARM_Store
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: 'Win-CPU-2019'
demands: []
steps:
- template: ../../templates/windowsai-nuget-build.yml
parameters:
BuildArch: 'arm'
BuildForStore: 'true'
- job: NuGet_Packaging
workspace:
@ -109,6 +108,10 @@ jobs:
- WindowsAI_DirectML_X86
- WindowsAI_CPU_ARM64
- WindowsAI_CPU_ARM
- WindowsAI_CPU_X64_Store
- WindowsAI_CPU_X86_Store
- WindowsAI_CPU_ARM64_Store
- WindowsAI_CPU_ARM_Store
condition: succeeded()
steps:
- task: DownloadPipelineArtifact@0
@ -135,6 +138,30 @@ jobs:
artifactName: 'Microsoft.AI.MachineLearning.arm'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-arm'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML x64 Store'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.x64.Store'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-x64-store'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML x86 Store'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.x86.Store'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-x86-store'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet CPU ARM64 Store'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.arm64.Store'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-arm64-store'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet CPU ARM Store'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.arm.Store'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-arm-store'
- task: PowerShell@2
displayName: 'Bundle NuGet and other binaries'
inputs:
@ -149,34 +176,72 @@ jobs:
$x64_nupkg_unzipped_directory = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($x64_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($x64_nuget_package, $x64_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-x64-store -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$x64_store_nuget_package = $nupkgs[0].FullName
$x64_store_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$x64_store_nupkg_unzipped_directory = [System.IO.Path]::Combine($x64_store_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($x64_store_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($x64_store_nuget_package, $x64_store_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-x86 -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$x86_nuget_package = $nupkgs[0].FullName
$x86_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$x86_nupkg_unzipped_directory = [System.IO.Path]::Combine($x86_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($x86_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($x86_nuget_package, $x86_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-x86-store -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$x86_store_nuget_package = $nupkgs[0].FullName
$x86_store_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$x86_store_nupkg_unzipped_directory = [System.IO.Path]::Combine($x86_store_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($x86_store_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($x86_store_nuget_package, $x86_store_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-arm64 -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$arm64_nuget_package = $nupkgs[0].FullName
$arm64_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$arm64_nupkg_unzipped_directory = [System.IO.Path]::Combine($arm64_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($arm64_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($arm64_nuget_package, $arm64_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-arm64-store -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$arm64_store_nuget_package = $nupkgs[0].FullName
$arm64_store_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$arm64_store_nupkg_unzipped_directory = [System.IO.Path]::Combine($arm64_store_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($arm64_store_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($arm64_store_nuget_package, $arm64_store_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-arm -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$arm_nuget_package = $nupkgs[0].FullName
$arm_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$arm_nupkg_unzipped_directory = [System.IO.Path]::Combine($arm_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($arm_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($arm_nuget_package, $arm_nupkg_unzipped_directory)
$nupkgs = (Get-ChildItem ..\nuget-artifact-arm-store -Filter Microsoft.AI.MachineLearning*.nupkg -Recurse)
$arm_store_nuget_package = $nupkgs[0].FullName
$arm_store_nupkg_unzipped_directory_root = $nupkgs[0].Directory.FullName
$arm_store_nupkg_unzipped_directory = [System.IO.Path]::Combine($arm_store_nupkg_unzipped_directory_root, 'binaries', [System.IO.Path]::GetFileNameWithoutExtension($arm_store_nuget_package))
[System.IO.Compression.ZipFile]::ExtractToDirectory($arm_store_nuget_package, $arm_store_nupkg_unzipped_directory)
$x64_store_runtime_path_old = [System.IO.Path]::Combine($x64_store_nupkg_unzipped_directory, 'runtimes', 'win-x64', 'uap')
$x64_store_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-x64', 'uap')
$x86_runtime_path_old = [System.IO.Path]::Combine($x86_nupkg_unzipped_directory, 'runtimes', 'win-x86', 'native')
$x86_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-x86', 'native')
$x86_store_runtime_path_old = [System.IO.Path]::Combine($x86_store_nupkg_unzipped_directory, 'runtimes', 'win-x86', 'uap')
$x86_store_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-x86', 'uap')
$arm64_runtime_path_old = [System.IO.Path]::Combine($arm64_nupkg_unzipped_directory, 'runtimes', 'win-arm64', 'native')
$arm64_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-arm64', 'native')
$arm64_store_runtime_path_old = [System.IO.Path]::Combine($arm64_store_nupkg_unzipped_directory, 'runtimes', 'win-arm64', 'uap')
$arm64_store_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-arm64', 'uap')
$arm_runtime_path_old = [System.IO.Path]::Combine($arm_nupkg_unzipped_directory, 'runtimes', 'win-arm', 'native')
$arm_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-arm', 'native')
$arm_store_runtime_path_old = [System.IO.Path]::Combine($arm_store_nupkg_unzipped_directory, 'runtimes', 'win-arm', 'uap')
$arm_store_runtime_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'runtimes', 'win-arm', 'uap')
$uap_build_path_old = [System.IO.Path]::Combine($x64_store_nupkg_unzipped_directory, 'build', 'uap')
$uap_build_path_new = [System.IO.Path]::Combine($x64_nupkg_unzipped_directory, 'build', 'uap')
New-Item -Path $x64_store_runtime_path_new -ItemType Directory
New-Item -Path $x86_runtime_path_new -ItemType Directory
New-Item -Path $x86_store_runtime_path_new -ItemType Directory
New-Item -Path $arm64_runtime_path_new -ItemType Directory
New-Item -Path $arm64_store_runtime_path_new -ItemType Directory
New-Item -Path $arm_runtime_path_new -ItemType Directory
New-Item -Path $arm_store_runtime_path_new -ItemType Directory
Copy-Item ([System.IO.Path]::Combine($x86_runtime_path_old, 'onnxruntime.dll')) $x86_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x86_runtime_path_old, 'onnxruntime.lib')) $x86_runtime_path_new
@ -188,12 +253,34 @@ jobs:
Copy-Item ([System.IO.Path]::Combine($arm64_runtime_path_old, 'onnxruntime.lib')) $arm64_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $arm64_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $arm64_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_runtime_path_old, 'onnxruntime.dll')) $arm_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_runtime_path_old, 'onnxruntime.lib')) $arm_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $arm_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $arm_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x64_store_runtime_path_old, 'onnxruntime.dll')) $x64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x64_store_runtime_path_old, 'onnxruntime.lib')) $x64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x64_store_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $x64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x64_store_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $x64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x86_store_runtime_path_old, 'onnxruntime.dll')) $x86_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x86_store_runtime_path_old, 'onnxruntime.lib')) $x86_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x86_store_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $x86_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($x86_store_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $x86_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_store_runtime_path_old, 'onnxruntime.dll')) $arm64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_store_runtime_path_old, 'onnxruntime.lib')) $arm64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_store_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $arm64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm64_store_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $arm64_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_store_runtime_path_old, 'onnxruntime.dll')) $arm_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_store_runtime_path_old, 'onnxruntime.lib')) $arm_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_store_runtime_path_old, 'microsoft.ai.machinelearning.dll')) $arm_store_runtime_path_new
Copy-Item ([System.IO.Path]::Combine($arm_store_runtime_path_old, 'microsoft.ai.machinelearning.lib')) $arm_store_runtime_path_new
Copy-Item -Recurse $uap_build_path_old $uap_build_path_new
$merged_nuget_path = [System.IO.Path]::Combine($Env:BUILD_ARTIFACTSTAGINGDIRECTORY, 'merged')
if (!(Test-Path $merged_nuget_path)) {
New-Item -Path $merged_nuget_path -ItemType Directory

View file

@ -40,42 +40,74 @@ steps:
${{ if and(eq(parameters.BuildArch, 'x64'), eq(parameters.BuildForStore, 'false')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_dml --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti'
${{ if and(eq(parameters.BuildArch, 'x64'), eq(parameters.BuildForStore, 'true')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_dml --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --enable_windows_store'
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --skip_winml_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --enable_windows_store --target winml_dll'
${{ if and(eq(parameters.BuildArch, 'x86'), eq(parameters.BuildForStore, 'false')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_dml --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --x86'
${{ if and(eq(parameters.BuildArch, 'x86'), eq(parameters.BuildForStore, 'true')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_dml --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --x86 --enable_windows_store'
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --skip_winml_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --x86 --enable_windows_store --target winml_dll'
${{ if and(eq(parameters.BuildArch, 'arm64'), eq(parameters.BuildForStore, 'false')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm64'
${{ if and(eq(parameters.BuildArch, 'arm64'), eq(parameters.BuildForStore, 'true')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm64 --enable_windows_store'
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --skip_winml_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm64 --enable_windows_store --target winml_dll'
${{ if and(eq(parameters.BuildArch, 'arm'), eq(parameters.BuildForStore, 'false')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm'
${{ if and(eq(parameters.BuildArch, 'arm'), eq(parameters.BuildForStore, 'true')) }}:
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm --enable_windows_store'
arguments: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --skip_winml_tests --enable_wcos $(TelemetryOption) --use_winml --cmake_generator "Visual Studio 16 2019" --update --config RelWithDebInfo --enable_lto --disable_rtti --arm --enable_windows_store --target winml_dll'
workingDirectory: '$(Build.BinariesDirectory)'
- ${{ if notIn(parameters['sln_platform'], 'Win32', 'x64') }}:
- ${{ if or(notIn(parameters['sln_platform'], 'Win32', 'x64'), eq(parameters.BuildForStore, 'true')) }}:
# Use cross-compiled protoc
- script: |
@echo ##vso[task.setvariable variable=ProtocDirectory]$(Build.BinariesDirectory)\host_protoc\Release
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
${{ if ne(parameters.BuildArch, 'x86') }}:
platform: ${{ parameters.BuildArch }}
${{ if eq(parameters.BuildArch, 'x86') }}:
platform: 'Win32'
configuration: RelWithDebInfo
msbuildArchitecture: ${{ parameters.BuildArch }}
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- ${{ if eq(parameters.BuildForStore, 'false') }}:
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
${{ if ne(parameters.BuildArch, 'x86') }}:
platform: ${{ parameters.BuildArch }}
${{ if eq(parameters.BuildArch, 'x86') }}:
platform: 'Win32'
configuration: RelWithDebInfo
msbuildArchitecture: ${{ parameters.BuildArch }}
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- ${{ if eq(parameters.BuildArch, 'x64') }}:
- ${{ if eq(parameters.BuildForStore, 'true') }}:
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.vcxproj'
${{ if ne(parameters.BuildArch, 'x86') }}:
platform: ${{ parameters.BuildArch }}
${{ if eq(parameters.BuildArch, 'x86') }}:
platform: 'Win32'
configuration: RelWithDebInfo
msbuildArchitecture: ${{ parameters.BuildArch }}
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\winml_dll.vcxproj'
${{ if ne(parameters.BuildArch, 'x86') }}:
platform: ${{ parameters.BuildArch }}
${{ if eq(parameters.BuildArch, 'x86') }}:
platform: 'Win32'
configuration: RelWithDebInfo
msbuildArchitecture: ${{ parameters.BuildArch }}
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- ${{ if and(eq(parameters.BuildArch, 'x64'), eq(parameters.BuildForStore, 'false')) }}:
- script: |
mklink /D /J $(Build.BinariesDirectory)\RelWithDebInfo\models $(Build.BinariesDirectory)\models
DIR dist\ /S /B > wheel_filename_file
@ -147,7 +179,7 @@ steps:
DoEsrp: 'true'
- ${{ if eq(parameters.BuildArch, 'x64') }}:
- ${{ if and(eq(parameters.BuildArch, 'x64'), eq(parameters.BuildForStore, 'false')) }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
@ -155,7 +187,7 @@ steps:
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- ${{ if eq(parameters.BuildArch, 'x86') }}:
- ${{ if and(eq(parameters.BuildArch, 'x86'), eq(parameters.BuildForStore, 'false')) }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=x86
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
@ -163,9 +195,25 @@ steps:
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- ${{ if and(eq(parameters.BuildArch, 'x64'), eq(parameters.BuildForStore, 'true')) }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:IsStoreBuild=True /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.snupkg $(Build.ArtifactStagingDirectory)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- ${{ if and(eq(parameters.BuildArch, 'x86'), eq(parameters.BuildForStore, 'true')) }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=x86 /p:IsStoreBuild=True /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.snupkg $(Build.ArtifactStagingDirectory)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- ${{ if eq(parameters.BuildArch, 'arm64') }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=arm64 /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=arm64 /p:IsStoreBuild=${{ parameters.BuildForStore }} /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.snupkg $(Build.ArtifactStagingDirectory)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
@ -173,17 +221,25 @@ steps:
- ${{ if eq(parameters.BuildArch, 'arm') }}:
- script: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=arm /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreateWindowsAIPackage /p:OnnxRuntimeBuildDirectory=$(Build.BinariesDirectory) /p:OnnxRuntimeSourceDirectory=$(Build.SourcesDirectory) /p:TargetArchitecture=arm /p:IsStoreBuild=${{ parameters.BuildForStore }} /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.snupkg $(Build.ArtifactStagingDirectory)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: Microsoft.AI.MachineLearning ${{ parameters.BuildArch }}'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.${{ parameters.BuildArch }}'
targetPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.BuildForStore, 'false') }}:
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: Microsoft.AI.MachineLearning ${{ parameters.BuildArch }}'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.${{ parameters.BuildArch }}'
targetPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.BuildForStore, 'true') }}:
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: Microsoft.AI.MachineLearning ${{ parameters.BuildArch }}'
inputs:
artifactName: 'Microsoft.AI.MachineLearning.${{ parameters.BuildArch }}.Store'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: PublishSymbols@2
displayName: 'Publish Build Symbols'

View file

@ -20,6 +20,8 @@ def parse_arguments():
parser.add_argument("--packages_path", required=True, help="Nuget packages output directory.")
parser.add_argument("--sources_path", required=True, help="OnnxRuntime source code root.")
parser.add_argument("--commit_id", required=True, help="The last commit id included in this package.")
parser.add_argument("--is_store_build", default=False, type=lambda x: x.lower() == 'true',
help="Build for the Microsoft Store")
parser.add_argument("--is_release_build", required=False, default=None, type=str,
help="Flag indicating if the build is a release build. Accepted values: true/false.")
parser.add_argument("--execution_provider", required=False, default='None', type=str,
@ -168,8 +170,8 @@ def generate_files(list, args):
includes_cuda = is_cuda_gpu_package or is_cpu_package # Why does the CPU package ship the cuda provider headers?
includes_winml = is_windowsai_package
includes_directml = (is_dml_package or is_windowsai_package) and (args.target_architecture == 'x64'
or args.target_architecture == 'x86')
includes_directml = (is_dml_package or is_windowsai_package) and not args.is_store_build and (
args.target_architecture == 'x64' or args.target_architecture == 'x86')
is_windows_build = is_windows()
@ -203,6 +205,10 @@ def generate_files(list, args):
copy_command = "cp"
runtimes_target = '" target="runtimes\\linux-'
runtimes = '{}{}\\{}"'.format(runtimes_target,
args.target_architecture,
'uap' if args.is_store_build else 'native')
# Process headers
files_list.append('<file src=' + '"' + os.path.join(args.sources_path,
'include\\onnxruntime\\core\\session\\onnxruntime_*.h') +
@ -260,7 +266,7 @@ def generate_files(list, args):
# Process microsoft.ai.machinelearning.winmd
files_list.append('<file src=' + '"' + os.path.join(args.ort_build_path, args.build_config,
'microsoft.ai.machinelearning.winmd') +
'" target="lib\\uap10.0\\Microsoft.AI.MachineLearning.winmd" />')
'" target="lib\\uap\\Microsoft.AI.MachineLearning.winmd" />')
interop_dll = 'Microsoft.AI.MachineLearning.Interop\\netstandard2.0\\Microsoft.AI.MachineLearning.Interop.dll'
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, interop_dll) +
'" target="lib\\netstandard2.0\\Microsoft.AI.MachineLearning.Interop.dll" />')
@ -272,12 +278,12 @@ def generate_files(list, args):
# Process onnxruntime import lib, dll, and pdb
if is_windows_build:
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.lib') +
'" target="runtimes\\win-' + args.target_architecture + '\\native" />')
runtimes + ' />')
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.dll') +
'" target="runtimes\\win-' + args.target_architecture + '\\native" />')
runtimes + ' />')
if os.path.exists(os.path.join(args.native_build_path, 'onnxruntime.pdb')):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.pdb') +
'" target="runtimes\\win-' + args.target_architecture + '\\native" />')
runtimes + ' />')
else:
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'nuget-staging/usr/local/lib',
'libonnxruntime.so') + '" target="runtimes\\linux-' + args.target_architecture +
@ -285,9 +291,9 @@ def generate_files(list, args):
if includes_directml:
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'DirectML.dll') +
'" target="runtimes\\win-' + args.target_architecture + '\\native" />')
runtimes + ' />')
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'DirectML.pdb') +
'" target="runtimes\\win-' + args.target_architecture + '\\native" />')
runtimes + ' />')
files_list.append('<file src=' + '"' + os.path.join(args.packages_path, 'DirectML.3.0.0\\LICENSE.txt') +
'" target="DirectML_LICENSE.txt" />')
@ -295,16 +301,19 @@ def generate_files(list, args):
# Process microsoft.ai.machinelearning import lib, dll, and pdb
files_list.append('<file src=' + '"' +
os.path.join(args.native_build_path, 'microsoft.ai.machinelearning.lib') +
'" target="runtimes\\win-' + args.target_architecture +
'\\native\\Microsoft.AI.MachineLearning.lib" />')
runtimes_target + args.target_architecture + '\\' +
('uap' if args.is_store_build else 'native') +
'\\Microsoft.AI.MachineLearning.lib" />')
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path,
'microsoft.ai.machinelearning.dll') +
'" target="runtimes\\win-' + args.target_architecture +
'\\native\\Microsoft.AI.MachineLearning.dll" />')
runtimes_target + args.target_architecture + '\\' +
('uap' if args.is_store_build else 'native') +
'\\Microsoft.AI.MachineLearning.dll" />')
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path,
'microsoft.ai.machinelearning.pdb') +
'" target="runtimes\\win-' + args.target_architecture +
'\\native\\Microsoft.AI.MachineLearning.pdb" />')
runtimes_target + args.target_architecture + '\\' +
('uap' if args.is_store_build else 'native') +
'\\Microsoft.AI.MachineLearning.pdb" />')
# Process execution providers which are built as shared libs
if args.execution_provider == "tensorrt":
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path,
@ -327,26 +336,26 @@ def generate_files(list, args):
# Process dnnl dependency
if os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['dnnl'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, nuget_dependencies['dnnl']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
# Process mklml dependency
if os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['mklml'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, nuget_dependencies['mklml']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
if is_linux() and os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['mklml_1'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, nuget_dependencies['mklml_1']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
# Process libiomp5md dependency
if os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['openmp'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, nuget_dependencies['openmp']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
# Process tvm dependency
if os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['tvm'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, nuget_dependencies['tvm']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
# Some tools to be packaged in nightly build only, should not be released
# These are copied to the runtimes folder for convenience of loading with the dlls
@ -354,29 +363,29 @@ def generate_files(list, args):
os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['onnxruntime_perf_test'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path,
nuget_dependencies['onnxruntime_perf_test']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
if args.is_release_build.lower() != 'true' and args.target_architecture == 'x64' and \
os.path.exists(os.path.join(args.native_build_path, nuget_dependencies['onnx_test_runner'])):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path,
nuget_dependencies['onnx_test_runner']) +
runtimes_target + args.target_architecture + '\\native" />')
runtimes + ' />')
# Process props and targets files
if is_windowsai_package:
windowsai_src = 'Microsoft.AI.MachineLearning'
# Process native props
windowsai_props = 'Microsoft.AI.MachineLearning.props'
windowsai_native_props = os.path.join(args.sources_path, 'csharp', 'src', windowsai_src, windowsai_props)
files_list.append('<file src=' + '"' + windowsai_native_props + '" target="build\\native" />')
# Process native targets
windowsai_targets = 'Microsoft.AI.MachineLearning.targets'
windowsai_native_targets = os.path.join(args.sources_path, 'csharp', 'src', windowsai_src, windowsai_targets)
files_list.append('<file src=' + '"' + windowsai_native_targets + '" target="build\\native" />')
# Process native rules
windowsai_native_props = os.path.join(args.sources_path, 'csharp', 'src', windowsai_src, windowsai_props)
windowsai_rules = 'Microsoft.AI.MachineLearning.Rules.Project.xml'
windowsai_native_rules = os.path.join(args.sources_path, 'csharp', 'src', windowsai_src, windowsai_rules)
files_list.append('<file src=' + '"' + windowsai_native_rules + '" target="build\\native" />')
windowsai_native_targets = os.path.join(args.sources_path, 'csharp', 'src', windowsai_src, windowsai_targets)
build = 'build\\{}'.format('uap' if args.is_store_build else 'native')
files_list.append('<file src=' + '"' + windowsai_native_props + '" target="' + build + '" />')
# Process native targets
files_list.append('<file src=' + '"' + windowsai_native_targets + '" target="' + build + '" />')
# Process rules
files_list.append('<file src=' + '"' + windowsai_native_rules + '" target="' + build + '" />')
# Process .net standard 2.0 targets
interop_src = 'Microsoft.AI.MachineLearning.Interop'
interop_targets = 'Microsoft.AI.MachineLearning.targets'

View file

@ -3,6 +3,8 @@
#pragma once
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
// stl
#include <algorithm>
#include <codecvt>
@ -17,4 +19,4 @@
#include <vector>
#include <sstream>
#include "test.h"
#include "test.h"