diff --git a/.gitmodules b/.gitmodules
index 0b2349ad42..6e9b10efa4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -5,9 +5,6 @@
path = src/Avalonia.HtmlRenderer/external
url = https://github.com/AvaloniaUI/HTML-Renderer.git
branch = perspex-pcl
-[submodule "src/Markup/Avalonia.Markup.Xaml/OmniXAML"]
- path = src/Markup/Avalonia.Markup.Xaml/OmniXAML
- url = https://github.com/AvaloniaUI/OmniXAML.git
-[submodule "src/Markup/Avalonia.Markup.Xaml/glass"]
- path = src/Markup/Avalonia.Markup.Xaml/glass
- url = https://github.com/SuperJMN/glass
+[submodule "src/Markup/Avalonia.Markup.Xaml/PortableXaml/portable.xaml.github"]
+ path = src/Markup/Avalonia.Markup.Xaml/PortableXaml/portable.xaml.github
+ url = https://github.com/AvaloniaUI/Portable.Xaml.git
diff --git a/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject b/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject
new file mode 100644
index 0000000000..6800b4a3fe
--- /dev/null
+++ b/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/.ncrunch/Avalonia.Visuals.UnitTests.net461.v3.ncrunchproject b/.ncrunch/Avalonia.Visuals.UnitTests.net461.v3.ncrunchproject
new file mode 100644
index 0000000000..6800b4a3fe
--- /dev/null
+++ b/.ncrunch/Avalonia.Visuals.UnitTests.net461.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject b/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject
new file mode 100644
index 0000000000..6800b4a3fe
--- /dev/null
+++ b/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
index 6b63176a89..7457a1d5bb 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -14,7 +14,7 @@ environment:
secure: OtVfyN3ErqQrDTnWH2HDfJDlCiu/i4/X4wFmK3ZXXP7HmCiXYPSbTjMPwwdOxRaK
MYGET_API_URL: https://www.myget.org/F/avalonia-ci/api/v2/package
init:
-- ps: (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/appveyor/ci/master/scripts/xamarin-vs2017-151-fixed.targets', "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Microsoft.Common.Targets\ImportAfter\Xamarin.Common.targets")
+- ps: if (Test-Path env:nuget_address) {[System.IO.File]::AppendAllText("C:\Windows\System32\drivers\etc\hosts", "`n$($env:nuget_address)`tapi.nuget.org")}
install:
- if not exist gtk-sharp-2.12.26.msi appveyor DownloadFile http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi
- if not exist dotnet-1.0.1.exe appveyor DownloadFile https://go.microsoft.com/fwlink/?linkid=843448 -FileName "dotnet-1.0.1.exe"
@@ -26,7 +26,6 @@ before_build:
build_script:
- ps: .\build.ps1 -Target "AppVeyor" -Platform "$env:platform" -Configuration "$env:configuration"
after_build:
-- tools\JetBrains.dotMemoryUnit\tools\dotMemoryUnit.exe -targetExecutable="%xunit20%\xunit.console.x86.exe" -returnTargetExitCode --"tests\Avalonia.LeakTests\bin\Release\Avalonia.LeakTests.dll"
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f "./artifacts/coverage.xml"
diff --git a/build.cake b/build.cake
index b3822271d4..6c2e554df4 100644
--- a/build.cake
+++ b/build.cake
@@ -4,8 +4,8 @@
#addin "nuget:?package=Polly&version=4.2.0"
#addin "nuget:?package=NuGet.Core&version=2.12.0"
+#tool "nuget:?package=xunit.runner.console&version=2.2.0"
#tool "nuget:https://dotnet.myget.org/F/nuget-build/?package=NuGet.CommandLine&version=4.3.0-preview1-3980&prerelease"
-#tool "nuget:?package=JetBrains.dotMemoryUnit&version=2.3.20160517.113140"
#tool "JetBrains.ReSharper.CommandLineTools"
///////////////////////////////////////////////////////////////////////////////
// TOOLS
@@ -119,7 +119,6 @@ Task("Restore-NuGet-Packages")
}})
.Execute(()=> {
NuGetRestore(parameters.MSBuildSolution, new NuGetRestoreSettings {
- ToolPath = "./tools/NuGet.CommandLine/tools/NuGet.exe",
ToolTimeout = TimeSpan.FromMinutes(toolTimeout)
});
});
@@ -194,6 +193,7 @@ Task("Run-Net-Core-Unit-Tests")
Task("Run-Unit-Tests")
.IsDependentOn("Run-Net-Core-Unit-Tests")
.IsDependentOn("Build")
+ //.IsDependentOn("Run-Leak-Tests")
.WithCriteria(() => !parameters.SkipTests)
.Does(() =>
{
@@ -206,13 +206,6 @@ Task("Run-Unit-Tests")
.Select(name => MakeAbsolute(File("./tests/" + name + "/bin/" + parameters.DirSuffix + "/" + name + ".dll")))
.ToList();
- if (parameters.IsRunningOnWindows)
- {
- var leakTests = GetFiles("./tests/Avalonia.LeakTests/bin/" + parameters.DirSuffix + "/*.LeakTests.dll");
-
- unitTests.AddRange(leakTests);
- }
-
var toolPath = (parameters.IsPlatformAnyCPU || parameters.IsPlatformX86) ?
"./tools/xunit.runner.console/tools/xunit.console.x86.exe" :
"./tools/xunit.runner.console/tools/xunit.console.exe";
@@ -365,6 +358,44 @@ Task("Publish-NuGet")
Information("Publish-NuGet Task failed, but continuing with next Task...");
});
+Task("Run-Leak-Tests")
+ .WithCriteria(parameters.IsRunningOnWindows)
+ .IsDependentOn("Build")
+ .Does(() =>
+ {
+ DotNetCoreRestore("tests\\Avalonia.LeakTests\\toolproject\\tool.csproj");
+ DotNetBuild("tests\\Avalonia.LeakTests\\toolproject\\tool.csproj", settings => settings.SetConfiguration("Release"));
+ var report = "tests\\Avalonia.LeakTests\\bin\\Release\\report.xml";
+ if(System.IO.File.Exists(report))
+ System.IO.File.Delete(report);
+ var proc = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
+ {
+ FileName="tests\\Avalonia.LeakTests\\toolproject\\bin\\dotMemoryUnit.exe",
+ Arguments="-targetExecutable=\"tools\\xunit.runner.console\\tools\\xunit.console.x86.exe\" -returnTargetExitCode -- tests\\Avalonia.LeakTests\\bin\\Release\\Avalonia.LeakTests.dll -xml tests\\Avalonia.LeakTests\\bin\\Release\\report.xml ",
+ UseShellExecute = false,
+ });
+ var st = System.Diagnostics.Stopwatch.StartNew();
+ while(!proc.HasExited && !System.IO.File.Exists(report))
+ {
+ if(st.Elapsed.TotalSeconds>60)
+ {
+ Error("Timed out, probably a bug in dotMemoryUnit");
+ proc.Kill();
+ throw new Exception("dotMemory issue");
+ }
+ proc.WaitForExit(100);
+ }
+ try{
+ proc.Kill();
+ }catch{}
+ var doc = System.Xml.Linq.XDocument.Load(report);
+ if(doc.Root.Descendants("assembly").Any(x=>x.Attribute("failed").Value.ToString() != "0"))
+ {
+ throw new Exception("Tests failed");
+ }
+
+ });
+
Task("Inspect")
.WithCriteria(parameters.IsRunningOnWindows)
.IsDependentOn("Restore-NuGet-Packages")
@@ -372,7 +403,8 @@ Task("Inspect")
{
var badIssues = new []{"PossibleNullReferenceException"};
var whitelist = new []{"tests", "src\\android", "src\\ios",
- "src\\windows\\avalonia.designer", "src\\avalonia.htmlrenderer\\external"};
+ "src\\windows\\avalonia.designer", "src\\avalonia.htmlrenderer\\external",
+ "src\\markup\\avalonia.markup.xaml\\portablexaml\\portable.xaml.github"};
Information("Running code inspections");
diff --git a/build/Markup.props b/build/Markup.props
index 36c4cb28d8..5be0cfbf0c 100644
--- a/build/Markup.props
+++ b/build/Markup.props
@@ -5,5 +5,10 @@
+
+
+
+
+
diff --git a/build/SharpDX.props b/build/SharpDX.props
index e381bc03e6..69aa817a01 100644
--- a/build/SharpDX.props
+++ b/build/SharpDX.props
@@ -1,8 +1,9 @@
-
-
-
-
+
+
+
+
+
diff --git a/build/UnitTests.NetCore.targets b/build/UnitTests.NetCore.targets
index a8886fe028..13bb4ed230 100644
--- a/build/UnitTests.NetCore.targets
+++ b/build/UnitTests.NetCore.targets
@@ -25,5 +25,4 @@
-
\ No newline at end of file
diff --git a/build/XUnit.props b/build/XUnit.props
index 27e0afc987..d59cee6536 100644
--- a/build/XUnit.props
+++ b/build/XUnit.props
@@ -12,4 +12,16 @@
+
+ true
+
+
+
+
+ true
+
+
diff --git a/docs/tutorial/from-wpf.md b/docs/tutorial/from-wpf.md
index 2db40cfd86..0eb6e80327 100644
--- a/docs/tutorial/from-wpf.md
+++ b/docs/tutorial/from-wpf.md
@@ -161,7 +161,7 @@ the same way that event class listeners are added](../spec/working-with-properti
## RenderTransforms and RenderTransformOrigin
-RenderTransformOrigins are different in WPF and Avalonia: If you apply a `RenderTransform`, keep in mind that our default value for the RenderTransformOrigin is `RelativePoint.Middle`. In WPF the default value is `RelativePoint.TopLeft` (0, 0). In controls like Viewbox (currently being developed) the same code will lead to a different rendering behavior:
+RenderTransformOrigins are different in WPF and Avalonia: If you apply a `RenderTransform`, keep in mind that our default value for the RenderTransformOrigin is `RelativePoint.Center`. In WPF the default value is `RelativePoint.TopLeft` (0, 0). In controls like Viewbox (currently being developed) the same code will lead to a different rendering behavior:
In WPF:

diff --git a/packages.cake b/packages.cake
index 1a29695d82..0824dc6098 100644
--- a/packages.cake
+++ b/packages.cake
@@ -8,6 +8,42 @@ public class Packages
public string NugetPackagesDir {get; private set;}
public string SkiaSharpVersion {get; private set; }
public string SkiaSharpLinuxVersion {get; private set; }
+ public Dictionary>> PackageVersions{get; private set;}
+
+
+
+ class DependencyBuilder : List
+ {
+ 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;
+ }
+ }
+
+ //new NuSpecDependency() { Id = "System.Threading.ThreadPool", TargetFramework = "netcoreapp1.0", Version = "4.3.0" },
public Packages(ICakeContext context, Parameters parameters)
{
// NUGET NUSPECS
@@ -26,7 +62,7 @@ public class Packages
// Key: Package Id
// Value is Tuple where Item1: Package Version, Item2: The *.csproj/*.props file path.
var packageVersions = new Dictionary>>();
-
+ PackageVersions = packageVersions;
System.IO.Directory.EnumerateFiles(((DirectoryPath)context.Directory("./build")).FullPath,
"*.props", SearchOption.AllDirectories).ToList().ForEach(fileName =>
{
@@ -81,6 +117,7 @@ public class Packages
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;
context.Information("Package: Serilog, version: {0}", SerilogVersion);
@@ -93,6 +130,7 @@ public class Packages
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);
var nugetPackagesDir = System.Environment.GetEnvironmentVariable("NUGET_HOME")
@@ -148,12 +186,12 @@ public class Packages
};
var coreLibrariesFiles = coreLibraries.Select((lib) => {
- return (FilePath)context.File(lib[0] + lib[1] + "/bin/" + parameters.DirSuffix + "/netstandard1.1/" + lib[1] + lib[2]);
+ return (FilePath)context.File(lib[0] + lib[1] + "/bin/" + parameters.DirSuffix + "/netstandard1.3/" + lib[1] + lib[2]);
}).ToList();
var coreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => {
return new NuSpecContent {
- Source = file.FullPath, Target = "lib/netstandard1.1"
+ Source = file.FullPath, Target = "lib/netstandard1.3"
};
});
@@ -193,13 +231,12 @@ public class Packages
new NuGetPackSettings()
{
Id = "Avalonia",
- Dependencies = new []
+ Dependencies = new DependencyBuilder(this)
{
new NuSpecDependency() { Id = "Serilog", Version = SerilogVersion },
new NuSpecDependency() { Id = "Splat", Version = SplatVersion },
new NuSpecDependency() { Id = "Sprache", Version = SpracheVersion },
new NuSpecDependency() { Id = "System.Reactive", Version = SystemReactiveVersion },
- new NuSpecDependency() { Id = "System.ValueTuple", Version = SystemValueTupleVersion },
//.NET Core
new NuSpecDependency() { Id = "System.Threading.ThreadPool", TargetFramework = "netcoreapp1.0", Version = "4.3.0" },
new NuSpecDependency() { Id = "Microsoft.Extensions.DependencyModel", TargetFramework = "netcoreapp1.0", Version = "1.1.0" },
@@ -208,8 +245,11 @@ public class Packages
new NuSpecDependency() { Id = "Serilog", TargetFramework = "netcoreapp1.0", Version = SerilogVersion },
new NuSpecDependency() { Id = "Sprache", TargetFramework = "netcoreapp1.0", Version = SpracheVersion },
new NuSpecDependency() { Id = "System.Reactive", TargetFramework = "netcoreapp1.0", Version = SystemReactiveVersion },
- new NuSpecDependency() { Id = "System.ValueTuple", TargetFramework = "netcoreapp1.0", Version = SystemValueTupleVersion }
- },
+ }
+ .Deps(new string[]{null, "netcoreapp1.0"},
+ "System.ValueTuple", "System.ComponentModel.TypeConverter", "System.ComponentModel.Primitives",
+ "System.Runtime.Serialization.Primitives", "System.Xml.XmlDocument", "System.Xml.ReaderWriter")
+ .ToArray(),
Files = coreLibrariesNuSpecContent
.Concat(win32CoreLibrariesNuSpecContent).Concat(net45RuntimePlatform)
.Concat(netcoreappCoreLibrariesNuSpecContent).Concat(netCoreRuntimePlatform)
@@ -229,9 +269,9 @@ public class Packages
},
Files = new []
{
- new NuSpecContent { Source = "Avalonia.HtmlRenderer.dll", Target = "lib/netstandard1.1" }
+ new NuSpecContent { Source = "Avalonia.HtmlRenderer.dll", Target = "lib/netstandard1.3" }
},
- BasePath = context.Directory("./src/Avalonia.HtmlRenderer/bin/" + parameters.DirSuffix + "/netstandard1.1"),
+ BasePath = context.Directory("./src/Avalonia.HtmlRenderer/bin/" + parameters.DirSuffix + "/netstandard1.3"),
OutputDirectory = parameters.NugetRoot
}
};
@@ -345,7 +385,7 @@ public class Packages
Files = new []
{
new NuSpecContent { Source = "Avalonia.Win32/bin/" + parameters.DirSuffix + "/Avalonia.Win32.dll", Target = "lib/net45" },
- new NuSpecContent { Source = "Avalonia.Win32.NetStandard/bin/" + parameters.DirSuffix + "/netstandard1.1/Avalonia.Win32.dll", Target = "lib/netstandard1.1" }
+ new NuSpecContent { Source = "Avalonia.Win32.NetStandard/bin/" + parameters.DirSuffix + "/netstandard1.3/Avalonia.Win32.dll", Target = "lib/netstandard1.3" }
},
BasePath = context.Directory("./src/Windows"),
OutputDirectory = parameters.NugetRoot
@@ -366,9 +406,9 @@ public class Packages
},
Files = new []
{
- new NuSpecContent { Source = "Avalonia.Direct2D1.dll", Target = "lib/net45" }
+ new NuSpecContent { Source = "Avalonia.Direct2D1.dll", Target = "lib/netstandard1.3" }
},
- BasePath = context.Directory("./src/Windows/Avalonia.Direct2D1/bin/" + parameters.DirSuffix),
+ BasePath = context.Directory("./src/Windows/Avalonia.Direct2D1/bin/" + parameters.DirSuffix + "/netstandard1.3"),
OutputDirectory = parameters.NugetRoot
},
///////////////////////////////////////////////////////////////////////////////
@@ -400,9 +440,9 @@ public class Packages
},
Files = new []
{
- new NuSpecContent { Source = "Avalonia.Gtk3.dll", Target = "lib/netstandard1.1" }
+ new NuSpecContent { Source = "Avalonia.Gtk3.dll", Target = "lib/netstandard1.3" }
},
- BasePath = context.Directory("./src/Gtk/Avalonia.Gtk3/bin/" + parameters.DirSuffix + "/netstandard1.1"),
+ BasePath = context.Directory("./src/Gtk/Avalonia.Gtk3/bin/" + parameters.DirSuffix + "/netstandard1.3"),
OutputDirectory = parameters.NugetRoot
},
///////////////////////////////////////////////////////////////////////////////
@@ -458,9 +498,9 @@ public class Packages
new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", TargetFramework="net45", Version = parameters.Version },
new NuSpecDependency() { Id = "Avalonia.Gtk3", TargetFramework="net45", Version = parameters.Version },
//.NET Core
- new NuSpecDependency() { Id = "Avalonia.Win32", TargetFramework="netcoreapp1.1", Version = parameters.Version },
- new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", TargetFramework="netcoreapp1.1", Version = parameters.Version },
- new NuSpecDependency() { Id = "Avalonia.Gtk3", TargetFramework="netcoreapp1.1", Version = parameters.Version }
+ new NuSpecDependency() { Id = "Avalonia.Win32", TargetFramework="netcoreapp1.0", Version = parameters.Version },
+ new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", TargetFramework="netcoreapp1.0", Version = parameters.Version },
+ new NuSpecDependency() { Id = "Avalonia.Gtk3", TargetFramework="netcoreapp1.0", Version = parameters.Version }
},
Files = new NuSpecContent[]
{
@@ -476,6 +516,7 @@ public class Packages
{
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 []
{
diff --git a/samples/BindingTest/App.config b/samples/BindingTest/App.config
index d9f870f27b..373b3a13f8 100644
--- a/samples/BindingTest/App.config
+++ b/samples/BindingTest/App.config
@@ -1,21 +1,21 @@
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/samples/BindingTest/BindingTest.csproj b/samples/BindingTest/BindingTest.csproj
index 1c4e4f8169..8e78b0c2cd 100644
--- a/samples/BindingTest/BindingTest.csproj
+++ b/samples/BindingTest/BindingTest.csproj
@@ -9,7 +9,7 @@
Properties
BindingTest
BindingTest
- v4.5
+ v4.6.1
512
true
@@ -162,5 +162,4 @@
-
\ No newline at end of file
diff --git a/samples/BindingTest/MainWindow.xaml b/samples/BindingTest/MainWindow.xaml
index 95f671fd84..7d633bcd0c 100644
--- a/samples/BindingTest/MainWindow.xaml
+++ b/samples/BindingTest/MainWindow.xaml
@@ -44,6 +44,8 @@
+
+
diff --git a/samples/BindingTest/ViewModels/MainWindowViewModel.cs b/samples/BindingTest/ViewModels/MainWindowViewModel.cs
index 4b58bf2279..2ec052c258 100644
--- a/samples/BindingTest/ViewModels/MainWindowViewModel.cs
+++ b/samples/BindingTest/ViewModels/MainWindowViewModel.cs
@@ -49,6 +49,9 @@ namespace BindingTest.ViewModels
Thread.Sleep(1000);
}
});
+
+ CurrentTimeObservable = Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(1))
+ .Select(x => DateTimeOffset.Now.ToString());
}
public ObservableCollection Items { get; }
@@ -85,6 +88,7 @@ namespace BindingTest.ViewModels
private set { this.RaiseAndSetIfChanged(ref _currentTime, value); }
}
+ public IObservable CurrentTimeObservable { get; }
public ReactiveCommand