|
|
@ -6,6 +6,7 @@ |
|
|
#addin "nuget:?package=NuGet.Core&version=2.14.0" |
|
|
#addin "nuget:?package=NuGet.Core&version=2.14.0" |
|
|
#tool "nuget:?package=NuGet.CommandLine&version=4.3.0" |
|
|
#tool "nuget:?package=NuGet.CommandLine&version=4.3.0" |
|
|
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2017.1.20170613.162720" |
|
|
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2017.1.20170613.162720" |
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
// TOOLS |
|
|
// TOOLS |
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
@ -194,59 +195,62 @@ void RunCoreTest(string project, Parameters parameters, bool coreOnly = false) |
|
|
|
|
|
|
|
|
Task("Run-Unit-Tests-Impl") |
|
|
Task("Run-Unit-Tests-Impl") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests) |
|
|
.Does<AvaloniaBuildData>(data => { |
|
|
.Does<AvaloniaBuildData>(data => |
|
|
RunCoreTest("./tests/Avalonia.Base.UnitTests", data.Parameters, false); |
|
|
{ |
|
|
RunCoreTest("./tests/Avalonia.Controls.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Base.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Input.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Controls.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Interactivity.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Input.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Layout.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Interactivity.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Markup.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Layout.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Markup.Xaml.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Markup.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Styling.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Markup.Xaml.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Visuals.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Styling.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Skia.UnitTests", data.Parameters, false); |
|
|
RunCoreTest("./tests/Avalonia.Visuals.UnitTests", data.Parameters, false); |
|
|
if (data.Parameters.IsRunningOnWindows && data.Parameters.Platform != "NetCoreOnly") |
|
|
RunCoreTest("./tests/Avalonia.Skia.UnitTests", data.Parameters, false); |
|
|
{ |
|
|
if (data.Parameters.IsRunningOnWindows && data.Parameters.Platform != "NetCoreOnly") |
|
|
RunCoreTest("./tests/Avalonia.Direct2D1.UnitTests", data.Parameters, true); |
|
|
{ |
|
|
} |
|
|
RunCoreTest("./tests/Avalonia.Direct2D1.UnitTests", data.Parameters, true); |
|
|
}); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Task("Run-Designer-Tests-Impl") |
|
|
Task("Run-Designer-Tests-Impl") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests) |
|
|
.Does<AvaloniaBuildData>(data => { |
|
|
.Does<AvaloniaBuildData>(data => |
|
|
RunCoreTest("./tests/Avalonia.DesignerSupport.Tests", data.Parameters, false); |
|
|
{ |
|
|
}); |
|
|
RunCoreTest("./tests/Avalonia.DesignerSupport.Tests", data.Parameters, false); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Task("Run-Render-Tests-Impl") |
|
|
Task("Run-Render-Tests-Impl") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.Does<AvaloniaBuildData>(data => { |
|
|
.Does<AvaloniaBuildData>(data => |
|
|
RunCoreTest("./tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj", data.Parameters, true); |
|
|
{ |
|
|
RunCoreTest("./tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj", data.Parameters, true); |
|
|
RunCoreTest("./tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj", data.Parameters, true); |
|
|
}); |
|
|
RunCoreTest("./tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj", data.Parameters, true); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Task("Run-Leak-Tests-Impl") |
|
|
Task("Run-Leak-Tests-Impl") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.Does(() => |
|
|
.Does(() => |
|
|
|
|
|
{ |
|
|
|
|
|
var dotMemoryUnit = Context.Tools.Resolve("dotMemoryUnit.exe"); |
|
|
|
|
|
var leakTestsExitCode = StartProcess(dotMemoryUnit, new ProcessSettings |
|
|
{ |
|
|
{ |
|
|
var dotMemoryUnit = Context.Tools.Resolve("dotMemoryUnit.exe"); |
|
|
Arguments = new ProcessArgumentBuilder() |
|
|
var leakTestsExitCode = StartProcess(dotMemoryUnit, new ProcessSettings |
|
|
.Append(Context.Tools.Resolve("xunit.console.x86.exe").FullPath) |
|
|
{ |
|
|
.Append("--propagate-exit-code") |
|
|
Arguments = new ProcessArgumentBuilder() |
|
|
.Append("--") |
|
|
.Append(Context.Tools.Resolve("xunit.console.x86.exe").FullPath) |
|
|
.Append("tests\\Avalonia.LeakTests\\bin\\Release\\net461\\Avalonia.LeakTests.dll"), |
|
|
.Append("--propagate-exit-code") |
|
|
Timeout = 120000 |
|
|
.Append("--") |
|
|
|
|
|
.Append("tests\\Avalonia.LeakTests\\bin\\Release\\net461\\Avalonia.LeakTests.dll"), |
|
|
|
|
|
Timeout = 120000 |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (leakTestsExitCode != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception("Leak Tests failed"); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (leakTestsExitCode != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception("Leak Tests failed"); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Task("Copy-Files-Impl") |
|
|
Task("Copy-Files-Impl") |
|
|
.Does<AvaloniaBuildData>(data => |
|
|
.Does<AvaloniaBuildData>(data => |
|
|
{ |
|
|
{ |
|
|
@ -349,38 +353,38 @@ Task("Inspect-Impl") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsRunningOnWindows) |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.Platform != "NetCoreOnly") |
|
|
.Does(() => |
|
|
.Does(() => |
|
|
{ |
|
|
{ |
|
|
var badIssues = new []{"PossibleNullReferenceException"}; |
|
|
var badIssues = new []{"PossibleNullReferenceException"}; |
|
|
var whitelist = new []{"tests", "src\\android", "src\\ios", |
|
|
var whitelist = new []{"tests", "src\\android", "src\\ios", |
|
|
"src\\markup\\avalonia.markup.xaml\\portablexaml\\portable.xaml.github"}; |
|
|
"src\\markup\\avalonia.markup.xaml\\portablexaml\\portable.xaml.github"}; |
|
|
Information("Running code inspections"); |
|
|
Information("Running code inspections"); |
|
|
|
|
|
|
|
|
var exitCode = StartProcess(Context.Tools.Resolve("inspectcode.exe"), |
|
|
var exitCode = StartProcess(Context.Tools.Resolve("inspectcode.exe"), |
|
|
new ProcessSettings |
|
|
new ProcessSettings |
|
|
{ |
|
|
{ |
|
|
Arguments = "--output=artifacts\\inspectcode.xml --profile=Avalonia.sln.DotSettings Avalonia.sln", |
|
|
Arguments = "--output=artifacts\\inspectcode.xml --profile=Avalonia.sln.DotSettings Avalonia.sln", |
|
|
RedirectStandardOutput = true |
|
|
RedirectStandardOutput = true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
Information("Analyzing report"); |
|
|
Information("Analyzing report"); |
|
|
var doc = XDocument.Parse(System.IO.File.ReadAllText("artifacts\\inspectcode.xml")); |
|
|
var doc = XDocument.Parse(System.IO.File.ReadAllText("artifacts\\inspectcode.xml")); |
|
|
var failBuild = false; |
|
|
var failBuild = false; |
|
|
foreach(var xml in doc.Descendants("Issue")) |
|
|
foreach(var xml in doc.Descendants("Issue")) |
|
|
|
|
|
{ |
|
|
|
|
|
var typeId = xml.Attribute("TypeId").Value.ToString(); |
|
|
|
|
|
if(badIssues.Contains(typeId)) |
|
|
{ |
|
|
{ |
|
|
var typeId = xml.Attribute("TypeId").Value.ToString(); |
|
|
var file = xml.Attribute("File").Value.ToString().ToLower(); |
|
|
if(badIssues.Contains(typeId)) |
|
|
if(whitelist.Any(wh => file.StartsWith(wh))) |
|
|
{ |
|
|
continue; |
|
|
var file = xml.Attribute("File").Value.ToString().ToLower(); |
|
|
var line = xml.Attribute("Line").Value.ToString(); |
|
|
if(whitelist.Any(wh => file.StartsWith(wh))) |
|
|
Error(typeId + " - " + file + " on line " + line); |
|
|
continue; |
|
|
failBuild = true; |
|
|
var line = xml.Attribute("Line").Value.ToString(); |
|
|
|
|
|
Error(typeId + " - " + file + " on line " + line); |
|
|
|
|
|
failBuild = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
if(failBuild) |
|
|
} |
|
|
throw new Exception("Issues found"); |
|
|
if(failBuild) |
|
|
}); |
|
|
throw new Exception("Issues found"); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
// TASKS DEPENDENCY TREE |
|
|
// TASKS DEPENDENCY TREE |
|
|
|