Limit inclusion of Xamarin mobile target frameworks. (#9834)

- Only set them as targets for the ORT nuget package
    - Use OrtPackageId as the condition for inclusion, if installed
      - need to do the nuget restore via msbuild so that this property is set correctly
  - Add desktop-only version of the C# sln as there is no way to exclude the mobile specific csproj's from an sln
    - use this when applicable if someone is running build.py with the `--build_nuget` flag

Other
  - remove attempt to include symbols in the nuget package as nuget doesn't support symbols in native packages
  - update build.py to use `nuget` and not a windows specific path and filename for a linux build with `--build_nuget`
This commit is contained in:
Scott McKay 2021-11-23 11:29:53 +10:00 committed by GitHub
parent 74ca417c0e
commit fb4a8e12fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 318 additions and 38 deletions

View file

@ -44,7 +44,7 @@ CMake creates a target to this project
<Message Importance="High" Text="Restoring NuGet packages for CSharp projects..." />
<MSBuild Projects="src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
Targets="Restore"
Properties="Platform=AnyCPU"
Properties="Platform=AnyCPU;OrtPackageId=$(OrtPackageId)"
/>
<MSBuild Projects="sample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj"
Targets="Restore"
@ -65,7 +65,7 @@ CMake creates a target to this project
<MSBuild Projects="src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
Targets="ObtainPackageVersion;Build"
Properties="Platform=AnyCPU"/>
Properties="Platform=AnyCPU;OrtPackageId=$(OrtPackageId)"/>
<MSBuild Projects="sample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj"
Targets="Build"
Properties="Platform=AnyCPU"
@ -130,7 +130,7 @@ CMake creates a target to this project
</Exec>
<Message Importance="High" Text="Bundling native shared library artifacts into a NuGet package ..." />
<Exec ContinueOnError="False" Command="$(NugetExe) pack -Symbols -SymbolPackageFormat snupkg NativeNuget.nuspec" ConsoleToMSBuild="true" WorkingDirectory="$(NativeBuildOutputDirAbs)" Condition=" '$(OS)' == 'Windows_NT'">
<Exec ContinueOnError="False" Command="$(NugetExe) pack NativeNuget.nuspec" ConsoleToMSBuild="true" WorkingDirectory="$(NativeBuildOutputDirAbs)" Condition=" '$(OS)' == 'Windows_NT'">
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
</Exec>

View file

@ -0,0 +1,230 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31613.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OnnxRuntime", "OnnxRuntime", "{6EFBFAB8-C606-4BA4-9604-BBAF3788520D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime", "src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj", "{584B53B3-359D-4DC2-BCD8-530B5D4685AD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{02AADD56-0FD4-4F03-A56C-30529A36B0C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj", "{2E295930-42B1-422D-925D-F07947AD8EFF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample.Forms", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.Forms\Microsoft.ML.OnnxRuntime.InferenceSample.Forms.csproj", "{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp\Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj", "{1AA14958-9246-4163-9403-F650E65ADCBC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Perf", "Perf", "{05C85C92-A377-4F69-9EF4-44A94C9B089D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.PerfTool", "tools\Microsoft.ML.OnnxRuntime.PerfTool\Microsoft.ML.OnnxRuntime.PerfTool.csproj", "{310506FD-6E78-4D62-989B-25D69A85E8CF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6782763B-8097-457C-AEA3-67678621DBE0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.Common", "test\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj", "{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.NetCoreApp", "test\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj", "{50173D13-DF29-42E7-A30B-8B12D36C77B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Release|x86 = Release|x86
RelWithDebInfo|Any CPU = RelWithDebInfo|Any CPU
RelWithDebInfo|iPhone = RelWithDebInfo|iPhone
RelWithDebInfo|iPhoneSimulator = RelWithDebInfo|iPhoneSimulator
RelWithDebInfo|x86 = RelWithDebInfo|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhone.Build.0 = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|x86.ActiveCfg = Debug|x86
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|x86.Build.0 = Debug|x86
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.Build.0 = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhone.ActiveCfg = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhone.Build.0 = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|x86.ActiveCfg = Release|x86
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|x86.Build.0 = Release|x86
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhone.Build.0 = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|x86.ActiveCfg = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|x86.Build.0 = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|Any CPU.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhone.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhone.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|x86.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.Release|x86.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhone.Build.0 = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|x86.ActiveCfg = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|x86.Build.0 = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|Any CPU.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhone.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhone.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|x86.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|x86.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhone.Build.0 = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|x86.ActiveCfg = Debug|x86
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|x86.Build.0 = Debug|x86
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.Build.0 = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhone.ActiveCfg = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhone.Build.0 = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|x86.ActiveCfg = Release|x86
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|x86.Build.0 = Release|x86
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhone.Build.0 = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|x86.ActiveCfg = Debug|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|x86.Build.0 = Debug|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|Any CPU.Build.0 = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhone.ActiveCfg = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhone.Build.0 = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|x86.ActiveCfg = Release|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|x86.Build.0 = Release|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhone.Build.0 = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|x86.ActiveCfg = Debug|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|x86.Build.0 = Debug|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|Any CPU.Build.0 = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhone.ActiveCfg = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhone.Build.0 = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|x86.ActiveCfg = Release|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|x86.Build.0 = Release|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhone.Build.0 = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|x86.ActiveCfg = Debug|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|x86.Build.0 = Debug|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.Build.0 = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhone.ActiveCfg = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhone.Build.0 = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|x86.ActiveCfg = Release|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|x86.Build.0 = Release|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{584B53B3-359D-4DC2-BCD8-530B5D4685AD} = {6EFBFAB8-C606-4BA4-9604-BBAF3788520D}
{2E295930-42B1-422D-925D-F07947AD8EFF} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
{C5BDDD5D-F811-4CDD-A977-2D8581C21F36} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
{1AA14958-9246-4163-9403-F650E65ADCBC} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
{310506FD-6E78-4D62-989B-25D69A85E8CF} = {05C85C92-A377-4F69-9EF4-44A94C9B089D}
{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6} = {6782763B-8097-457C-AEA3-67678621DBE0}
{50173D13-DF29-42E7-A30B-8B12D36C77B1} = {6782763B-8097-457C-AEA3-67678621DBE0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3DBDA2B-F169-4EDE-9353-858904124B75}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal

6
csharp/readme.txt Normal file
View file

@ -0,0 +1,6 @@
The main solution file is OnnxRuntime.CSharp.sln. This includes desktop and Xamarin mobile projects.
OnnxRuntime.DesktopOnly.CSharp.sln is a copy of that with all the mobile projects removed. This is
due to there being no way to selectively exclude a csproj from the sln if Xamarin isn't available.
If changes are required, either update the main solution first and copy the relevant changes across,
or copy the entire file and remove the mobile projects (anything with iOS, Android or Droid in the name).

View file

@ -1,7 +1,25 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.22">
<PropertyGroup>
<TargetFrameworks>netstandard1.1;netstandard2.0;xamarinios10;monoandroid11.0;net5.0;netcoreapp3.1</TargetFrameworks>
<!--- packaging properties -->
<OrtPackageId Condition="'$(OrtPackageId)' == ''">Microsoft.ML.OnnxRuntime</OrtPackageId>
</PropertyGroup>
<!-- only include the Xamarin mobile targets for the main ORT package,
and only if the mobile workloads are installed -->
<Choose>
<When Condition="'$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime' AND Exists('$(MSBuildExtensionsPath)\Xamarin\Android') AND Exists('$(MSBuildExtensionsPath)\Xamarin\iOS')">
<PropertyGroup>
<TargetFrameworks>netstandard1.1;netstandard2.0;xamarinios10;monoandroid11.0;net5.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netstandard1.1;netstandard2.0;net5.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<Platforms>AnyCPU;x86</Platforms>
<LangVersion>7.2</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -19,9 +37,6 @@
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DebugType>portable</DebugType>
<!--- 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>

View file

@ -1759,6 +1759,11 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
csharp_build_dir = os.path.join(source_dir, 'csharp')
is_linux_build = derive_linux_build_property()
# in most cases we don't want/need to include the Xamarin mobile targets, as doing so means the Xamarin
# mobile workloads must be installed on the machine.
# they are only included in the Microsoft.ML.OnnxRuntime nuget package
sln = "OnnxRuntime.DesktopOnly.CSharp.sln"
# derive package name and execution provider based on the build args
target_name = "/t:CreatePackage"
execution_provider = "/p:ExecutionProvider=\"None\""
@ -1780,14 +1785,15 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
elif use_nuphar:
package_name = "/p:OrtPackageId=\"Microsoft.ML.OnnxRuntime.Nuphar\""
else:
pass
# use the solution file that includes Xamarin mobile targets
sln = "OnnxRuntime.CSharp.sln"
# set build directory based on build_dir arg
native_dir = os.path.normpath(os.path.join(source_dir, build_dir))
ort_build_dir = "/p:OnnxRuntimeBuildDirectory=\"" + native_dir + "\""
# dotnet restore
cmd_args = ["dotnet", "restore", "OnnxRuntime.CSharp.sln", "--configfile", "Nuget.CSharp.config"]
cmd_args = ["dotnet", "restore", sln, "--configfile", "Nuget.CSharp.config"]
run_subprocess(cmd_args, cwd=csharp_build_dir)
# build csharp bindings and create nuget package for each config
@ -1800,8 +1806,7 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
configuration = "/p:Configuration=\"" + config + "\""
if not use_winml:
cmd_args = ["dotnet", "msbuild", "OnnxRuntime.CSharp.sln", configuration, package_name, is_linux_build,
ort_build_dir]
cmd_args = ["dotnet", "msbuild", sln, configuration, package_name, is_linux_build, ort_build_dir]
run_subprocess(cmd_args, cwd=csharp_build_dir)
else:
winml_interop_dir = os.path.join(source_dir, "csharp", "src", "Microsoft.AI.MachineLearning.Interop")
@ -1811,7 +1816,13 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
ort_build_dir, "-restore"]
run_subprocess(cmd_args, cwd=csharp_build_dir)
nuget_exe = os.path.normpath(os.path.join(native_dir, config, "nuget_exe", "src", "nuget.exe"))
if is_windows():
# this path is setup by cmake/nuget_helpers.cmake for MSVC on Windows
nuget_exe = os.path.normpath(os.path.join(native_dir, config, "nuget_exe", "src", "nuget.exe"))
else:
# user needs to make sure nuget is installed and can be found
nuget_exe = "nuget"
nuget_exe_arg = "/p:NugetExe=\"" + nuget_exe + "\""
cmd_args = [

View file

@ -444,11 +444,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: RelWithDebInfo
msbuildArguments: '-t:restore -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu"'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'

View file

@ -464,11 +464,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: RelWithDebInfo
msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'

View file

@ -136,11 +136,14 @@ jobs:
versionSpec: 5.7.0
- ${{ if eq(parameters.BuildCSharp, true) }}:
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: '$(BuildConfig)'
msbuildArguments: '-t:restore -p:OrtPackageId=${{ parameters.OrtPackageId }}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- ${{ if eq(parameters.BuildCSharp, true) }}:
- task: MSBuild@1
@ -211,6 +214,7 @@ jobs:
${{ parameters.NuPackScript }}
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
failOnStderr: true
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'

View file

@ -145,12 +145,14 @@ jobs:
arguments: 'bdist_wheel'
workingDirectory: '$(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\${{ parameters.BuildConfig }}'
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: '${{ parameters.BuildConfig }}'
msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'

View file

@ -130,11 +130,14 @@ stages:
arguments: 'bdist_wheel'
workingDirectory: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: '$(BuildConfig)'
msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'

View file

@ -81,11 +81,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- task: NuGetCommand@2
displayName: Restore NuGet Packages
- task: MSBuild@1
displayName: 'Restore NuGet Packages'
inputs:
command: "restore"
restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
platform: 'Any CPU'
configuration: '$(BuildConfig)'
msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'