onnxruntime/csharp/tools/MauiModelTester/MauiProgram.cs
Scott McKay ca0159b45d
Various test infra updates from testing Azure ops with MAUI test app (#17262)
### Description
<!-- Describe your changes. -->
- fix issue with handling string input
- set minSdkVersion
  - otherwise defaults to 19 which we don't support and the build breaks
- comment out the debug logging hook
  - enabling it breaks the Android native logging
  - can be enabled if you need to debug C# code
- update test data tools to allow creating input data for raw file
contents (e.g. audio) and from strings (e.g. auth token value)
- fix some warnings

### 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. -->
Improve test setup
2023-08-27 09:35:00 +10:00

29 lines
1.2 KiB
C#

using Microsoft.Extensions.Logging;
namespace MauiModelTester;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder.UseMauiApp<App>().ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
// NOTE: Enabling this does allow Debug.WriteLine to work for debugging C# code.
// However it seems to kill native logging on Android using __android_log_print that ORT and
// onnxruntime-extensions use, at least in the emulator. Due to that, enabled if you want to debug C#
// code and disable to debug native code.
//
// Add the extension debug logger so Debug.WriteLine output shows up in the Output window when running in VS
// builder.Logging.AddDebug();
// System.Diagnostics.Debug.WriteLine("Debug output enabled.");
#endif
return builder.Build();
}
}