diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-11-19 09:12:12 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-11-19 09:12:12 +0100 |
| commit | a77e1d7b06d860e040097b72cb9244a45e634e62 (patch) | |
| tree | 9dd6aa8227230ef0d8fcdf0e231d79cc5d3655a3 /Samples | |
| parent | 060b89f24df61f71f281989ce81368dbefb47886 (diff) | |
save commit
Diffstat (limited to 'Samples')
| -rw-r--r-- | Samples/BasicTests/BasicTests.cs | 6 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/Program.cs | 3 | ||||
| -rw-r--r-- | Samples/Directory.Build.props | 6 | ||||
| -rw-r--r-- | Samples/HelloWorld/HelloWorld.csproj | 2 | ||||
| -rw-r--r-- | Samples/HelloWorld/main.cs | 3 | ||||
| -rw-r--r-- | Samples/ShowCase/ShowCase.cs | 3 | ||||
| -rw-r--r-- | Samples/ShowCase/packages.config | 9 | ||||
| -rw-r--r-- | Samples/common/SampleBase.cs | 22 |
8 files changed, 25 insertions, 29 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 2e42052a..755c4a0b 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using Crow; using Glfw; @@ -12,10 +11,6 @@ namespace tests { static void Main () { -#if NETCOREAPP3_1 - DllMapCore.Resolve.Enable (true); -#endif - using (BasicTests app = new BasicTests ()) { app.Run (); } @@ -49,7 +44,6 @@ namespace tests testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray (); diff --git a/Samples/DebugLogAnalyzer/Program.cs b/Samples/DebugLogAnalyzer/Program.cs index 6be26ced..bb793da3 100644 --- a/Samples/DebugLogAnalyzer/Program.cs +++ b/Samples/DebugLogAnalyzer/Program.cs @@ -13,9 +13,6 @@ namespace DebugLogAnalyzer { static void Main (string [] args) { -#if NETCOREAPP3_1 - DllMapCore.Resolve.Enable (true); -#endif using (Program app = new Program ()) app.Run (); } diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props index fec3cb65..120aa913 100644 --- a/Samples/Directory.Build.props +++ b/Samples/Directory.Build.props @@ -1,9 +1,9 @@ <Project> <PropertyGroup> - <TargetFrameworks>net472</TargetFrameworks> + <TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks> <OutputType>Exe</OutputType> - <RootDirectory>$(MSBuildThisFileDirectory)</RootDirectory> + <SolutionDir>$(MSBuildThisFileDirectory)..\</SolutionDir> <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath> <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)\</IntermediateOutputPath> @@ -14,10 +14,10 @@ <EnableDefaultNoneItems>false</EnableDefaultNoneItems> <SamplesDir>$(SolutionDir)Samples\</SamplesDir> + <AppConfig>$(SolutionDir)Crow\App.config</AppConfig> </PropertyGroup> <ItemGroup> - <PackageReference Include="DllMapCore" Version="0.1.0" Condition="'$(TargetFramework)'=='netcoreapp3.1'" /> <ProjectReference Include="$(SolutionDir)Crow\Crow.csproj" /> </ItemGroup> <ItemGroup> diff --git a/Samples/HelloWorld/HelloWorld.csproj b/Samples/HelloWorld/HelloWorld.csproj index b19bb1c6..8186985d 100644 --- a/Samples/HelloWorld/HelloWorld.csproj +++ b/Samples/HelloWorld/HelloWorld.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <ItemGroup> <EmbeddedResource Include="ui\**\*.*"> diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs index 743419ee..44ec3fb8 100644 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@ -5,9 +5,6 @@ namespace HelloWorld { class Program { static void Main (string[] args) { -#if NETCOREAPP3_1 - DllMapCore.Resolve.Enable (true); -#endif using (Interface app = new Interface ()) { app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow"); app.Run (); diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs index f3aba2b5..d8254317 100644 --- a/Samples/ShowCase/ShowCase.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -16,9 +16,6 @@ namespace ShowCase { static void Main () { -#if NETCOREAPP3_1 - DllMapCore.Resolve.Enable (true); -#endif using (Showcase app = new Showcase ()) app.Run (); } diff --git a/Samples/ShowCase/packages.config b/Samples/ShowCase/packages.config deleted file mode 100644 index fba81ebc..00000000 --- a/Samples/ShowCase/packages.config +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="CVKL" version="0.1.2" targetFramework="net471" /> - <package id="glTF2Loader" version="1.1.3-alpha" targetFramework="net471" /> - <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net471" /> - <package id="System.Numerics.Vectors" version="4.6.0-preview4.19212.13" targetFramework="net471" /> - <package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0-preview4.19212.13" targetFramework="net471" /> - <package id="Vulkan" version="0.1.2.6" targetFramework="net471" /> -</packages>
\ No newline at end of file diff --git a/Samples/common/SampleBase.cs b/Samples/common/SampleBase.cs index 93aec907..65345be7 100644 --- a/Samples/common/SampleBase.cs +++ b/Samples/common/SampleBase.cs @@ -1,4 +1,6 @@ -using System; +using System.Net.NetworkInformation; +using System.Runtime.InteropServices; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -10,6 +12,24 @@ using Crow; namespace Crow { public class SampleBase : Interface { +#if NETCOREAPP + static IntPtr resolveUnmanaged (Assembly assembly, String libraryName) { + + switch (libraryName) + { + case "glfw3": + return NativeLibrary.Load("glfw", assembly, null); + case "rsvg-2.40": + return NativeLibrary.Load("rsvg-2", assembly, null); + } + Console.WriteLine ($"[UNRESOLVE] {assembly} {libraryName}"); + return IntPtr.Zero; + } + + static SampleBase () { + System.Runtime.Loader.AssemblyLoadContext.Default.ResolvingUnmanagedDll+=resolveUnmanaged; + } +#endif public Version CrowVersion => Assembly.GetAssembly (typeof (Widget)).GetName ().Version; #region Test values for Binding |