34 changed files with 74 additions and 281 deletions
@ -1,13 +0,0 @@ |
|||
<Project Sdk="AggregatePackage.NuGet.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFrameworks>netstandard2.0;net461;netcoreapp2.0</TargetFrameworks> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="../src/Avalonia.Remote.Protocol/Avalonia.Remote.Protocol.csproj" EmbedReference="false" /> |
|||
</ItemGroup> |
|||
|
|||
<Import Project="SharedVersion.props" /> |
|||
<Import Project="NetFX.props" /> |
|||
<Import Project="CoreLibraries.props" /> |
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFrameworks>netstandard2.0</TargetFrameworks> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="../../src/Windows/Avalonia.Win32/Avalonia.Win32.csproj" /> |
|||
<ProjectReference Include="../../src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj" /> |
|||
<ProjectReference Include="../../src/Skia/Avalonia.Skia/Avalonia.Skia.csproj" /> |
|||
<ProjectReference Include="../../src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj" /> |
|||
<ProjectReference Include="../../src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="AggregatePackage.NuGet.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFrameworks>netstandard2.0;net461;netcoreapp2.0</TargetFrameworks> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="../../src/Avalonia.Remote.Protocol/Avalonia.Remote.Protocol.csproj" EmbedReference="false" /> |
|||
</ItemGroup> |
|||
|
|||
<Import Project="..\..\build\SharedVersion.props" /> |
|||
<Import Project="..\..\build\NetFX.props" /> |
|||
<Import Project="..\..\build\CoreLibraries.props" /> |
|||
</Project> |
|||
@ -1,22 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0"/> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0"/> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -1,22 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0"/> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0"/> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -1,22 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -1,18 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0" /> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -0,0 +1,16 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="../Avalonia.Base/Avalonia.Base.csproj" /> |
|||
<ProjectReference Include="../Avalonia.Visuals/Avalonia.Visuals.csproj" /> |
|||
<ProjectReference Include="../Avalonia.Controls/Avalonia.Controls.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<Import Project="..\..\build\NetCore.props" /> |
|||
<Import Project="..\Shared\PlatformSupport\PlatformSupport.projitems" /> |
|||
</Project> |
|||
@ -1,58 +0,0 @@ |
|||
using System.Reflection; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Platform; |
|||
using Avalonia.Shared.PlatformSupport; |
|||
|
|||
namespace Avalonia |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes platform-specific services for an <see cref="Application"/>.
|
|||
/// </summary>
|
|||
public sealed class AppBuilder : AppBuilderBase<AppBuilder> |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="AppBuilder"/> class.
|
|||
/// </summary>
|
|||
public AppBuilder() |
|||
: base(new StandardRuntimePlatform(), |
|||
builder => StandardRuntimePlatformServices.Register(builder.Instance?.GetType() |
|||
?.GetTypeInfo().Assembly)) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="AppBuilder"/> class.
|
|||
/// </summary>
|
|||
/// <param name="app">The <see cref="Application"/> instance.</param>
|
|||
public AppBuilder(Application app) : this() |
|||
{ |
|||
Instance = app; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Instructs the <see cref="AppBuilder"/> to use the best settings for the platform.
|
|||
/// </summary>
|
|||
/// <returns>An <see cref="AppBuilder"/> instance.</returns>
|
|||
public AppBuilder UsePlatformDetect() |
|||
{ |
|||
var os = RuntimePlatform.GetRuntimeInfo().OperatingSystem; |
|||
//We don't have the ability to load every assembly right now, so we are
|
|||
//stuck with manual configuration here
|
|||
//Helpers are extracted to separate methods to take the advantage of the fact
|
|||
//that CLR doesn't try to load dependencies before referencing method is jitted
|
|||
if (os == OperatingSystemType.WinNT) |
|||
LoadWin32(); |
|||
else if(os==OperatingSystemType.OSX) |
|||
LoadAvaloniaNative(); |
|||
else |
|||
LoadGtk3(); |
|||
this.UseSkia(); |
|||
|
|||
return this; |
|||
} |
|||
|
|||
void LoadAvaloniaNative() => this.UseAvaloniaNative(); |
|||
void LoadWin32() => this.UseWin32(); |
|||
void LoadGtk3() => this.UseGtk3(); |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|||
<DefineConstants>$(DefineConstants);DOTNETCORE</DefineConstants> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Visuals\Avalonia.Visuals.csproj" /> |
|||
<ProjectReference Include="..\Gtk\Avalonia.Gtk3\Avalonia.Gtk3.csproj" /> |
|||
<ProjectReference Include="..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Native\Avalonia.Native.csproj" /> |
|||
<ProjectReference Include="..\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" /> |
|||
<ProjectReference Include="..\Windows\Avalonia.Win32\Avalonia.Win32.csproj" /> |
|||
</ItemGroup> |
|||
<Import Project="..\..\build\NetCore.props" /> |
|||
<Import Project="..\Shared\PlatformSupport\PlatformSupport.projitems" /> |
|||
</Project> |
|||
@ -1,18 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> |
|||
<DocumentationFile>bin\$(Configuration)\Avalonia.DotNetFrameworkRuntime.xml</DocumentationFile> |
|||
<DefineConstants>$(DefineConstants);FULLDOTNET</DefineConstants> |
|||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Visuals\Avalonia.Visuals.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Styling\Avalonia.Styling.csproj" /> |
|||
</ItemGroup> |
|||
<Import Project="..\Shared\PlatformSupport\PlatformSupport.projitems" Label="Shared" /> |
|||
<Import Project="..\..\build\Rx.props" /> |
|||
<Import Project="..\..\build\NetFX.props" /> |
|||
</Project> |
|||
@ -1,44 +0,0 @@ |
|||
using System; |
|||
using System.Runtime.InteropServices; |
|||
using Avalonia.Platform; |
|||
|
|||
namespace Avalonia.Shared.PlatformSupport |
|||
{ |
|||
internal partial class StandardRuntimePlatform |
|||
{ |
|||
private static readonly Lazy<RuntimePlatformInfo> Info = new Lazy<RuntimePlatformInfo>(() => |
|||
{ |
|||
var isMono = Type.GetType("Mono.Runtime") != null; |
|||
var isUnix = Environment.OSVersion.Platform == PlatformID.Unix || |
|||
Environment.OSVersion.Platform == PlatformID.MacOSX; |
|||
return new RuntimePlatformInfo |
|||
{ |
|||
IsCoreClr = false, |
|||
IsDesktop = true, |
|||
IsDotNetFramework = !isMono, |
|||
IsMono = isMono, |
|||
IsMobile = false, |
|||
IsUnix = isUnix, |
|||
OperatingSystem = isUnix ? DetectUnix() : OperatingSystemType.WinNT, |
|||
}; |
|||
}); |
|||
|
|||
[DllImport("libc")] |
|||
static extern int uname(IntPtr buf); |
|||
|
|||
static OperatingSystemType DetectUnix() |
|||
{ |
|||
var buffer = Marshal.AllocHGlobal(0x1000); |
|||
uname(buffer); |
|||
var unixName = Marshal.PtrToStringAnsi(buffer); |
|||
Marshal.FreeHGlobal(buffer); |
|||
if(unixName=="Darwin") |
|||
return OperatingSystemType.OSX; |
|||
if (unixName == "Linux") |
|||
return OperatingSystemType.Linux; |
|||
return OperatingSystemType.Unknown; |
|||
} |
|||
|
|||
public RuntimePlatformInfo GetRuntimeInfo() => Info.Value; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue