onnxruntime/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
Sheil Kumar 2717c178cc
Fork the WinML APIs into the Microsoft namespace (#3503)
* Migrate winml to Microsoft Namespace (packaging changes are pending)

* add ns_prefix toggle

* fix packaging

* Users/sheilk/add missing raw header (#3484)

* add dualapipartition

* wrong variable for repo root

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>

* remove existence check to force failures

* extra paren

* dualapipartition needs to be referenced from the source

* add microsoft.ai.machinelearning.dll to the output dir

* rename the idl file so that assembly info is correctly added into the winmd

* fix namespaces

* update namespaces

* default to microsoft, and add namespace override as build argument

* update cmakesetings.json as well

* remove from cmakelists.txt

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
Co-authored-by: Changming Sun <chasun@microsoft.com>
2020-04-17 06:18:54 -07:00

254 lines
12 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<LangVersion>7.2</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<!--internal build related properties-->
<OnnxRuntimeRoot>..\..\..</OnnxRuntimeRoot>
<OnnxRuntimeCsharpRoot>$(OnnxRuntimeRoot)\csharp</OnnxRuntimeCsharpRoot>
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeCsharpRoot)\..\build\Windows</OnnxRuntimeBuildDirectory>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)</NativeBuildOutputDir>
<TargetArchitecture Condition=" '$(TargetArchitecture)' == '' ">x64</TargetArchitecture>
<!--- packaging properties -->
<OrtPackageId Condition=" '$(OrtPackageId)' == '' ">Microsoft.ML.OnnxRuntime</OrtPackageId>
<!--- The package name is always hardcoded as the package created by this project only contains managed assemblies -->
<!--- The parameter OrtPackageId is only used for some conditional logic below -->
<PackageId>Microsoft.ML.OnnxRuntime.Managed</PackageId>
<Authors>Microsoft</Authors>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">0.0</PackageVersion>
<Version>$(PackageVersion)</Version>
<Description>This package contains ONNX Runtime for .Net platforms</Description>
<PackageTags>ONNX;ONNX Runtime;Machine Learning</PackageTags>
<PackageProjectUrl>https://github.com/Microsoft/onnxruntime</PackageProjectUrl>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>https://go.microsoft.com/fwlink/?linkid=2049168</PackageIconUrl>
<PackageReleaseNotes>
Release Def:
Branch: $(BUILD_SOURCEBRANCH)
Commit: $(BUILD_SOURCEVERSION)
Build: https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=$(BUILD_BUILDID)
</PackageReleaseNotes>
<!-- sourcelink flags -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<!--EmbedUntrackedSources>true</EmbedUntrackedSources-->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<!--TODO: this works for single platform only. Need separate packaging scripts for multi-target packaging -->
<!--TODO: Find a way to bundle the native symbol files properly -->
<ItemGroup>
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\session\onnxruntime_*.h"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\providers\cpu\cpu_provider_factory.h"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\providers\cuda\cuda_provider_factory.h"
Condition="'$(OrtPackageId)' != 'Microsoft.ML.OnnxRuntime.DirectML'"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\providers\dml\dml_provider_factory.h"
Condition="'$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\onnxruntime.lib"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\onnxruntime.dll"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\onnxruntime.pdb"
Condition="Exists('$(NativeBuildOutputDir)\onnxruntime.pdb')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.dll"
Condition="Exists('$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.dll')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.lib"
Condition="Exists('$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.lib')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.pdb"
Condition="Exists('$(NativeBuildOutputDir)\Microsoft.AI.MachineLearning.pdb')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.winmd"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.winmd')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\metadata"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.h"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.Native.h"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Microsoft.AI.MachineLearning.Native.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeRoot)\winml\api\dualapipartitionattribute.h"
Condition="Exists('$(OnnxRuntimeRoot)\winml\api\dualapipartitionattribute.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(OnnxRuntimeRoot)\winml\api\dualapipartitionattribute.h"
Condition="Exists('$(OnnxRuntimeRoot)\winml\api\dualapipartitionattribute.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"
Pack="false"
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\DirectML.dll"
Condition="Exists('$(NativeBuildOutputDir)\DirectML.dll')
And '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\dnnl.dll"
Condition="Exists('$(NativeBuildOutputDir)\dnnl.dll')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\mklml.dll"
Condition="Exists('$(NativeBuildOutputDir)\mklml.dll')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\libiomp5md.dll"
Condition="Exists('$(NativeBuildOutputDir)\libiomp5md.dll')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\tvm.dll"
Condition="Exists('$(NativeBuildOutputDir)\tvm.dll')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\LICENSE.txt;$(OnnxRuntimeCsharpRoot)\..\ThirdPartyNotices.txt;$(OnnxRuntimeCsharpRoot)\..\docs\Privacy.md"
PackagePath="\"
Pack="true"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\docs\CSharp_API.md"
PackagePath="\README.md"
Pack="true"
Visible="false"
/>
<None Include="$(PackageId).targets"
PackagePath="\build\$(TargetFramework)"
Pack="true"
Visible="false"
/>
<!-- 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 -->
<None Include="$(NativeBuildOutputDir)\onnxruntime_perf_test.exe"
Condition="('$(IsReleaseBuild)' != 'true') And ($(TargetArchitecture)=='x64') And Exists('$(NativeBuildOutputDir)\onnxruntime_perf_test.exe')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\onnx_test_runner.exe"
Condition="('$(IsReleaseBuild)' != 'true') And ($(TargetArchitecture)=='x64') And Exists('$(NativeBuildOutputDir)\onnx_test_runner.exe')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
Pack="false"
Visible="false"
/>
</ItemGroup>
<ItemGroup>
<LicenseFile Include="$(OnnxRuntimeCsharpRoot)\..\LICENSE"/>
<TargetsFile Include="$(OnnxRuntimeCsharpRoot)\src\Microsoft.ML.OnnxRuntime\targets.xml"/>
</ItemGroup>
<Target Name="CopyMiscFiles" BeforeTargets="Pack">
<Copy SourceFiles="@(LicenseFile)" DestinationFiles="@(LicenseFile->'$(OnnxRuntimeCsharpRoot)\..\%(Filename).txt')"/>
<Copy SourceFiles="@(TargetsFile)" DestinationFiles="@(TargetsFile->'$(OnnxRuntimeCsharpRoot)\src\\Microsoft.ML.OnnxRuntime\$(PackageId).targets')"/>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="System.Memory" Version="4.5.3" />
</ItemGroup>
</Project>