onnxruntime/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
shahasad a09a3d3aa5
Add build targets and props file for legacy csharp project support (#127)
* added the x64 condition in the targets file

* need the reference node for managed dll

* address review comments

* fix the dll path

* added back Link
2018-12-07 12:15:11 -08:00

101 lines
4.2 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<!--- packaging properties -->
<PackageId>Microsoft.ML.OnnxRuntime</PackageId>
<Authors>Microsoft</Authors>
<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>
<PackageLicenseUrl>https://github.com/Microsoft/onnxruntime/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://go.microsoft.com/fwlink/?linkid=2049168</PackageIconUrl>
<!--internal build related properties-->
<OnnxRuntimeCsharpRoot>..\..</OnnxRuntimeCsharpRoot>
<buildDirectory Condition="'$(buildDirectory)'==''">$(OnnxRuntimeCsharpRoot)\..\build\Windows</buildDirectory>
<NativeBuildOutputDir>$(buildDirectory)\$(Configuration)\$(Configuration)</NativeBuildOutputDir>
<!-- 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="$(NativeBuildOutputDir)\onnxruntime.dll"
PackagePath="\runtimes\win10-x64\native"
Pack="true"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\onnxruntime.pdb"
Condition="Exists('$(NativeBuildOutputDir)\onnxruntime.pdb')"
PackagePath="\runtimes\win10-x64\native"
Pack="true"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\mkldnn.dll"
Condition="Exists('$(NativeBuildOutputDir)\mkldnn.dll')"
PackagePath="\runtimes\win10-x64\native"
Pack="true"
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\LICENSE;$(OnnxRuntimeCsharpRoot)\..\ThirdPartyNotices.txt"
PackagePath="\"
Pack="true"
Visible="false"
/>
<None Include="$(OnnxRuntimeCsharpRoot)\..\docs\CSharp_API.md"
PackagePath="\README.md"
Pack="true"
Visible="false"
/>
<None Include="Microsoft.ML.OnnxRuntime.targets"
PackagePath="\build\$(TargetFramework)"
Pack="true"
Visible="false"
/>
<None Include="Microsoft.ML.OnnxRuntime.props"
PackagePath="\build\$(TargetFramework)"
Pack="true"
Visible="false"
/>
</ItemGroup>
<Target Name="ObtainPackageVersion" BeforeTargets="Build;Pack">
<ReadLinesFromFile File="$(OnnxRuntimeCsharpRoot)\..\VERSION_NUMBER">
<Output TaskParameter="Lines" ItemName="MajorVersionNumber"/>
</ReadLinesFromFile>
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHashShort" />
</Exec>
<PropertyGroup>
<PackageVersion>@(MajorVersionNumber)</PackageVersion>
<Version>$(PackageVersion)</Version>
<PackageVersion Condition="'$(IsReleaseBuild)'!='true'">$(PackageVersion)-dev-$(GitCommitHashShort)</PackageVersion>
</PropertyGroup>
<Message Importance="High" Text="PackageVersion=$(PackageVersion)" />
</Target>
<ItemGroup>
<PackageReference Include="System.Numerics.Tensors" Version="0.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>
</ItemGroup>
</Project>