Update C# test projects (#21631)

### Description
<!-- Describe your changes. -->
Update various test projects to .net8 from EOL frameworks.
Replace the Xamarin based Android and iOS test projects with a MAUI
based project that uses .net 8.
Add new CoreML flags to C# bindings

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Remove usage of EOL frameworks.
This commit is contained in:
Scott McKay 2024-09-05 08:21:23 +10:00 committed by GitHub
parent 8632e67dc3
commit 44fc7b443c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
123 changed files with 1442 additions and 21795 deletions

View file

@ -6,6 +6,8 @@
<packageSources>
<clear />
<add key="NuGet Official" value="https://api.nuget.org/v3/index.json" />
<add key="MAUI DeviceRunners" value="https://pkgs.dev.azure.com/mattleibow/OpenSource/_packaging/test-device-runners/nuget/v3/index.json" />
<add key="XHarness" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

View file

@ -24,15 +24,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Te
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ML.OnnxRuntime.Tests.iOS", "test\Microsoft.ML.OnnxRuntime.Tests.iOS\Microsoft.ML.OnnxRuntime.Tests.iOS.csproj", "{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ML.OnnxRuntime.Tests.Droid", "test\Microsoft.ML.OnnxRuntime.Tests.Droid\Microsoft.ML.OnnxRuntime.Tests.Droid.csproj", "{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.Devices", "test\Microsoft.ML.OnnxRuntime.Tests.Devices\Microsoft.ML.OnnxRuntime.Tests.Devices.csproj", "{30431891-3929-4394-8049-75055B92315F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{7C7FC981-8AE7-42C6-962C-4B70D5C20C35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDocs", "ApiDocs\ApiDocs.csproj", "{7D841874-815D-43C7-9A3F-DD0AD9BA9D42}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiDocs", "ApiDocs\ApiDocs.csproj", "{7D841874-815D-43C7-9A3F-DD0AD9BA9D42}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.MAUI", "test\Microsoft.ML.OnnxRuntime.Tests.MAUI\Microsoft.ML.OnnxRuntime.Tests.MAUI.csproj", "{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -98,6 +96,42 @@ Global
{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
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.Deploy.0 = Release|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
@ -194,57 +228,6 @@ Global
{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
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|iPhone.ActiveCfg = Debug|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|iPhone.Build.0 = Debug|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Debug|x86.Build.0 = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|iPhone.ActiveCfg = Release|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|iPhone.Build.0 = Release|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|x86.ActiveCfg = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.Release|x86.Build.0 = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|Any CPU.Build.0 = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|iPhone.ActiveCfg = Release|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|iPhone.Build.0 = Release|iPhone
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|x86.ActiveCfg = Debug|iPhoneSimulator
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4}.RelWithDebInfo|x86.Build.0 = Debug|iPhoneSimulator
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|iPhone.Build.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|x86.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Debug|x86.Build.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|Any CPU.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|iPhone.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|iPhone.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|x86.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.Release|x86.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhone.Deploy.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{30431891-3929-4394-8049-75055B92315F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30431891-3929-4394-8049-75055B92315F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30431891-3929-4394-8049-75055B92315F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
@ -293,42 +276,42 @@ Global
{7D841874-815D-43C7-9A3F-DD0AD9BA9D42}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{7D841874-815D-43C7-9A3F-DD0AD9BA9D42}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{7D841874-815D-43C7-9A3F-DD0AD9BA9D42}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhone.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.ActiveCfg = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.Build.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Debug|x86.Deploy.0 = Debug|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|Any CPU.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhone.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.Release|x86.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|Any CPU.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhone.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{037242E4-7C79-401F-A19C-6824B1BB356F}.RelWithDebInfo|x86.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhone.Build.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhone.Deploy.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|x86.ActiveCfg = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|x86.Build.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Debug|x86.Deploy.0 = Debug|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|Any CPU.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|Any CPU.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhone.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhone.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhone.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|x86.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|x86.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.Release|x86.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|Any CPU.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhone.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460}.RelWithDebInfo|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -336,15 +319,14 @@ Global
GlobalSection(NestedProjects) = preSolution
{584B53B3-359D-4DC2-BCD8-530B5D4685AD} = {6EFBFAB8-C606-4BA4-9604-BBAF3788520D}
{2E295930-42B1-422D-925D-F07947AD8EFF} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
{037242E4-7C79-401F-A19C-6824B1BB356F} = {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}
{19446672-EBA3-4BA6-8DFB-AB2A85AC9AA4} = {6782763B-8097-457C-AEA3-67678621DBE0}
{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C} = {6782763B-8097-457C-AEA3-67678621DBE0}
{30431891-3929-4394-8049-75055B92315F} = {6782763B-8097-457C-AEA3-67678621DBE0}
{7D841874-815D-43C7-9A3F-DD0AD9BA9D42} = {7C7FC981-8AE7-42C6-962C-4B70D5C20C35}
{037242E4-7C79-401F-A19C-6824B1BB356F} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
{85E4F8C9-366A-4769-8DBC-ABCDE37FD460} = {6782763B-8097-457C-AEA3-67678621DBE0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3DBDA2B-F169-4EDE-9353-858904124B75}

View file

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- note net6.0-maccatalyst is not supported currently. requires a new native build to be added. -->
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.ML.OnnxRuntime.InferenceSample.Maui</RootNamespace>
@ -13,8 +12,8 @@
<!-- Display name -->
<ApplicationTitle>InferenceSample_Maui</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.microsoft.ml.onnxruntime.inferencesample.maui</ApplicationId>
<!-- App Identifier. MUST be short or you'll get a confusing deployment error on Windows -->
<ApplicationId>ORT.InferenceSample.MAUI</ApplicationId>
<ApplicationIdGuid>58af3884-1c25-42b7-b78b-30a65fb3cf69</ApplicationIdGuid>
<!-- Versions -->
@ -66,4 +65,9 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
</ItemGroup>
</Project>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<OnnxRuntimeCsharpRoot>$(ProjectDir)..\..\..</OnnxRuntimeCsharpRoot>
<Configurations>Debug;Release;RelWithDebInfo</Configurations>
@ -71,4 +71,4 @@
<ProjectReference Include="$(OnnxRuntimeCSharpRoot)\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj" />
<ProjectReference Include="..\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj" />
</ItemGroup>
</Project>
</Project>

View file

@ -2,8 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View file

@ -12,6 +12,11 @@ namespace Microsoft.ML.OnnxRuntime.ResNet50v2Sample
{
public static void Main(string[] args)
{
if (args.Length < 2) {
Console.WriteLine("Usage: prog <model.onnx> <image.jpg>");
return;
}
// Read paths
string modelFilePath = args[0];
string imageFilePath = args[1];

View file

@ -0,0 +1,3 @@
See https://onnxruntime.ai/docs/tutorials/csharp/resnet50_csharp.html
NOTE: net8.0 is now required as .NET Core 3.1 is no longer supported.

View file

@ -6,6 +6,5 @@
// Making these assembly's internals visible to the internal Test assembly
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.Common, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.Droid, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.iOS, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.NetCoreApp, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.MAUI, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]

View file

@ -76,9 +76,9 @@ namespace Microsoft.ML.OnnxRuntime
///
/// var memInfo = OrtMemoryInfo.DefaultInstance; // CPU
///
/// using(var fixedBufferInput = FixedBufferOnnxvalue.CreateFromMemory<Half>(memInfo,
/// using(var fixedBufferInput = FixedBufferOnnxvalue.CreateFromMemory{Half}(memInfo,
/// input, TensorElementType.Float16, input_shape, input.Length * sizeof(ushort))
/// using(var fixedBufferOutput = FixedBufferOnnxvalue.CreateFromMemory<Half>(memInfo,
/// using(var fixedBufferOutput = FixedBufferOnnxvalue.CreateFromMemory{Half}(memInfo,
/// output, TensorElementType.Float16, output_shape, output.Length * sizeof(ushort))
/// {
/// FixedBufferOnnxvalue[] inputValues = new FixedBufferOnnxvalue[]{fixedBufferInput};

View file

@ -6,7 +6,7 @@
<PropertyGroup>
<IncludeMobileTargets>true</IncludeMobileTargets>
<BaseTargets>netstandard2.0;net6.0</BaseTargets>
<BaseTargets>netstandard2.0;net8.0</BaseTargets>
<MobileTargets></MobileTargets>
</PropertyGroup>
@ -164,8 +164,9 @@
<OrtConstants>$(OrtConstants);__ENABLE_COREML__</OrtConstants>
</PropertyGroup>
<!-- CoreML may be valid for one of these targets as they support macOS. we do a runtime check that the OS is
macOS before attempting to enable CoreML. This includes netcoreapp3.1 and net6.0
<!-- CoreML is valid for a macOS .net app. Enable in case GetTargetPlatformIdentifier was not set.
TargetFrameworkIdentifier of .netX is '.NETCoreApp'
We do a runtime check that the OS is macOS before attempting to enable CoreML.
NOTE: $(TargetFrameworkIdentitier) may not be set yet, so we need to call GetTargetFrameworkIdentifier
-->
<PropertyGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))=='.NETCoreApp' AND
@ -309,7 +310,7 @@
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>

View file

@ -313,7 +313,7 @@ namespace Microsoft.ML.OnnxRuntime
/// <summary>
/// This fetches bound outputs after running the model with RunWithBinding()
/// </summary>
/// <returns>IDisposableReadOnlyCollection<OrtValue></returns>
/// <returns>IDisposableReadOnlyCollection{OrtValue}</returns>
public IDisposableReadOnlyCollection<OrtValue> GetOutputValues()
{
var ortValues = GetOutputOrtValues();

View file

@ -236,12 +236,12 @@ namespace Microsoft.ML.OnnxRuntime
/// <summary>
/// Fetch string tensor element buffer pointer at the specified index,
/// convert/copy to UTF-16 char[] and return a ReadOnlyMemory<char> instance.
/// convert/copy to UTF-16 char[] and return a ReadOnlyMemory{char} instance.
///
/// Obtain TensorTypeAndShape to get shape and element count.
/// </summary>
/// <param name="index">flat string tensor element index</param>
/// <returns>ReadOnlyMemory<char> backed by a managed char[]. Its lifespan is not
/// <returns>ReadOnlyMemory{char} backed by a managed char[]. Its lifespan is not
/// tied to the native buffer of OrtValue.</returns>
public ReadOnlyMemory<char> GetStringElementAsMemory(int index)
{
@ -845,7 +845,7 @@ namespace Microsoft.ML.OnnxRuntime
/// Note, this is different from creating an OrtValue from other primitive data types
/// where memory is pinned (if necessary) and the OrtValue points to that chunk of memory.
/// </summary>
/// <param name="tensor">Tensor<string></param>
/// <param name="tensor">Tensor{string}</param>
/// <returns>A disposable OrtValue instance</returns>
/// <exception cref="OnnxRuntimeException"></exception>
public static OrtValue CreateFromStringTensor(Tensor<string> tensor)

View file

@ -85,7 +85,7 @@ namespace Microsoft.ML.OnnxRuntime
/// This helper class owns the underlying OrtValue that is assumed to be a Tensor,
/// it does not support any other ortValues and caches Tensor properties.
///
/// It is easy to expose as a Tensor<T> as DenseTensor can take Memory Mapping from
/// It is easy to expose as a Tensor{T} as DenseTensor can take Memory Mapping from
/// this.
///
/// This class is disposable because of the MemoryManager inheritance. Because this class

View file

@ -328,7 +328,9 @@ namespace Microsoft.ML.OnnxRuntime
COREML_FLAG_USE_CPU_ONLY = 0x001,
COREML_FLAG_ENABLE_ON_SUBGRAPH = 0x002,
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE = 0x004,
COREML_FLAG_LAST = COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE,
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008,
COREML_FLAG_CREATE_MLPROGRAM = 0x010,
COREML_FLAG_LAST = COREML_FLAG_CREATE_MLPROGRAM,
}
/// <summary>

View file

@ -15,7 +15,7 @@ using System;
namespace Microsoft.ML.OnnxRuntime.Tensors
{
/// <summary>
/// A static class that houses static DenseTensor<T> extension methods
/// A static class that houses static DenseTensor{T} extension methods
/// </summary>
public static class ArrayTensorExtensions
{

View file

@ -295,7 +295,7 @@ namespace Microsoft.ML.OnnxRuntime
/// <code>
/// using OrtValue x = OrtValue.CreateTensorValueFromMemory(...);
/// using OrtValue label = OrtValue.CreateTensorValueFromMemory(...);
/// List<OrtValue> inputValues = new List<OrtValue> { x, label };
/// List{OrtValue} inputValues = new List{OrtValue} { x, label };
/// using (var loss = trainingSession.TrainStep(inputValues))
/// {
/// // process output values
@ -420,7 +420,7 @@ namespace Microsoft.ML.OnnxRuntime
/// <code>
/// using OrtValue x = OrtValue.CreateTensorValueFromMemory(...);
/// using OrtValue label = OrtValue.CreateTensorValueFromMemory(...);
/// List<OrtValue> inputValues = new List<OrtValue> { x, label };
/// List{OrtValue} inputValues = new List{OrtValue} { x, label };
/// using (var loss = trainingSession.EvalSteps(inputValues))
/// {
/// // process output values

View file

@ -1,13 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="Xamarin.UITest" Version="4.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Xamarin.UITest" Version="3.2.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Microsoft.ML.OnnxRuntime.Tests.Devices\TestResultData.cs">

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.13.2" targetFramework="net472" />
<package id="Xamarin.UITest" version="3.2.0" targetFramework="net472" />
</packages>

View file

@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.810.8
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndToEndTests.Mobile.Automation", "EndToEndTests.Mobile.Automation\EndToEndTests.Mobile.Automation.csproj", "{1019E2BC-55E8-4318-97EF-771380E2EDF1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EndToEndTests.Mobile.Automation", "EndToEndTests.Mobile.Automation\EndToEndTests.Mobile.Automation.csproj", "{1019E2BC-55E8-4318-97EF-771380E2EDF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -1,7 +1,4 @@
NOTE:
These tests no longer work as they are based on App Center's Xamarin.UITest and Xamarin is EOL.
App Center is also deprecated with EOL in 2025.
The tests need to be updated based on the App Center replacement we choose.
The tests need to be updated based on the App Center replacement we choose as App Center EOL is 2025.
If that is BrowserStack, this is most likely applicable: https://learn.microsoft.com/en-us/samples/dotnet/maui-samples/uitest-appium-nunit/

View file

@ -15,7 +15,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(IsLinuxBuild)'=='true'">

View file

@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.810.8
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ML.OnnxRuntime.EndToEndTests", "Microsoft.ML.OnnxRuntime.EndToEndTests.csproj", "{B6FB2796-4CFB-44FF-B826-E1B8CA9E9447}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.EndToEndTests", "Microsoft.ML.OnnxRuntime.EndToEndTests.csproj", "{B6FB2796-4CFB-44FF-B826-E1B8CA9E9447}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -4,7 +4,7 @@ REM Licensed under the MIT License.
@ECHO ON
SETLOCAL EnableDelayedExpansion
SET TargetFramework=netcoreapp5.0
SET TargetFramework=net8.0
SET TargetArch=x64
SET dn="C:\Program Files\dotnet\dotnet"
SET CurrentOnnxRuntimeVersion=""

View file

@ -1,4 +1,3 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.Droid, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.iOS, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.NetCoreApp, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.EndToEndTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.NetCoreApp, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.EndToEndTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.ML.OnnxRuntime.Tests.MAUI, PublicKey=002400000480000094000000060200000024000052534131000400000100010059013e94e4bc70136ca4c35f33acd6b62974536b698f9c7a21cee18d805c7ad860ad9eebfdc47a96ba2f8d03f4cf1c36b9d30787e276c7b9833b5bf2a6eba7e919e6b90083078a352262aed1d842e5f70a3085cbcf4c56ae851b161137920961c23fcc246598d61d258ccc615c927b2441359eea666a99ce1c3c07dca18fb0e1")]

View file

@ -2039,6 +2039,8 @@ namespace Microsoft.ML.OnnxRuntime.Tests
}
}
// Test hangs on mobile.
#if !(ANDROID || IOS)
[Fact(DisplayName = "TestModelRunAsyncTask")]
private async Task TestModelRunAsyncTask()
{
@ -2073,6 +2075,7 @@ namespace Microsoft.ML.OnnxRuntime.Tests
}
}
}
#endif
[Fact(DisplayName = "TestModelRunAsyncTaskFail")]
private async Task TestModelRunAsyncTaskFail()

View file

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- netstandard2.0 is used by most platforms. net6.0 is required for linux. -->
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<!-- netstandard2.0 is used by most platforms. net8.0 is required for linux. -->
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<OnnxRuntimeCsharpRoot>$(ProjectDir)..\..</OnnxRuntimeCsharpRoot>
<Platforms>AnyCPU</Platforms>
@ -12,6 +12,9 @@
<IsMacOSBuild Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsMacOSBuild>
<ProtoSrc>$(OnnxRuntimeCsharpRoot)\..\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>
@ -99,8 +102,13 @@
</None>
</ItemGroup>
<ItemGroup>
<None Condition="'$(IsWindowsBuild)'=='true'" Include="$(NativeBuildOutputDir)\onnxruntime.dll;$(NativeBuildOutputDir)\onnxruntime.pdb">
<!--
Microsoft.ML.OnnxRuntime.Tests.MAUI.csproj handles the native lib coming from a local build or a nuget package so we
don't need to duplicate that logic to include the native lib here.
-->
<ItemGroup Condition="$(SkipNativeLibInclude) != 'true'">
<None Condition="'$(IsWindowsBuild)'=='true'"
Include="$(NativeBuildOutputDir)\onnxruntime.dll;$(NativeBuildOutputDir)\onnxruntime.pdb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>

View file

@ -200,7 +200,7 @@ namespace Microsoft.ML.OnnxRuntime.Tests
long[] shape = { 1, 1, 3 };
var elementsNum = ShapeUtils.GetSizeForShape(shape);
Assert.Equal(elementsNum, Elements);
Assert.Equal(Elements, elementsNum);
using (var tensor = OrtValue.CreateTensorValueWithData(OrtMemoryInfo.DefaultInstance, TensorElementType.Int32,
shape, dataPtr, bufferLen))

View file

@ -1,19 +0,0 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}
Additionally, some Android functions will automatically load asset files:
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

View file

@ -1,14 +0,0 @@
using Xunit;
namespace Microsoft.ML.OnnxRuntime.Tests
{
public partial class InferenceTest
{
[Fact(DisplayName = "TestPlatformSessionOptions")]
public void TestPlatformSessionOptions()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_Nnapi();
}
}
}

View file

@ -1,85 +0,0 @@
using System;
using System.Reflection;
using System.Threading.Tasks;
using Android.App;
using Android.OS;
using Java.Interop;
using Microsoft.ML.OnnxRuntime.Tests.Devices;
using Xunit.Runners;
using Xunit.Runners.UI;
using Xunit.Sdk;
namespace Microsoft.ML.OnnxRuntime.Tests.Droid
{
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)]
public class MainActivity : RunnerActivity
{
OnnxRuntimeResultChannel _resultChannel = new OnnxRuntimeResultChannel();
protected override void OnCreate(Bundle bundle)
{
AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);
AddTestAssembly(Assembly.GetExecutingAssembly());
ResultChannel = _resultChannel;
base.OnCreate(bundle);
}
[Export("GetTestResults")]
public Java.Lang.String GetTestResults()
{
Java.Lang.String results = null;
try
{
var serializedResults = _resultChannel.GetResults();
results = new Java.Lang.String(serializedResults);
}
catch (Exception ex)
{
Android.Util.Log.Error(nameof(MainActivity), ex.Message);
}
return results;
}
}
public class OnnxRuntimeResultChannel : ITestListener, IResultChannel
{
TestResultProcessor _resultProcessor = new TestResultProcessor();
public string GetResults()
=> _resultProcessor?.GetSerializedResults();
public Task CloseChannel()
=> Task.CompletedTask;
public Task<bool> OpenChannel(string message = null)
{
if (_resultProcessor?.Results.Count > 0)
_resultProcessor = new TestResultProcessor();
return Task.FromResult(true);
}
public void RecordResult(TestResultViewModel result)
=> _resultProcessor?.RecordResult(result.TestResultMessage, result.TestCase.TestCase, GetTestOutcomeFromTestState(result.TestCase.Result));
TestOutcome GetTestOutcomeFromTestState(TestState state)
{
switch (state)
{
case TestState.Failed:
return TestOutcome.Failed;
case TestState.NotRun:
return TestOutcome.NotRun;
case TestState.Passed:
return TestOutcome.Passed;
case TestState.Skipped:
return TestOutcome.Skipped;
default:
throw new NotImplementedException();
}
}
}
}

View file

@ -1,176 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{772E0BB4-6B5A-4453-9F4A-034DCBB61B5C}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.ML.OnnxRuntime.Tests.Droid</RootNamespace>
<AssemblyName>Microsoft.ML.OnnxRuntime.Tests.Droid</AssemblyName>
<FileAlignment>512</FileAlignment>
<Deterministic>True</Deterministic>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS8002</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>Full</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS8002</NoWarn>
<BundleAssemblies>true</BundleAssemblies>
<AotAssemblies>true</AotAssemblies>
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
<EnableLLVM>true</EnableLLVM>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidLinkSkip>Microsoft.ML.OnnxRuntime.Tests.Common;Microsoft.ML.OnnxRuntime.Tests.Devices;</AndroidLinkSkip>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="System.Numerics" />
<Reference Include="Mono.Android.Export" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\InferenceTest.cs">
<Link>InferenceTest.cs</Link>
</Compile>
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\OrtIoBindingAllocationTest.cs">
<Link>OrtIoBindingAllocationTest.cs</Link>
</Compile>
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Tensors\TensorTests.cs">
<Link>TensorTests.cs</Link>
</Compile>
<Compile Include="InferenceTest.android.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\activity_main.xml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\values\ic_launcher_background.xml" />
<AndroidResource Include="Resources\values\strings.xml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_round.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit">
<Version>2.9.0</Version>
</PackageReference>
<PackageReference Include="xunit.runner.devices">
<Version>2.5.25</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2083</Version>
</PackageReference>
<PackageReference Include="Google.Protobuf" Version="3.21.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj">
<Project>{584B53B3-359D-4DC2-BCD8-530B5D4685AD}</Project>
<Name>Microsoft.ML.OnnxRuntime</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj">
<Project>{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}</Project>
<Name>Microsoft.ML.OnnxRuntime.Tests.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.ML.OnnxRuntime.Tests.Devices\Microsoft.ML.OnnxRuntime.Tests.Devices.csproj">
<Project>{30431891-3929-4394-8049-75055B92315F}</Project>
<Name>Microsoft.ML.OnnxRuntime.Tests.Devices</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" IncludeAssets="None" />
<AndroidNativeLibrary Condition=" Exists('..\..\..\build\Android\arm64-v8a\Release\libonnxruntime.so') " Include="..\..\..\build\Android\arm64-v8a\Release\libonnxruntime.so">
<Link>libs\arm64-v8a\libonnxruntime.so</Link>
</AndroidNativeLibrary>
<AndroidNativeLibrary Condition=" Exists('..\..\..\build\Android\armeabi-v7a\Release\libonnxruntime.so') " Include="..\..\..\build\Android\armeabi-v7a\Release\libonnxruntime.so">
<Link>libs\armeabi-v7a\libonnxruntime.so</Link>
</AndroidNativeLibrary>
<AndroidNativeLibrary Condition=" Exists('..\..\..\build\Android\x86\Release\libonnxruntime.so') " Include="..\..\..\build\Android\x86\Release\libonnxruntime.so">
<Link>libs\x86\libonnxruntime.so</Link>
</AndroidNativeLibrary>
<AndroidNativeLibrary Condition=" Exists('..\..\..\build\Android\x86_64\Release\libonnxruntime.so') " Include="..\..\..\build\Android\x86_64\Release\libonnxruntime.so">
<Link>libs\x86_64\libonnxruntime.so</Link>
</AndroidNativeLibrary>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.microsoft.onnxruntime_tests_droid" android:installLocation="auto">
<uses-sdk android:minSdkVersion="27" android:targetSdkVersion="33" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View file

@ -1,26 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.ML.OnnxRuntime.Tests.Droid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.ML.OnnxRuntime.Tests.Droid")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,15 +0,0 @@
To test you need the libonnxruntime.so for the various Android architectures.
The test project looks for these in '..\..\..\build\Android\<architecture>\Release\libonnxruntime.so'.
e.g. '..\..\..\build\Android\arm64-v8a\Release\libonnxruntime.so'
'..\..\..' is the root directory of the repository.
Build onnxruntime for the required architecture if you're testing changes in the native code.
Alternatively, if you're testing the C# code you can extract the AAR from the nightly nuget Microsoft.ML.OnnxRuntime package.
- Get the nupkg from https://aiinfra.visualstudio.com/PublicPackages/_artifacts/feed/ORT-Nightly
- Unzip it, and the AAR is in `runtimes/android/native/onnxruntime.aar`.
- Unzip the AAR. The `jni` directory contains a directory for each architecture with the libonnxruntime.so.
- Copy the libonnxruntime.so for the required architectures to /build/Android/<architecture>/Release.
- e.g. x86_64 for running the emulator on an amd64 machine, and arm64-v8a for running on an arm64 Android device

View file

@ -1,44 +0,0 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.xml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#2c3e50</color>
<color name="colorPrimaryDark">#1B3147</color>
<color name="colorAccent">#3498db</color>
</resources>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2C3E50</color>
</resources>

View file

@ -1,4 +0,0 @@
<resources>
<string name="app_name">Microsoft.ML.OnnxRuntime.Tests.Droid</string>
<string name="action_settings">Settings</string>
</resources>

View file

@ -1,19 +0,0 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="MainTheme.Base">
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary -->
<!-- If you want to override anything you can do that here. -->
<!-- Underneath are a couple of entries to get you started. -->
<!-- Set theme colors from https://aka.ms/material-colors -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#1976D2</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#3498db</item>
</style>
</resources>

View file

@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Microsoft.ML.OnnxRuntime.Tests.MAUI"
x:Class="Microsoft.ML.OnnxRuntime.Tests.MAUI.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -0,0 +1,12 @@
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new AppShell();
}
}
}

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="Microsoft.ML.OnnxRuntime.Tests.MAUI.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Microsoft.ML.OnnxRuntime.Tests.MAUI"
Shell.FlyoutBehavior="Disabled"
Title="Microsoft.ML.OnnxRuntime.Tests.MAUI">
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />
</Shell>

View file

@ -0,0 +1,10 @@
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Microsoft.ML.OnnxRuntime.Tests.MAUI.MainPage">
<ScrollView>
<VerticalStackLayout
Padding="30,0"
Spacing="25">
<Image
Source="dotnet_bot.png"
HeightRequest="185"
Aspect="AspectFit"
SemanticProperties.Description="dot net bot in a race car number eight" />
<Label
Text="Hello, World!"
Style="{StaticResource Headline}"
SemanticProperties.HeadingLevel="Level1" />
<Label
Text="Welcome to &#10;.NET Multi-platform App UI"
Style="{StaticResource SubHeadline}"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I" />
<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Fill" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

View file

@ -0,0 +1,25 @@
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
private void OnCounterClicked(object sender, EventArgs e)
{
count++;
if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";
SemanticScreenReader.Announce(CounterBtn.Text);
}
}
}

View file

@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Based on https://github.com/mattleibow/DeviceRunners/tree/main/sample/SampleMauiApp
using DeviceRunners.VisualRunners;
using Microsoft.Extensions.Logging;
#if MODE_XHARNESS
using DeviceRunners.XHarness;
#endif
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
// .ConfigureUITesting()
#if MODE_XHARNESS
.UseXHarnessTestRunner(conf => conf
.AddTestAssembly(typeof(MauiProgram).Assembly)
.AddXunit())
#endif
.UseVisualTestRunner(conf => conf
//#if MODE_NON_INTERACTIVE_VISUAL
// .EnableAutoStart(true)
// .AddTcpResultChannel(new TcpResultChannelOptions
// {
// HostNames = ["localhost", "10.0.2.2"],
// Port = 16384,
// Formatter = new TextResultChannelFormatter(),
// Required = false
// })
//#endif
.AddConsoleResultChannel()
.AddTestAssembly(typeof(MauiProgram).Assembly)
.AddXunit());
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}

View file

@ -0,0 +1,298 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- ORT specific high level properties -->
<PropertyGroup>
<IsWindowsBuild Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true</IsWindowsBuild>
<IsAndroidBuild Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">true</IsAndroidBuild>
<IsIOSBuild Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</IsIOSBuild>
<IsMacCatalystBuild Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">true</IsMacCatalystBuild>
<OnnxRuntimeRoot>$(ProjectDir)..\..\..</OnnxRuntimeRoot>
</PropertyGroup>
<!-- General app properties -->
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.ML.OnnxRuntime.Tests.MAUI</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- some of the helper packages don't have strong named assemblies. -->
<NoWarn>8002</NoWarn>
<!-- These are copied from the sample. TBD what we really need. -->
<DefineConstants Condition="'$(CI)' != 'true'">$(DefineConstants);INCLUDE_FAILING_TESTS</DefineConstants>
<DefineConstants Condition="'$(TestingMode)' == 'NonInteractiveVisual'">$(DefineConstants);MODE_NON_INTERACTIVE_VISUAL</DefineConstants>
<DefineConstants Condition="'$(TestingMode)' == 'XHarness'">$(DefineConstants);MODE_XHARNESS</DefineConstants>
<!-- Display name -->
<ApplicationTitle>Microsoft.ML.OnnxRuntime.Tests.MAUI</ApplicationTitle>
<!-- App Identifier. MUST be short or you get a misleading error about not being able to deploy the app -->
<ApplicationId>ORT.CSharp.Tests.MAUI</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="'$(IsIOSBuild)' == 'true'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(IsMacCatalystBuild)' == 'true'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(IsAndroidBuild)' == 'true'">30.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(IsWindowsBuild)' == 'true'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="'$(IsWindowsBuild)' == 'true'">10.0.17763.0</TargetPlatformMinVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
<!-- Multiple csproj files copy the ORT dll and pdb files. -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<!--
Setup directories to find ORT native binary.
You can use a released Microsoft.ML.OnnxRuntime nuget package or a recent build from
https://aiinfra.visualstudio.com/PublicPackages/_artifacts/feed/ORT-Nightly if testing C# changes.
The native nuget package contains Windows, Android, macOS, mac-catalyst and iOS builds.
Unzip the nupkg file in the /build directory to create /build/microsoft.ml.onnxruntime.1.18.1 directory.
Adjust the version number as needed.
If testing changes to the native library, build locally with the `<dash><dash>build_csharp` flag so that
OnnxRuntimeBuildDirectory is set to the build output directory. Adjust the build path if necessary.
-->
<PropertyGroup>
<PrebuiltRuntimesDir>$(OnnxRuntimeRoot)\build\microsoft.ml.onnxruntime.1.18.1\runtimes</PrebuiltRuntimesDir>
<!--
set this so Microsoft.ML.OnnxRuntime.Tests.Common.csproj lets us do the include of the native library
as it may come from a local build or a nuget package. This saves duplicating the include logic.
-->
<SkipNativeLibInclude>true</SkipNativeLibInclude>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindowsBuild)' == 'true'">
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeRoot)\build\Windows</OnnxRuntimeBuildDirectory>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)</NativeBuildOutputDir>
<!-- TODO: support other architectures if needed. -->
<PrebuiltWinDir>$(PrebuiltRuntimesDir)\win-x64\native</PrebuiltWinDir>
</PropertyGroup>
<PropertyGroup Condition="'$(IsAndroidBuild)' == 'true'">
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeRoot)\build\Android</OnnxRuntimeBuildDirectory>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)</NativeBuildOutputDir>
<PrebuiltAAR>$(PrebuiltRuntimesDir)\android\native\onnxruntime.aar</PrebuiltAAR>
</PropertyGroup>
<PropertyGroup Condition="'$(IsIOSBuild)' == 'true'">
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeRoot)\build\iOS</OnnxRuntimeBuildDirectory>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<PlatformLower>$(Platform.ToLower())</PlatformLower>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)-$(PlatformLower)</NativeBuildOutputDir>
<PrebuiltFramework>$(PrebuiltRuntimesDir)\ios\native\onnxruntime.xcframework</PrebuiltFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(IsMacCatalystBuild)' == 'true'">
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">$(OnnxRuntimeRoot)\build\macOS</OnnxRuntimeBuildDirectory>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)</NativeBuildOutputDir>
<PrebuiltFramework>$(PrebuiltRuntimesDir)\ios\native\onnxruntime.xcframework</PrebuiltFramework>
</PropertyGroup>
<ItemGroup Condition="'$(IsWindowsBuild)' == 'true'">
<!-- local build -->
<None Condition="Exists('$(NativeBuildOutputDir)\onnxruntime.dll')"
Include="$(NativeBuildOutputDir)\*.dll;$(NativeBuildOutputDir)\*.pdb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>true</Visible>
</None>
<!-- build from package -->
<None Condition="!Exists('$(NativeBuildOutputDir)\onnxruntime.dll')"
Include="$(PrebuiltWinDir)\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>true</Visible>
</None>
<!-- test data -->
<None Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\overridable_initializer.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\capi_symbolic_dims.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
<None Include="$(OnnxRuntimeRoot)\onnxruntime\test\testdata\custom_op_library\custom_op_test.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
</ItemGroup>
<ItemGroup Condition="'$(IsAndroidBuild)' == 'true'">
<!-- local build -->
<AndroidNativeLibrary Condition="Exists('$(NativeBuildOutputDir)\libonnxruntime.so')"
Include="$(NativeBuildOutputDir)\libonnxruntime.so">
<Link>libs\libonnxruntime.so</Link>
</AndroidNativeLibrary>
<!-- build from package -->
<AndroidLibrary
Bind="false"
Condition="Exists('$(PrebuiltAAR)') AND !Exists('$(NativeBuildOutputDir)\libonnxruntime.so')"
Include="$(PrebuiltAAR)"/>
</ItemGroup>
<ItemGroup Condition="'$(IsIOSBuild)' == 'true'">
<!-- local build of shared lib -->
<NativeReference
Condition="Exists('$(NativeBuildOutputDir)\libonnxruntime.dylib')"
Include="$(NativeBuildOutputDir)\libonnxruntime.dylib">
<Link>libs\libonnxruntime.dylib</Link>
<Kind>Dynamic</Kind>
<ForceLoad>True</ForceLoad>
<IsCxx>True</IsCxx>
</NativeReference>
<!-- build from package -->
<NativeReference
Condition="Exists('$(PrebuiltFramework)') AND !Exists('$(NativeBuildOutputDir)\libonnxruntime.dylib')"
Include="$(PrebuiltFramework)">
<Kind>Framework</Kind>
<ForceLoad>True</ForceLoad>
<IsCxx>True</IsCxx>
</NativeReference>
</ItemGroup>
<ItemGroup Condition="'$(IsMacCatalystBuild)' == 'true'">
<!-- local build -->
<NativeReference Condition="Exists('$(NativeBuildOutputDir)\libonnxruntime.dylib')"
Include="$(NativeBuildOutputDir)\libonnxruntime.dylib">
<Link>libs\libonnxruntime.dylib</Link>
<Kind>Dynamic</Kind>
<ForceLoad>True</ForceLoad>
<IsCxx>True</IsCxx>
</NativeReference>
<!-- build from package -->
<NativeReference
Condition="Exists('$(PrebuiltFramework)') AND !Exists('$(NativeBuildOutputDir)\libonnxruntime.dylib')"
Include="$(PrebuiltFramework)">
<Kind>Framework</Kind>
<ForceLoad>True</ForceLoad>
<IsCxx>True</IsCxx>
</NativeReference>
</ItemGroup>
<!-- Property debug output - makes finding/fixing any issues with the conditions easy. -->
<PropertyGroup>
<!-- local builds-->
<HaveOrtDll>false</HaveOrtDll>
<HaveOrtDll Condition="Exists('$(NativeBuildOutputDir)\onnxruntime.dll')">true</HaveOrtDll>
<HaveOrtSo>false</HaveOrtSo>
<HaveOrtSo Condition="Exists('$(NativeBuildOutputDir)\libonnxruntime.so')">true</HaveOrtSo>
<HaveOrtDylib>false</HaveOrtDylib>
<HaveOrtDylib Condition="Exists('$(NativeBuildOutputDir)\libonnxruntime.dylib')">true</HaveOrtDylib>
<!-- prebuilt -->
<HavePrebuilt>false</HavePrebuilt>
<HavePrebuilt Condition="Exists('$(PrebuiltWinDir)')">true</HavePrebuilt>
<HaveAAR>false</HaveAAR>
<HaveAAR Condition="Exists('$(PrebuiltAAR)')">true</HaveAAR>
<HaveFramework>false</HaveFramework>
<HaveFramework Condition="Exists('$(PrebuiltFramework)')">true</HaveFramework>
</PropertyGroup>
<Target Name="DumpValues" BeforeTargets="PreBuildEvent">
<Message Text="TargetFramework=$(TargetFramework)" />
<Message Text="Platform=$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))" />
<Message Text="OnnxRuntimeRoot=$(OnnxRuntimeRoot)" />
<Message Text="NativeBuildOutputDir=$(NativeBuildOutputDir)" />
<Message Text="IsWindowsBuild='$(IsWindowsBuild)'" />
<Message Text="IsAndroidBuild='$(IsAndroidBuild)'" />
<Message Text="IsIOSBuild='$(IsIOSBuild)'" />
<Message Text="IsMacCatalystBuild='$(IsMacCatalystBuild)'" />
<Message Text="onnxruntime.dll from local build=$(HaveOrtDll)" />
<Message Text="libonnxruntime.so from local build=$(HaveOrtSo)" />
<Message Text="libonnxruntime.dylib from local build=$(HaveOrtDylib)" />
<Message Text="Prebuilt runtime=$(HavePrebuilt)" />
<Message Text="Prebuilt AAR=$(HaveAAR)" />
<Message Text="Prebuilt xcframework=$(HaveFramework)" />
</Target>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\InferenceTest.cs">
<Link>InferenceTest.cs</Link>
</Compile>
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\OrtIoBindingAllocationTest.cs">
<Link>OrtIoBindingAllocationTest.cs</Link>
</Compile>
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Tensors\TensorTests.cs">
<Link>TensorTests.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include="..\..\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
name="Microsoft.ML.OnnxRuntime" />
<ProjectReference
Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj"
name="Microsoft.ML.OnnxRuntime.Tests.Common" />
<ProjectReference
Include="..\Microsoft.ML.OnnxRuntime.Tests.Devices\Microsoft.ML.OnnxRuntime.Tests.Devices.csproj"
name="Microsoft.ML.OnnxRuntime.Tests.Devices" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DeviceRunners.VisualRunners.Maui" Version="0.1.0-preview.2" />
<PackageReference Include="DeviceRunners.VisualRunners.Xunit" Version="0.1.0-preview.2" />
<PackageReference Include="DeviceRunners.XHarness.Maui" Version="0.1.0-preview.2" />
<PackageReference Include="DeviceRunners.XHarness.Xunit" Version="0.1.0-preview.2" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24374.1" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.utility" Version="2.9.0" />
</ItemGroup>
<ItemGroup Condition="$(IsIOSBuild)=='true' OR $(IsMacCatalystBuild)=='true'">
<!-- need the dummy ORT Extensions package to resolve the RegisterCustomOps symbol.
TODO: Update to 0.12.0 when released so there's a mac-catalyst build in the package. -->
<PackageReference Include="Microsoft.ML.OnnxRuntime.Extensions.Dummy" Version="0.10.0" />
</ItemGroup>
<Target Name="RemoveVisualStudioTestRunner" BeforeTargets="_ComputeAppxPackagePayload">
<ItemGroup>
<_VisualStudioTestRunnerFiles Include="@(PackagingOutputs)" Condition="$([System.String]::Copy('%(PackagingOutputs.FullPath)').Contains('xunit.runner.visualstudio'))" />
<PackagingOutputs Remove="@(_VisualStudioTestRunnerFiles)" />
</ItemGroup>
</Target>
</Project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="false" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View file

@ -0,0 +1,11 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
}

View file

@ -0,0 +1,16 @@
using Android.App;
using Android.Runtime;
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View file

@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class PlatformTests
{
// All the 'AppendExecutionProvider' calls will throw if unsuccessful
[Fact(DisplayName = "EnableNNAPI")]
public void TestEnableNNAPI()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_Nnapi();
}
}
}

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>

View file

@ -0,0 +1,10 @@
using Foundation;
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
<dict>
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- The Mac App Store requires you specify if the app uses encryption. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
<!-- Please indicate <true/> or <false/> here. -->
<!-- Specify the category for your app here. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
<!-- <key>LSApplicationCategoryType</key> -->
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

View file

@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class PlatformTests
{
[Fact(DisplayName = "EnableCoreML_NeuralNetwork")]
public void TestEnableCoreML_NN()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_CoreML(CoreMLFlags.COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE);
}
[Fact(DisplayName = "EnableCoreML_MLProgram")]
public void TestEnableCoreML_MLProgram()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_CoreML(CoreMLFlags.COREML_FLAG_CREATE_MLPROGRAM);
}
}
}

View file

@ -1,8 +1,9 @@
using UIKit;
using ObjCRuntime;
using UIKit;
namespace Microsoft.ML.OnnxRuntime.Tests.iOS
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class Application
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
@ -12,4 +13,4 @@ namespace Microsoft.ML.OnnxRuntime.Tests.iOS
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}
}

View file

@ -0,0 +1,8 @@
<maui:MauiWinUIApplication
x:Class="Microsoft.ML.OnnxRuntime.Tests.MAUI.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:Microsoft.ML.OnnxRuntime.Tests.MAUI.WinUI">
</maui:MauiWinUIApplication>

View file

@ -0,0 +1,25 @@
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<mp:PhoneIdentity PhoneProductId="74E7D471-A84D-42E5-91D1-4544AFE0E5ED" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>$placeholder$</DisplayName>
<PublisherDisplayName>User Name</PublisherDisplayName>
<Logo>$placeholder$.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="$placeholder$"
Description="$placeholder$"
Square150x150Logo="$placeholder$.png"
Square44x44Logo="$placeholder$.png"
BackgroundColor="transparent">
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
<uap:SplashScreen Image="$placeholder$.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View file

@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class PlatformTests
{
// Semi-random test to check we can add an EP
[Fact(DisplayName = "CPU_EP_NoArena")]
public void TestEnableCpuEPWithNoArena()
{
var opt = new SessionOptions();
int useArena = 0;
opt.AppendExecutionProvider_CPU(useArena);
}
}
}

View file

@ -0,0 +1,10 @@
using Foundation;
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View file

@ -2,25 +2,17 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Microsoft.ML.OnnxRuntime.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>com.Microsoft.OnnxRuntime-Tests-iOS</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>11.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@ -35,6 +27,6 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

View file

@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class PlatformTests
{
[Fact(DisplayName = "EnableCoreML_NeuralNetwork")]
public void TestEnableCoreML_NN()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_CoreML(CoreMLFlags.COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE);
}
[Fact(DisplayName = "EnableCoreML_MLProgram")]
public void TestEnableCoreML_MLProgram()
{
var opt = new SessionOptions();
opt.AppendExecutionProvider_CoreML(CoreMLFlags.COREML_FLAG_CREATE_MLPROGRAM);
}
}
}

View file

@ -0,0 +1,16 @@
using ObjCRuntime;
using UIKit;
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI
{
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}

View file

@ -0,0 +1,8 @@
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": false
}
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="456" height="456" fill="#512BD4" />
</svg>

After

Width:  |  Height:  |  Size: 228 B

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -0,0 +1,15 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories). Deployment of the asset to your application
is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
These files will be deployed with your package and will be accessible using Essentials:
async Task LoadMauiAsset()
{
using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
using var reader = new StreamReader(stream);
var contents = reader.ReadToEnd();
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<!-- Note: For Android please see also Platforms\Android\Resources\values\colors.xml -->
<Color x:Key="Primary">#512BD4</Color>
<Color x:Key="PrimaryDark">#ac99ea</Color>
<Color x:Key="PrimaryDarkText">#242424</Color>
<Color x:Key="Secondary">#DFD8F7</Color>
<Color x:Key="SecondaryDarkText">#9880e5</Color>
<Color x:Key="Tertiary">#2B0B98</Color>
<Color x:Key="White">White</Color>
<Color x:Key="Black">Black</Color>
<Color x:Key="Magenta">#D600AA</Color>
<Color x:Key="MidnightBlue">#190649</Color>
<Color x:Key="OffBlack">#1f1f1f</Color>
<Color x:Key="Gray100">#E1E1E1</Color>
<Color x:Key="Gray200">#C8C8C8</Color>
<Color x:Key="Gray300">#ACACAC</Color>
<Color x:Key="Gray400">#919191</Color>
<Color x:Key="Gray500">#6E6E6E</Color>
<Color x:Key="Gray600">#404040</Color>
<Color x:Key="Gray900">#212121</Color>
<Color x:Key="Gray950">#141414</Color>
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/>
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/>
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/>
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/>
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/>
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/>
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/>
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/>
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/>
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/>
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/>
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/>
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/>
</ResourceDictionary>

View file

@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Style TargetType="ActivityIndicator">
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
</Style>
<Style TargetType="IndicatorView">
<Setter Property="IndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}"/>
<Setter Property="SelectedIndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray100}}"/>
</Style>
<Style TargetType="Border">
<Setter Property="Stroke" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
<Setter Property="StrokeShape" Value="Rectangle"/>
<Setter Property="StrokeThickness" Value="1"/>
</Style>
<Style TargetType="BoxView">
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="Button">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource PrimaryDarkText}}" />
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="BorderWidth" Value="0"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver" />
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="CheckBox">
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="DatePicker">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Editor">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14" />
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Entry">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14" />
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Frame">
<Setter Property="HasShadow" Value="False" />
<Setter Property="BorderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
</Style>
<Style TargetType="ImageButton">
<Setter Property="Opacity" Value="1" />
<Setter Property="BorderColor" Value="Transparent"/>
<Setter Property="BorderWidth" Value="0"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver" />
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Label">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Span">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
</Style>
<Style TargetType="Label" x:Key="Headline">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource MidnightBlue}, Dark={StaticResource White}}" />
<Setter Property="FontSize" Value="32" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
<Style TargetType="Label" x:Key="SubHeadline">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource MidnightBlue}, Dark={StaticResource White}}" />
<Setter Property="FontSize" Value="24" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
<Style TargetType="ListView">
<Setter Property="SeparatorColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
<Setter Property="RefreshControlColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="Picker">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="ProgressBar">
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="RadioButton">
<Setter Property="BackgroundColor" Value="Transparent"/>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="RefreshView">
<Setter Property="RefreshColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="SearchBar">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" />
<Setter Property="CancelButtonColor" Value="{StaticResource Gray500}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="FontSize" Value="14" />
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="SearchHandler">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" />
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Shadow">
<Setter Property="Radius" Value="15" />
<Setter Property="Opacity" Value="0.5" />
<Setter Property="Brush" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}" />
<Setter Property="Offset" Value="10,10" />
</Style>
<Style TargetType="Slider">
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="SwipeItem">
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
</Style>
<Style TargetType="Switch">
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="ThumbColor" Value="{StaticResource White}" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="On">
<VisualState.Setters>
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray200}}" />
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Off">
<VisualState.Setters>
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="TimePicker">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="BackgroundColor" Value="Transparent"/>
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Page" ApplyToDerivedTypes="True">
<Setter Property="Padding" Value="0"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
</Style>
<Style TargetType="Shell" ApplyToDerivedTypes="True">
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
<Setter Property="Shell.ForegroundColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" />
<Setter Property="Shell.NavBarHasShadow" Value="False" />
<Setter Property="Shell.TabBarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
<Setter Property="Shell.TabBarForegroundColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
<Setter Property="Shell.TabBarTitleColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
<Setter Property="Shell.TabBarUnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" />
<Setter Property="IconColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" />
</Style>
<Style TargetType="TabbedPage">
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray950}}" />
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
<Setter Property="UnselectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
</Style>
</ResourceDictionary>

View file

@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
global using Xunit;

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<OnnxRuntimeCsharpRoot>$(ProjectDir)..\..</OnnxRuntimeCsharpRoot>
<Platforms>AnyCPU;x86</Platforms>
@ -52,7 +52,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Targets" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />

View file

@ -1,93 +0,0 @@
using System;
using System.Reflection;
using System.Threading.Tasks;
using Foundation;
using Microsoft.ML.OnnxRuntime.Tests.Devices;
using UIKit;
using Xunit.Runner;
using Xunit.Runners;
using Xunit.Sdk;
namespace Microsoft.ML.OnnxRuntime.Tests.iOS
{
[Register("AppDelegate")]
public partial class AppDelegate : RunnerAppDelegate
{
#if __NATIVE_DEPENDENCIES_EXIST__
OnnxRuntimeResultChannel _resultChannel = new OnnxRuntimeResultChannel();
#endif
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Xamarin.Calabash.Start();
AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);
#if __NATIVE_DEPENDENCIES_EXIST__
AddTestAssembly(Assembly.GetExecutingAssembly());
ResultChannel = _resultChannel;
#endif
return base.FinishedLaunching(app, options);
}
[Export("getTestResults")]
public NSString GetTestResults()
{
NSString results = null;
try
{
#if __NATIVE_DEPENDENCIES_EXIST__
var serializedResults = _resultChannel.GetResults();
if (serializedResults != null) results = new NSString(serializedResults);
#endif
}
catch (Exception ex)
{
CoreFoundation.OSLog.Default.Log(CoreFoundation.OSLogLevel.Error, ex.Message);
}
return results;
}
}
#if __NATIVE_DEPENDENCIES_EXIST__
public class OnnxRuntimeResultChannel : ITestListener, IResultChannel
{
TestResultProcessor _resultProcessor;
public string GetResults()
=> _resultProcessor.GetSerializedResults();
public Task CloseChannel()
=> Task.CompletedTask;
public Task<bool> OpenChannel(string message = null)
{
_resultProcessor = new TestResultProcessor();
return Task.FromResult(true);
}
public void RecordResult(TestResultViewModel result)
=> _resultProcessor?.RecordResult(result.TestResultMessage, result.TestCase.TestCase, GetTestOutcomeFromTestState(result.TestCase.Result));
TestOutcome GetTestOutcomeFromTestState(TestState state)
{
switch (state)
{
case TestState.Failed:
return TestOutcome.Failed;
case TestState.NotRun:
return TestOutcome.NotRun;
case TestState.Passed:
return TestOutcome.Passed;
case TestState.Skipped:
return TestOutcome.Skipped;
default:
throw new System.NotImplementedException();
}
}
}
#endif
}

View file

@ -1,117 +0,0 @@
{
"images": [
{
"scale": "2x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon40.png"
},
{
"scale": "3x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon60.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon58.png"
},
{
"scale": "3x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon87.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon80.png"
},
{
"scale": "3x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "2x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "3x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon180.png"
},
{
"scale": "1x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon20.png"
},
{
"scale": "2x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "1x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon29.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon58.png"
},
{
"scale": "1x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon80.png"
},
{
"scale": "1x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon76.png"
},
{
"scale": "2x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon152.png"
},
{
"scale": "2x",
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "Icon167.png"
},
{
"scale": "1x",
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "Icon1024.png"
}
],
"properties": {},
"info": {
"version": 1,
"author": "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Some files were not shown because too many files have changed in this diff Show more