mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Add custom resolver for libcoreclr.so
This commit is contained in:
13
.github/workflows/codeql-analysis.yml
vendored
13
.github/workflows/codeql-analysis.yml
vendored
@@ -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
|
||||
|
||||
4
.github/workflows/dotnet-core.yml
vendored
4
.github/workflows/dotnet-core.yml
vendored
@@ -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/
|
||||
|
||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -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: true
|
||||
INCLUDE_SYMBOLS: false
|
||||
|
||||
@@ -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<T>(ptr); // non-generic version is obsolete
|
||||
return Marshal.GetDelegateForFunctionPointer<T>(ptr); // non-generic version is obsolete
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -258,6 +258,17 @@ namespace Unix.Terminal {
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
|
||||
<RootNamespace>Terminal.Gui</RootNamespace>
|
||||
<AssemblyName>Terminal.Gui</AssemblyName>
|
||||
<DocumentationFile>bin\Release\Terminal.Gui.xml</DocumentationFile>
|
||||
|
||||
@@ -30,6 +30,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using NStack;
|
||||
|
||||
using Rune = System.Rune;
|
||||
|
||||
namespace Terminal.Gui {
|
||||
class TextModel {
|
||||
List<List<Rune>> lines = new List<List<Rune>> ();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<StartupObject>UICatalog.UICatalogApp</StartupObject>
|
||||
<AssemblyVersion>1.0.0.1</AssemblyVersion>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user