From 8f19776297fb6d4871295e3567ce887f301ab328 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Tue, 11 Jun 2024 09:56:17 -0600 Subject: [PATCH] init Icu on startup for dev, add an Icu binary project reference --- backend/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj | 1 + backend/FwDataMiniLcmBridge/LcmUtils/ProjectLoader.cs | 4 +++- backend/LocalWebApp/Program.cs | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj b/backend/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj index 5653c08f1..f7b18e4ae 100644 --- a/backend/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj +++ b/backend/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj @@ -9,6 +9,7 @@ + diff --git a/backend/FwDataMiniLcmBridge/LcmUtils/ProjectLoader.cs b/backend/FwDataMiniLcmBridge/LcmUtils/ProjectLoader.cs index 8abce1bfd..9ab99f34b 100644 --- a/backend/FwDataMiniLcmBridge/LcmUtils/ProjectLoader.cs +++ b/backend/FwDataMiniLcmBridge/LcmUtils/ProjectLoader.cs @@ -1,4 +1,5 @@ -using SIL.LCModel; +using System.Diagnostics; +using SIL.LCModel; using SIL.WritingSystems; namespace FwDataMiniLcmBridge.LcmUtils; @@ -17,6 +18,7 @@ public static void Init() } Icu.Wrapper.Init(); + Debug.Assert(Icu.Wrapper.IcuVersion == "72.1.0.3"); Sldr.Initialize(); _init = true; } diff --git a/backend/LocalWebApp/Program.cs b/backend/LocalWebApp/Program.cs index d5a1bdf99..2f88cf432 100644 --- a/backend/LocalWebApp/Program.cs +++ b/backend/LocalWebApp/Program.cs @@ -12,6 +12,11 @@ var builder = WebApplication.CreateBuilder(args); if (!builder.Environment.IsDevelopment()) builder.WebHost.UseUrls("http://127.0.0.1:0"); +if (builder.Environment.IsDevelopment()) +{ + //do this early so we catch bugs on startup + ProjectLoader.Init(); +} builder.ConfigureDev(config => config.DefaultAuthority = new("https://lexbox.dev.languagetechnology.org")); //for now prod builds will also use lt dev until we deploy oauth to prod builder.ConfigureProd(config => config.DefaultAuthority = new("https://lexbox.dev.languagetechnology.org"));