committed by
GitHub
123 changed files with 609 additions and 1489 deletions
@ -1,6 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<IgnoreThisComponentCompletely>False</IgnoreThisComponentCompletely> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,3 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings /> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,3 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings /> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,6 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<HiddenComponentWarnings> |
|
||||
<Value>MissingOrIgnoredProjectReference</Value> |
|
||||
</HiddenComponentWarnings> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -1,6 +0,0 @@ |
|||||
<ProjectConfiguration> |
|
||||
<Settings> |
|
||||
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
|
||||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|
||||
</Settings> |
|
||||
</ProjectConfiguration> |
|
||||
@ -0,0 +1,5 @@ |
|||||
|
<Project> |
||||
|
<PropertyGroup> |
||||
|
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(MSBuildThisFileDirectory)artifacts/nuget</PackageOutputPath> |
||||
|
</PropertyGroup> |
||||
|
</Project> |
||||
@ -0,0 +1,6 @@ |
|||||
|
# /bin/sh |
||||
|
|
||||
|
mkdir native-build |
||||
|
cd native-build |
||||
|
cmake -DCMAKE_BUILD_TYPE=$1 ../native |
||||
|
cmake --build . --target install |
||||
@ -0,0 +1,20 @@ |
|||||
|
<Project> |
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Base/Avalonia.Base.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Animation/Avalonia.Animation.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Controls/Avalonia.Controls.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Input/Avalonia.Input.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Interactivity/Avalonia.Interactivity.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Layout/Avalonia.Layout.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Visuals/Avalonia.Visuals.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Styling/Avalonia.Styling.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.OpenGL/Avalonia.OpenGL.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Markup/Avalonia.Markup/Avalonia.Markup.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj" /> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.DesktopRuntime/Avalonia.DesktopRuntime.csproj" Condition="'$(TargetFramework)' != 'netstandard2.0'" /> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -0,0 +1,3 @@ |
|||||
|
<Project> |
||||
|
<Target Name="Pack" /> |
||||
|
</Project> |
||||
@ -0,0 +1,6 @@ |
|||||
|
<Project> |
||||
|
<Import Condition="'$(TargetFramework)' == 'netcoreapp2.0'" Project="CoreLibraries.props" /> |
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="$(MSBuildThisFileDirectory)../packages/Avalonia/Avalonia.csproj" /> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -1,9 +1,5 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="System.Reactive" Version="4.0.0" /> |
<PackageReference Include="System.Reactive" Version="4.0.0" /> |
||||
<PackageReference Include="System.Reactive.Core" Version="4.0.0" /> |
|
||||
<PackageReference Include="System.Reactive.Interfaces" Version="4.0.0" /> |
|
||||
<PackageReference Include="System.Reactive.Linq" Version="4.0.0" /> |
|
||||
<PackageReference Include="System.Reactive.PlatformServices" Version="4.0.0" /> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,5 +1,5 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="System.Drawing.Common" Version="4.5.0-preview1-25914-04" /> |
<PackageReference Include="System.Drawing.Common" Version="4.5.0" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,6 +1,7 @@ |
|||||
{ |
{ |
||||
"msbuild-sdks": { |
"msbuild-sdks": { |
||||
"Microsoft.Build.Traversal": "1.0.41", |
"Microsoft.Build.Traversal": "1.0.43", |
||||
"MSBuild.Sdk.Extras": "1.6.46" |
"MSBuild.Sdk.Extras": "1.6.46", |
||||
|
"AggregatePackage.NuGet.Sdk" : "0.1.12" |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,508 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Xml.Linq; |
|
||||
|
|
||||
public class Packages |
|
||||
{ |
|
||||
public List<NuGetPackSettings> NuspecNuGetSettings { get; private set; } |
|
||||
public FilePath[] NugetPackages { get; private set; } |
|
||||
public FilePath[] BinFiles { get; private set; } |
|
||||
public string NugetPackagesDir {get; private set;} |
|
||||
public string SkiaSharpVersion {get; private set; } |
|
||||
public string SkiaSharpLinuxVersion {get; private set; } |
|
||||
public Dictionary<string, IList<Tuple<string,string>>> PackageVersions{get; private set;} |
|
||||
|
|
||||
class DependencyBuilder : List<NuSpecDependency> |
|
||||
{ |
|
||||
Packages _parent; |
|
||||
|
|
||||
public DependencyBuilder(Packages parent) |
|
||||
{ |
|
||||
_parent = parent; |
|
||||
} |
|
||||
|
|
||||
string GetVersion(string name) |
|
||||
{ |
|
||||
return _parent.PackageVersions[name].First().Item1; |
|
||||
} |
|
||||
|
|
||||
public DependencyBuilder Dep(string name, params string[] fws) |
|
||||
{ |
|
||||
if(fws.Length == 0) |
|
||||
Add(new NuSpecDependency() { Id = name, Version = GetVersion(name) }); |
|
||||
foreach(var fw in fws) |
|
||||
Add(new NuSpecDependency() { Id = name, TargetFramework = fw, Version = GetVersion(name) }); |
|
||||
return this; |
|
||||
} |
|
||||
public DependencyBuilder Deps(string[] fws, params string[] deps) |
|
||||
{ |
|
||||
foreach(var fw in fws) |
|
||||
foreach(var name in deps) |
|
||||
Add(new NuSpecDependency() { Id = name, TargetFramework = fw, Version = GetVersion(name) }); |
|
||||
return this; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public Packages(ICakeContext context, Parameters parameters) |
|
||||
{ |
|
||||
// NUGET NUSPECS |
|
||||
context.Information("Getting git modules:"); |
|
||||
|
|
||||
var ignoredSubModulesPaths = System.IO.File.ReadAllLines(".git/config").Where(m=>m.StartsWith("[submodule ")).Select(m => |
|
||||
{ |
|
||||
var path = m.Split(' ')[1].Trim("\"[] \t".ToArray()); |
|
||||
context.Information(path); |
|
||||
return ((DirectoryPath)context.Directory(path)).FullPath; |
|
||||
}).ToList(); |
|
||||
|
|
||||
var normalizePath = new Func<string, string>( |
|
||||
path => path.Replace(System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar).ToUpperInvariant()); |
|
||||
|
|
||||
// Key: Package Id |
|
||||
// Value is Tuple where Item1: Package Version, Item2: The *.csproj/*.props file path. |
|
||||
var packageVersions = new Dictionary<string, IList<Tuple<string,string>>>(); |
|
||||
PackageVersions = packageVersions; |
|
||||
System.IO.Directory.EnumerateFiles(((DirectoryPath)context.Directory("./build")).FullPath, |
|
||||
"*.props", SearchOption.AllDirectories).ToList().ForEach(fileName => |
|
||||
{ |
|
||||
if (!ignoredSubModulesPaths.Any(i => normalizePath(fileName).Contains(normalizePath(i)))) |
|
||||
{ |
|
||||
var xdoc = XDocument.Load(fileName); |
|
||||
foreach (var reference in xdoc.Descendants().Where(x => x.Name.LocalName == "PackageReference")) |
|
||||
{ |
|
||||
var name = reference.Attribute("Include").Value; |
|
||||
var versionAttribute = reference.Attribute("Version"); |
|
||||
var version = versionAttribute != null |
|
||||
? versionAttribute.Value |
|
||||
: reference.Elements().First(x=>x.Name.LocalName == "Version").Value; |
|
||||
IList<Tuple<string, string>> versions; |
|
||||
packageVersions.TryGetValue(name, out versions); |
|
||||
if (versions == null) |
|
||||
{ |
|
||||
versions = new List<Tuple<string, string>>(); |
|
||||
packageVersions[name] = versions; |
|
||||
} |
|
||||
versions.Add(Tuple.Create(version, fileName)); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
context.Information("Checking installed NuGet package dependencies versions:"); |
|
||||
|
|
||||
packageVersions.ToList().ForEach(package => |
|
||||
{ |
|
||||
var packageVersion = package.Value.First().Item1; |
|
||||
bool isValidVersion = package.Value.All(x => x.Item1 == packageVersion); |
|
||||
if (!isValidVersion) |
|
||||
{ |
|
||||
context.Information("Error: package {0} has multiple versions installed:", package.Key); |
|
||||
foreach (var v in package.Value) |
|
||||
{ |
|
||||
context.Information("{0}, file: {1}", v.Item1, v.Item2); |
|
||||
} |
|
||||
throw new Exception("Detected multiple NuGet package version installed for different projects."); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
context.Information("Setting NuGet package dependencies versions:"); |
|
||||
|
|
||||
var SerilogVersion = packageVersions["Serilog"].FirstOrDefault().Item1; |
|
||||
var SerilogSinksDebugVersion = packageVersions["Serilog.Sinks.Debug"].FirstOrDefault().Item1; |
|
||||
var SerilogSinksTraceVersion = packageVersions["Serilog.Sinks.Trace"].FirstOrDefault().Item1; |
|
||||
var SystemReactiveVersion = packageVersions["System.Reactive"].FirstOrDefault().Item1; |
|
||||
var ReactiveUIVersion = packageVersions["reactiveui"].FirstOrDefault().Item1; |
|
||||
var SystemValueTupleVersion = packageVersions["System.ValueTuple"].FirstOrDefault().Item1; |
|
||||
SkiaSharpVersion = packageVersions["SkiaSharp"].FirstOrDefault().Item1; |
|
||||
SkiaSharpLinuxVersion = packageVersions["Avalonia.Skia.Linux.Natives"].FirstOrDefault().Item1; |
|
||||
var SharpDXVersion = packageVersions["SharpDX"].FirstOrDefault().Item1; |
|
||||
var SharpDXDirect2D1Version = packageVersions["SharpDX.Direct2D1"].FirstOrDefault().Item1; |
|
||||
var SharpDXDirect3D11Version = packageVersions["SharpDX.Direct3D11"].FirstOrDefault().Item1; |
|
||||
var SharpDXDirect3D9Version = packageVersions["SharpDX.Direct3D9"].FirstOrDefault().Item1; |
|
||||
var SharpDXDXGIVersion = packageVersions["SharpDX.DXGI"].FirstOrDefault().Item1; |
|
||||
var SystemMemoryVersion = packageVersions["System.Memory"].FirstOrDefault().Item1; |
|
||||
|
|
||||
context.Information("Package: Serilog, version: {0}", SerilogVersion); |
|
||||
context.Information("Package: System.Reactive, version: {0}", SystemReactiveVersion); |
|
||||
context.Information("Package: reactiveui, version: {0}", ReactiveUIVersion); |
|
||||
context.Information("Package: System.ValueTuple, version: {0}", SystemValueTupleVersion); |
|
||||
context.Information("Package: SkiaSharp, version: {0}", SkiaSharpVersion); |
|
||||
context.Information("Package: Avalonia.Skia.Linux.Natives, version: {0}", SkiaSharpLinuxVersion); |
|
||||
context.Information("Package: SharpDX, version: {0}", SharpDXVersion); |
|
||||
context.Information("Package: SharpDX.Direct2D1, version: {0}", SharpDXDirect2D1Version); |
|
||||
context.Information("Package: SharpDX.Direct3D11, version: {0}", SharpDXDirect3D11Version); |
|
||||
context.Information("Package: SharpDX.Direct3D9, version: {0}", SharpDXDirect3D9Version); |
|
||||
context.Information("Package: SharpDX.DXGI, version: {0}", SharpDXDXGIVersion); |
|
||||
context.Information("Package: System.Memory, version: {0}", SystemMemoryVersion); |
|
||||
|
|
||||
var nugetPackagesDir = System.Environment.GetEnvironmentVariable("NUGET_HOME") |
|
||||
?? System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("USERPROFILE") ?? System.Environment.GetEnvironmentVariable("HOME"), ".nuget"); |
|
||||
|
|
||||
NugetPackagesDir = System.IO.Path.Combine(nugetPackagesDir, "packages"); |
|
||||
|
|
||||
var SetNuGetNuspecCommonProperties = new Action<NuGetPackSettings> ((nuspec) => { |
|
||||
nuspec.Version = parameters.Version; |
|
||||
nuspec.Authors = new [] { "Avalonia Team" }; |
|
||||
nuspec.Owners = new [] { "stevenk" }; |
|
||||
nuspec.LicenseUrl = new Uri("http://opensource.org/licenses/MIT"); |
|
||||
nuspec.ProjectUrl = new Uri("https://github.com/AvaloniaUI/Avalonia/"); |
|
||||
nuspec.RequireLicenseAcceptance = false; |
|
||||
nuspec.Symbols = false; |
|
||||
nuspec.NoPackageAnalysis = true; |
|
||||
nuspec.Description = "The Avalonia UI framework"; |
|
||||
nuspec.Copyright = "Copyright 2018"; |
|
||||
nuspec.Tags = new [] { "Avalonia" }; |
|
||||
}); |
|
||||
|
|
||||
var coreLibraries = new string[][] |
|
||||
{ |
|
||||
new [] { "./src/", "Avalonia.Animation"}, |
|
||||
new [] { "./src/", "Avalonia.Base"}, |
|
||||
new [] { "./src/", "Avalonia.Controls"}, |
|
||||
new [] { "./src/", "Avalonia.DesignerSupport"}, |
|
||||
new [] { "./src/", "Avalonia.Diagnostics"}, |
|
||||
new [] { "./src/", "Avalonia.Input"}, |
|
||||
new [] { "./src/", "Avalonia.Interactivity"}, |
|
||||
new [] { "./src/", "Avalonia.Layout"}, |
|
||||
new [] { "./src/", "Avalonia.Logging.Serilog"}, |
|
||||
new [] { "./src/", "Avalonia.Visuals"}, |
|
||||
new [] { "./src/", "Avalonia.Styling"}, |
|
||||
new [] { "./src/", "Avalonia.OpenGL"}, |
|
||||
new [] { "./src/", "Avalonia.Themes.Default"}, |
|
||||
new [] { "./src/Markup/", "Avalonia.Markup"}, |
|
||||
new [] { "./src/Markup/", "Avalonia.Markup.Xaml"}, |
|
||||
}; |
|
||||
|
|
||||
var extensionsToPack = new [] {".dll", ".xml", ".pdb"}; |
|
||||
|
|
||||
var coreLibrariesFiles = coreLibraries |
|
||||
.SelectMany(lib => extensionsToPack.Select(ext => new {lib, ext})) |
|
||||
.Select((lib) => { |
|
||||
return (FilePath)context.File(lib.lib[0] + lib.lib[1] + "/bin/" + parameters.DirSuffix + "/netstandard2.0/" + lib.lib[1] + lib.ext); |
|
||||
}).ToList(); |
|
||||
|
|
||||
var coreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => { |
|
||||
return new NuSpecContent { |
|
||||
Source = file.FullPath, Target = "lib/netstandard2.0" |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
var netFrameworkCoreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => { |
|
||||
return new NuSpecContent { |
|
||||
Source = file.FullPath, Target = "lib/net461" |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
var netcoreappCoreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => { |
|
||||
return new NuSpecContent { |
|
||||
Source = file.FullPath, Target = "lib/netcoreapp2.0" |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
var netFrameworkRuntimePlatform = extensionsToPack.Select(libSuffix => { |
|
||||
return new NuSpecContent { |
|
||||
Source = ((FilePath)context.File("./src/Avalonia.DotNetFrameworkRuntime/bin/" + parameters.DirSuffix + "/net461/Avalonia.DotNetFrameworkRuntime" + libSuffix)).FullPath, |
|
||||
Target = "lib/net461" |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
var netCoreRuntimePlatform = extensionsToPack.Select(libSuffix => { |
|
||||
return new NuSpecContent { |
|
||||
Source = ((FilePath)context.File("./src/Avalonia.DotNetCoreRuntime/bin/" + parameters.DirSuffix + "/netcoreapp2.0/Avalonia.DotNetCoreRuntime" + libSuffix)).FullPath, |
|
||||
Target = "lib/netcoreapp2.0" |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
var toolHostApp = new NuSpecContent{ |
|
||||
Source = ((FilePath)context.File("./src/tools/Avalonia.Designer.HostApp/bin/" + parameters.DirSuffix + "/netcoreapp2.0/Avalonia.Designer.HostApp.dll")).FullPath, |
|
||||
Target = "tools/netcoreapp2.0/previewer" |
|
||||
}; |
|
||||
|
|
||||
var toolHostAppNetFx = new NuSpecContent{ |
|
||||
Source = ((FilePath)context.File("./src/tools/Avalonia.Designer.HostApp.NetFx/bin/" + parameters.DirSuffix + "/net461/Avalonia.Designer.HostApp.exe")).FullPath, |
|
||||
Target = "tools/net461/previewer" |
|
||||
}; |
|
||||
|
|
||||
var toolsContent = new[] { toolHostApp, toolHostAppNetFx }; |
|
||||
var coreFiles = coreLibrariesNuSpecContent |
|
||||
.Concat(netFrameworkCoreLibrariesNuSpecContent).Concat(netFrameworkRuntimePlatform) |
|
||||
.Concat(netcoreappCoreLibrariesNuSpecContent).Concat(netCoreRuntimePlatform) |
|
||||
.Concat(toolsContent) |
|
||||
.ToList(); |
|
||||
|
|
||||
var nuspecNuGetSettingsCore = new [] |
|
||||
{ |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia", |
|
||||
Dependencies = new DependencyBuilder(this) |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia.Remote.Protocol", Version = parameters.Version, TargetFramework="netstandard2.0" }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Remote.Protocol", Version = parameters.Version, TargetFramework="netcoreapp2.0" }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Remote.Protocol", Version = parameters.Version, TargetFramework="net461" }, |
|
||||
new NuSpecDependency() { Id = "System.ValueTuple", Version = SystemValueTupleVersion, TargetFramework="net461" }, |
|
||||
new NuSpecDependency() { Id = "System.ComponentModel.TypeConverter", Version = "4.3.0", TargetFramework="net461" }, |
|
||||
new NuSpecDependency() { Id = "NETStandard.Library", Version = "2.0.0", TargetFramework="net461"} |
|
||||
} |
|
||||
.Deps(new string[]{"netstandard2.0", "netcoreapp2.0", "net461"}, |
|
||||
"Serilog", "Serilog.Sinks.Debug", "Serilog.Sinks.Trace", |
|
||||
"System.Memory", "System.Reactive", "System.ComponentModel.Annotations") |
|
||||
.ToArray(), |
|
||||
Files = coreFiles, |
|
||||
BasePath = context.Directory("./"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.ReactiveUI |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.ReactiveUI", |
|
||||
Dependencies = new DependencyBuilder(this) |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
}.Deps(new string[] {null}, "reactiveui"), |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.ReactiveUI.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Avalonia.ReactiveUI/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Remote.Protocol |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Remote.Protocol", |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Remote.Protocol.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Avalonia.Remote.Protocol/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
}; |
|
||||
|
|
||||
var nuspecNuGetSettingsMobile = new [] |
|
||||
{ |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Android |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Android", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Android.dll", Target = "lib/MonoAndroid10" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Android/Avalonia.Android/bin/" + parameters.DirSuffix + "/monoandroid44/MonoAndroid44/"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.iOS |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.iOS", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.iOS.dll", Target = "lib/Xamarin.iOS10" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/iOS/Avalonia.iOS/bin/" + parameters.DirSuffix + "/xamarin.ios10/"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
var nuspecNuGetSettingsDesktop = new [] |
|
||||
{ |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Win32 |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Win32", |
|
||||
Dependencies = new DependencyBuilder(this) |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version } |
|
||||
}.Deps(new string[]{null}, "System.Drawing.Common"), |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Win32/bin/" + parameters.DirSuffix + "/netstandard2.0/Avalonia.Win32.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Windows"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Direct2D1 |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Direct2D1", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "SharpDX", Version = SharpDXVersion }, |
|
||||
new NuSpecDependency() { Id = "SharpDX.Direct2D1", Version = SharpDXDirect2D1Version }, |
|
||||
new NuSpecDependency() { Id = "SharpDX.Direct3D11", Version = SharpDXDirect3D11Version }, |
|
||||
new NuSpecDependency() { Id = "SharpDX.DXGI", Version = SharpDXDXGIVersion } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Direct2D1.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Windows/Avalonia.Direct2D1/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Gtk3 |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Gtk3", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Gtk3.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Gtk/Avalonia.Gtk3/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Skia |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Skia", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion }, |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version, TargetFramework="netcoreapp2.0" }, |
|
||||
new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion, TargetFramework="netcoreapp2.0" }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia.Linux.Natives", Version = SkiaSharpLinuxVersion, TargetFramework="netcoreapp2.0" }, |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version, TargetFramework="net461" }, |
|
||||
new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion, TargetFramework="net461" }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia.Linux.Natives", Version = SkiaSharpLinuxVersion, TargetFramework="net461" } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Skia.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Skia/Avalonia.Skia/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Desktop |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Desktop", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia.Direct2D1", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Win32", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Gtk3", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Native", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new NuSpecContent[] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "licence.md", Target = "" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.LinuxFramebuffer |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.LinuxFramebuffer", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Skia", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.LinuxFramebuffer/bin/" + parameters.DirSuffix + "/netstandard2.0/Avalonia.LinuxFramebuffer.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Linux/"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
// Avalonia.Native |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Native", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version } |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Native.dll", Target = "lib/netstandard2.0" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Avalonia.Native/bin/" + parameters.DirSuffix + "/netstandard2.0"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}, |
|
||||
}; |
|
||||
|
|
||||
var nuspecNuGetSettingInterop = new NuGetPackSettings() |
|
||||
{ |
|
||||
Id = "Avalonia.Win32.Interoperability", |
|
||||
Dependencies = new [] |
|
||||
{ |
|
||||
new NuSpecDependency() { Id = "Avalonia.Win32", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "Avalonia.Direct2D1", Version = parameters.Version }, |
|
||||
new NuSpecDependency() { Id = "SharpDX.Direct3D9", Version = SharpDXDirect3D9Version }, |
|
||||
}, |
|
||||
Files = new [] |
|
||||
{ |
|
||||
new NuSpecContent { Source = "Avalonia.Win32.Interop/bin/" + parameters.DirSuffix + "/net461/Avalonia.Win32.Interop.dll", Target = "lib/net461" } |
|
||||
}, |
|
||||
BasePath = context.Directory("./src/Windows"), |
|
||||
OutputDirectory = parameters.NugetRoot |
|
||||
}; |
|
||||
|
|
||||
NuspecNuGetSettings = new List<NuGetPackSettings>(); |
|
||||
|
|
||||
NuspecNuGetSettings.AddRange(nuspecNuGetSettingsCore); |
|
||||
NuspecNuGetSettings.AddRange(nuspecNuGetSettingsDesktop); |
|
||||
|
|
||||
if (parameters.IsRunningOnWindows) { |
|
||||
NuspecNuGetSettings.Add(nuspecNuGetSettingInterop); |
|
||||
NuspecNuGetSettings.AddRange(nuspecNuGetSettingsMobile); |
|
||||
} |
|
||||
|
|
||||
NuspecNuGetSettings.ForEach((nuspec) => SetNuGetNuspecCommonProperties(nuspec)); |
|
||||
|
|
||||
NugetPackages = NuspecNuGetSettings.Select(nuspec => { |
|
||||
return nuspec.OutputDirectory.CombineWithFilePath(string.Concat(nuspec.Id, ".", nuspec.Version, ".nupkg")); |
|
||||
}).ToArray(); |
|
||||
|
|
||||
BinFiles = NuspecNuGetSettings.SelectMany(nuspec => { |
|
||||
return nuspec.Files.Select(file => { |
|
||||
return ((DirectoryPath)nuspec.BasePath).CombineWithFilePath(file.Source); |
|
||||
}); |
|
||||
}).GroupBy(f => f.FullPath).Select(g => g.First()).ToArray(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,36 @@ |
|||||
|
<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> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<DesignerHostAppPath>../../src/tools</DesignerHostAppPath> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<Target Name="AddDesignerHostAppsToPackage" BeforeTargets="GenerateNuspec"> |
||||
|
<MSBuild Projects="$(DesignerHostAppPath)/Avalonia.Designer.HostApp/Avalonia.Designer.HostApp.csproj" |
||||
|
Properties="Configuration=$(Configuration); |
||||
|
Platform=$(Platform)" /> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<_PackageFiles Include="$(DesignerHostAppPath)/Avalonia.Designer.HostApp/bin/$(Configuration)/netcoreapp2.0/Avalonia.Designer.HostApp.dll"> |
||||
|
<PackagePath>tools/netcoreapp2.0/designer</PackagePath> |
||||
|
<Visible>false</Visible> |
||||
|
<BuildAction>None</BuildAction> |
||||
|
</_PackageFiles> |
||||
|
<_PackageFiles Include="$(DesignerHostAppPath)/Avalonia.Designer.HostApp/bin/$(Configuration)/net461/Avalonia.Designer.HostApp.exe"> |
||||
|
<PackagePath>tools/net461/designer</PackagePath> |
||||
|
<Visible>false</Visible> |
||||
|
<BuildAction>None</BuildAction> |
||||
|
</_PackageFiles> |
||||
|
</ItemGroup> |
||||
|
</Target> |
||||
|
|
||||
|
<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,3 +1,6 @@ |
|||||
<Project> |
<Project> |
||||
|
<PropertyGroup> |
||||
|
<IsPackable>false</IsPackable> |
||||
|
</PropertyGroup> |
||||
<Import Project="..\build\SharedVersion.props" /> |
<Import Project="..\build\SharedVersion.props" /> |
||||
</Project> |
</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="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,9 +1,10 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>netstandard2.0</TargetFramework> |
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<IsPackable>false</IsPackable> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\build\Rx.props" /> |
<Import Project="..\..\build\Rx.props" /> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -0,0 +1,57 @@ |
|||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Platform; |
||||
|
|
||||
|
namespace Avalonia |
||||
|
{ |
||||
|
public static class AppBuilderDesktopExtensions |
||||
|
{ |
||||
|
public static TAppBuilder UsePlatformDetect<TAppBuilder>(this TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
{ |
||||
|
var os = builder.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
|
||||
|
// Additionally, by having a hard reference to each assembly,
|
||||
|
// we verify that the assemblies are in the final .deps.json file
|
||||
|
// so .NET Core knows where to load the assemblies from,.
|
||||
|
if (os == OperatingSystemType.WinNT) |
||||
|
{ |
||||
|
LoadWin32(builder); |
||||
|
LoadSkia(builder); |
||||
|
} |
||||
|
else if(os==OperatingSystemType.OSX) |
||||
|
{ |
||||
|
LoadAvaloniaNative(builder); |
||||
|
LoadSkia(builder); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
LoadGtk3(builder); |
||||
|
LoadSkia(builder); |
||||
|
} |
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
static void LoadAvaloniaNative<TAppBuilder>(TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
=> builder.UseAvaloniaNative(); |
||||
|
static void LoadWin32<TAppBuilder>(TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
=> builder.UseWin32(); |
||||
|
|
||||
|
static void LoadGtk3<TAppBuilder>(TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
=> builder.UseGtk3(); |
||||
|
|
||||
|
static void LoadDirect2D1<TAppBuilder>(TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
=> builder.UseDirect2D1(); |
||||
|
|
||||
|
static void LoadSkia<TAppBuilder>(TAppBuilder builder) |
||||
|
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
||||
|
=> builder.UseSkia(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
<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/Avalonia.Native/Avalonia.Native.csproj" /> |
||||
|
<ProjectReference Include="../../packages/Avalonia/Avalonia.csproj" /> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -0,0 +1,21 @@ |
|||||
|
<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> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" Condition="'$(TargetFramework)' == 'net461'" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<Import Project="..\..\build\NetCore.props" /> |
||||
|
<Import Project="..\..\build\NetFX.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,18 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|
||||
<DefineConstants>$(DefineConstants);DOTNETCORE</DefineConstants> |
|
||||
</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,17 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>net461</TargetFramework> |
|
||||
<DocumentationFile>bin\$(Configuration)\Avalonia.DotNetFrameworkRuntime.xml</DocumentationFile> |
|
||||
<DefineConstants>$(DefineConstants);FULLDOTNET</DefineConstants> |
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
|
||||
</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; |
|
||||
} |
|
||||
} |
|
||||
@ -1,10 +1,11 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>netstandard2.0</TargetFramework> |
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<IsPackable>false</IsPackable> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
||||
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\build\Serilog.props" /> |
<Import Project="..\..\build\Serilog.props" /> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1 +0,0 @@ |
|||||
Generated |
|
||||
@ -1,31 +1,26 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
|
<IsPackable>false</IsPackable> |
||||
|
<IsPackable Condition="'$([MSBuild]::IsOSPlatform(OSX))' == 'True'">true</IsPackable> |
||||
<TargetFramework>netstandard2.0</TargetFramework> |
<TargetFramework>netstandard2.0</TargetFramework> |
||||
<CastXmlPath Condition="Exists('/usr/bin/castxml')">/usr/bin/castxml</CastXmlPath> |
<CastXmlPath Condition="Exists('/usr/bin/castxml')">/usr/bin/castxml</CastXmlPath> |
||||
<CastXmlPath Condition="Exists('/usr/local/bin/castxml')">/usr/local/bin/castxml</CastXmlPath> |
<CastXmlPath Condition="Exists('/usr/local/bin/castxml')">/usr/local/bin/castxml</CastXmlPath> |
||||
|
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
<SharpGenGeneratedCodeFolder>$(MSBuildThisFileDirectory)/Generated</SharpGenGeneratedCodeFolder> |
|
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<ItemGroup> |
|
||||
<PackageReference Include="SharpGenTools.Sdk" Version="1.1.2" PrivateAssets="all" /> |
|
||||
<PackageReference Include="SharpGen.Runtime.Com" Version="1.1.0" /> |
|
||||
<SharpGenMapping Include="Mappings.xml" /> |
|
||||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.Input\Avalonia.Input.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.Interactivity\Avalonia.Interactivity.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.OpenGL\Avalonia.OpenGL.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.Visuals\Avalonia.Visuals.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
|
<ItemGroup Condition="'$(Configuration)' == 'Release' AND '$([MSBuild]::IsOSPlatform(OSX))' == 'true'"> |
||||
<ItemGroup Condition="'$(Configuration)' == 'Release' AND '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'"> |
<Content Include="../../Build/Products/Release/libAvalonia.Native.OSX.dylib"> |
||||
<Content Include="../../Build/Products/Release/libAvalonia.Native.OSX.dylib"> |
<PackagePath>runtimes/osx/native/libAvaloniaNative.dylib</PackagePath> |
||||
<PackagePath>runtimes/osx/native/libAvaloniaNative.dylib</PackagePath> |
<Pack>true</Pack> |
||||
<Pack>true</Pack> |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
</Content> |
||||
</Content> |
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<SharpGenMapping Include="Mappings.xml" /> |
||||
|
<PackageReference Include="SharpGenTools.Sdk" Version="1.1.2" PrivateAssets="all" /> |
||||
|
<PackageReference Include="SharpGen.Runtime.COM" Version="1.1.0" /> |
||||
|
<ProjectReference Include="..\..\packages\Avalonia\Avalonia.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,9 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<ItemGroup> |
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\osx-x64\native\libAvalonia.Native.OSX.dylib"> |
|
||||
<Link>libAvalonia.Native.OSX.dylib</Link> |
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
||||
</None> |
|
||||
</ItemGroup> |
|
||||
</Project> |
|
||||
@ -0,0 +1,4 @@ |
|||||
|
using Avalonia.Native; |
||||
|
using Avalonia.Platform; |
||||
|
|
||||
|
[assembly: ExportWindowingSubsystem(OperatingSystemType.OSX, 1, "AvaloniaNative", typeof(AvaloniaNativePlatform), nameof(AvaloniaNativePlatform.Initialize))] |
||||
@ -1,4 +1,5 @@ |
|||||
<Project> |
<Project> |
||||
|
<Import Project="..\Directory.Build.props" /> |
||||
<Import Project="..\build\SharedVersion.props" /> |
<Import Project="..\build\SharedVersion.props" /> |
||||
<Import Project="..\build\SourceLink.props" Condition="'$(DisableSourceLink)' == ''" /> |
<Import Project="..\build\SourceLink.props" Condition="'$(DisableSourceLink)' == ''" /> |
||||
</Project> |
</Project> |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue