File: Microsoft.ML.OnnxRuntime.Tests.Common.csproj

package info (click to toggle)
onnxruntime 1.21.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 333,732 kB
  • sloc: cpp: 3,153,079; python: 179,219; ansic: 109,131; asm: 37,791; cs: 34,424; perl: 13,070; java: 11,047; javascript: 6,330; pascal: 4,126; sh: 3,277; xml: 598; objc: 281; makefile: 59
file content (148 lines) | stat: -rw-r--r-- 6,770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <IsWindowsBuild Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindowsBuild>
    <IsLinuxBuild Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinuxBuild>
    <IsMacOSBuild Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsMacOSBuild>

    <OnnxRuntimeRoot>$(ProjectDir)..\..\..</OnnxRuntimeRoot>
  </PropertyGroup>

  <PropertyGroup>
    <!-- netstandard2.0 is used by most platforms. net8.0 is required for linux. -->
    <TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
    <IsPackable>false</IsPackable>
    <Platforms>AnyCPU</Platforms>
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <ProtoSrc>$(OnnxRuntimeRoot)\cmake\external\onnx</ProtoSrc>

    <!-- Generated OnnxML.cs triggers this warning. -->
    <NoWarn>8981</NoWarn>

    <!-- following attributes were necessary for the migrated Tensor tests -->
    <LangVersion>default</LangVersion>
    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
    <SignAssembly>true</SignAssembly> <!-- need signing for friend access to the internals of the Tensors assembly -->
    <AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
    <Configurations>Debug;Release;RelWithDebInfo</Configurations>
    <!-- end -->

    <RootNamespace>Microsoft.ML.OnnxRuntime.Tests</RootNamespace>
    <AssemblyName>Microsoft.ML.OnnxRuntime.Tests.Common</AssemblyName>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsWindowsBuild)'=='true'">
    <ProtocDirectory Condition="'$(ProtocDirectory)'==''">$(OnnxRuntimeBuildDirectory)\$(Configuration)\external\protobuf\cmake\$(Configuration)</ProtocDirectory>
    <ProtocExe>$(ProtocDirectory)\protoc.exe</ProtocExe>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsLinuxBuild)'=='true'">
    <ProtocDirectory Condition="'$(ProtocDirectory)'==''">$(OnnxRuntimeBuildDirectory)\$(Configuration)\external\protobuf\cmake</ProtocDirectory>
    <ProtocExe>$(ProtocDirectory)\protoc</ProtocExe>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsMacOSBuild)'=='true'">
    <ProtocDirectory Condition="'$(ProtocDirectory)'==''">$(OnnxRuntimeBuildDirectory)\$(Configuration)\external\protobuf\cmake</ProtocDirectory>
    <ProtocExe>$(ProtocDirectory)\protoc</ProtocExe>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="InferenceTest.cs" />
    <Compile Remove="OrtIoBindingAllocationTest.cs" />
    <Compile Remove="OrtEnvTests.cs" />
    <Compile Remove="OrtValueTests.cs" />
    <Compile Remove="OrtFloat16Tests.cs" />
    <Compile Remove="Tensors\TensorTests.cs" />
    <Compile Remove="TrainingTest.cs" />
  </ItemGroup>
  <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>
    <Compile Update="Tensors\TensorArithmetic.cs">
      <DependentUpon>TensorArithmetic.tt</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <Compile Update="Tensors\TensorOperations.cs">
      <DependentUpon>TensorOperations.tt</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <!-- include common files for visibility, however they're compiled directly by the target specific test projects -->
    <None Include="InferenceTest.cs" />
    <None Include="OnnxData.cs" />
    <None Include="OrtIoBindingAllocationTest.cs" Condition=" '$(EnableDefaultCompileItems)' == 'true' " />
    <None Include="OrtValueTests.cs" />
    <None Include="OrtFloat16Tests.cs" />
    <None Include="Tensors\TensorTests.cs" Condition=" '$(EnableDefaultCompileItems)' == 'true' " />
    <None Include="Tensors\ArrayTensorExtensionTests.cs" Condition=" '$(EnableDefaultCompileItems)' == 'true' " />
    <None Include="TrainingTest.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Update="Tensors\TensorArithmetic.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>TensorArithmetic.cs</LastGenOutput>
    </None>
    <None Update="Tensors\TensorOperations.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>TensorOperations.cs</LastGenOutput>
    </None>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
    <PackageReference Include="Google.Protobuf" Version="3.21.12" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="xunit" Version="2.9.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="$(OnnxRuntimeRoot)\csharp\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj" />
  </ItemGroup>

  <!-- generate OnnxMl.cs from ONNX protobuf definition -->
  <Target Name="ProtoGen" BeforeTargets="BeforeBuild" Condition="Exists('$(ProtocExe)')">
    <Exec Command="$(ProtocExe) -I=$(ProtoSrc) --csharp_out=. $(ProtoSrc)\onnx\onnx-ml.proto3"
        ContinueOnError="false">
    </Exec>
  </Target>

  <Target Name="ProtoDataGen" BeforeTargets="BeforeBuild" Condition="Exists('$(ProtocExe)')">
    <Exec Command="$(ProtocExe) -I=$(ProtoSrc) --csharp_out=. $(ProtoSrc)\onnx\onnx-data.proto3"
        ContinueOnError="false">
    </Exec>
  </Target>

  <ItemGroup>
    <BuildEnvVars Include="OnnxRuntimeBuildDirectory=$(OnnxRuntimeBuildDirectory)" />
  </ItemGroup>

  <Target Name="DefineBuildEnvironmentVariables" BeforeTargets="Build">
    <WriteLinesToFile File="$(OutputPath)\Properties.txt" Lines="@(BuildEnvVars)" Overwrite="true" />
  </Target>

  <!-- Test Data that is used in MAUI and NetCore test app. Loaded via embedded resource for that to be possible -->
  <ItemGroup>
    <EmbeddedResource Include="..\..\testdata\*">
      <Link>TestData\%(Filename)%(Extension)</Link>
    </EmbeddedResource>
    <EmbeddedResource Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\overridable_initializer.onnx">
      <Link>TestData\overridable_initializer.onnx</Link>
    </EmbeddedResource>
    <EmbeddedResource Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\capi_symbolic_dims.onnx">
      <Link>TestData\capi_symbolic_dims.onnx</Link>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup>
    <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
  </ItemGroup>
</Project>