onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.Tests/Microsoft.ML.OnnxRuntime.Tests.csproj
shahasad ca0ed96621
CSharp api and test for loading custom op shared library (#2420)
- Added C-API test for loading custom op shared lib.
- Made some changes in C++ api header and C-api implementation to get it working.
- Added C# API and corresponding test for loading custom op shared library.
2019-11-21 15:45:49 -08:00

97 lines
4.2 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
<OnnxRuntimeCsharpRoot>..\..</OnnxRuntimeCsharpRoot>
<Platforms>AnyCPU;x86</Platforms>
<OutputPath>bin\$(Configuration)\</OutputPath>
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeCsharpRoot)\..\build\Windows</OnnxRuntimeBuildDirectory>
<ProtocDirectory>$(OnnxRuntimeBuildDirectory)\$(Configuration)\external\protobuf\cmake\$(Configuration)</ProtocDirectory>
<ProtoSrc>$(OnnxRuntimeCsharpRoot)\..\onnxruntime\core\protobuf</ProtoSrc>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)</NativeBuildOutputDir>
<!-- following attributes were necessary for the migrated Tensor tests -->
<LangVersion>7.2</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly> <!-- need signing for freind access to the internals of the Tensors assembly -->
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<!-- end -->
</PropertyGroup>
<ItemGroup>
<Compile Update="Tensors\TensorArithmetic.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Tensors\TensorArithmetic.tt</DependentUpon>
</Compile>
<Compile Update="Tensors\TensorOperations.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Tensors\TensorOperations.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Tensors\TensorArithmetic.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Tensors\TensorArithmetic.cs</LastGenOutput>
</None>
<None Update="Tensors\TensorOperations.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Tensors\TensorOperations.cs</LastGenOutput>
</None>
<None Update="Tensors\TensorTemplate.ttinclude" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Targets" Version="2.1.0"/>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.2"/>
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(OnnxRuntimeCsharpRoot)\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj" />
</ItemGroup>
<Target Name="ProtoGen" BeforeTargets="Build">
<Exec Command="$(ProtocDirectory)\protoc.exe -I=$(ProtoSrc) --csharp_out=. $(ProtoSrc)\onnx-ml.proto3" ContinueOnError="false"></Exec>
</Target>
<ItemGroup>
<None Include="$(NativeBuildOutputDir)\*.dll;$(NativeBuildOutputDir)\*.pdb;$(NativeBuildOutputDir)\libcustom*.so;$(NativeBuildOutputDir)\libcustom*.dylib">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeCSharpRoot)\testdata\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeCSharpRoot)\..\onnxruntime\test\testdata\overridable_initializer.onnx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeCSharpRoot)\..\onnxruntime\test\testdata\capi_symbolic_dims.onnx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeCSharpRoot)\..\onnxruntime\test\testdata\custom_op_library\custom_op_test.onnx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<BuildEnvVars Include="OnnxRuntimeBuildDirectory=$(OnnxRuntimeBuildDirectory)" />
</ItemGroup>
<Target Name="DefineBuildEnvironmentVariables" BeforeTargets="Build">
<WriteLinesToFile File="$(OutputPath)\Properties.txt" Lines="@(BuildEnvVars)" Overwrite="true" />
</Target>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
</Project>