diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d9e00a439..5aeee7442 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,8 +33,17 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v1 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100-rc.1.20452.10 + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index a81b5b83f..b6c5e15db 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -16,10 +16,10 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.200 + dotnet-version: 5.0.100-rc.1.20452.10 - name: Install dependencies run: dotnet restore - name: Build run: dotnet build --configuration Release --no-restore - name: Test - run: dotnet test --no-restore --verbosity normal + run: dotnet test --no-restore --verbosity normal UnitTests/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 869355f3f..50e8ce62c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.200 + dotnet-version: 5.0.100-rc.1.20452.10 # Publish - name: publish on version change @@ -48,4 +48,4 @@ jobs: # NUGET_SOURCE: https://api.nuget.org # Flag to toggle pushing symbols along with nuget package to the server, disabled by default - INCLUDE_SYMBOLS: false \ No newline at end of file + INCLUDE_SYMBOLS: false diff --git a/Terminal.Gui/ConsoleDrivers/CursesDriver/UnmanagedLibrary.cs b/Terminal.Gui/ConsoleDrivers/CursesDriver/UnmanagedLibrary.cs index 46360d8c0..30c204a1c 100644 --- a/Terminal.Gui/ConsoleDrivers/CursesDriver/UnmanagedLibrary.cs +++ b/Terminal.Gui/ConsoleDrivers/CursesDriver/UnmanagedLibrary.cs @@ -170,7 +170,7 @@ namespace Unix.Terminal { if (ptr == IntPtr.Zero) { throw new MissingMethodException (string.Format ("The native method \"{0}\" does not exist", methodName)); } - return Marshal.GetDelegateForFunctionPointer(ptr); // non-generic version is obsolete + return Marshal.GetDelegateForFunctionPointer(ptr); // non-generic version is obsolete } /// @@ -258,6 +258,17 @@ namespace Unix.Terminal { /// static class CoreCLR { +#if NET5_0 + // Custom resolver to support true single-file apps + // (those which run directly from bundle; in-memory). + // -1 on Unix means self-referencing binary (libcoreclr.so) + // 0 means fallback to CoreCLR's internal resolution + // Note: meaning of -1 stay the same even for non-single-file form factors. + static CoreCLR() => NativeLibrary.SetDllImportResolver(typeof(CoreCLR).Assembly, + (string libraryName, Assembly assembly, DllImportSearchPath? searchPath) => + libraryName == "libcoreclr.so" ? (IntPtr)(-1) : IntPtr.Zero); +#endif + [DllImport ("libcoreclr.so")] internal static extern IntPtr dlopen (string filename, int flags); diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index c19017bf6..166371c8b 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -1,6 +1,6 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 Terminal.Gui Terminal.Gui bin\Release\Terminal.Gui.xml diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 398bd926b..2505e3ce7 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -30,6 +30,8 @@ using System.Linq; using System.Text; using NStack; +using Rune = System.Rune; + namespace Terminal.Gui { class TextModel { List> lines = new List> (); diff --git a/UICatalog/UICatalog.csproj b/UICatalog/UICatalog.csproj index 3a48a8ab4..530eed77d 100644 --- a/UICatalog/UICatalog.csproj +++ b/UICatalog/UICatalog.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 UICatalog.UICatalogApp 1.0.0.1 8.0 diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 942c70395..0faffbac4 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false