2018-09-12 03:49:10 +08:00
|
|
|
#addin "nuget:?package=CodeFileSanity&version=0.0.21"
|
|
|
|
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2"
|
|
|
|
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
|
2018-07-30 02:49:26 +08:00
|
|
|
|
2018-07-24 03:28:56 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ARGUMENTS
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-07-26 09:40:28 +08:00
|
|
|
var target = Argument("target", "Build");
|
2018-07-31 03:45:15 +08:00
|
|
|
var framework = Argument("framework", "netcoreapp2.1");
|
2018-07-26 09:40:28 +08:00
|
|
|
var configuration = Argument("configuration", "Release");
|
2018-07-24 03:28:56 +08:00
|
|
|
|
|
|
|
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
|
2018-07-30 08:12:39 +08:00
|
|
|
var osuSolution = new FilePath("./osu.sln");
|
2018-07-24 03:28:56 +08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// TASKS
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task("Compile")
|
|
|
|
.Does(() => {
|
|
|
|
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
|
|
|
|
Framework = framework,
|
2018-07-26 09:40:28 +08:00
|
|
|
Configuration = configuration
|
2018-07-24 03:28:56 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-07-26 09:40:28 +08:00
|
|
|
Task("Test")
|
2018-09-16 22:25:19 +08:00
|
|
|
.Does(() => {
|
|
|
|
var testAssemblies = GetFiles("**/*.Tests/bin/**/*.Tests.dll");
|
|
|
|
|
|
|
|
DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings {
|
|
|
|
Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx",
|
|
|
|
Parallel = true,
|
|
|
|
ToolTimeout = TimeSpan.FromMinutes(10),
|
2018-07-24 03:28:56 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-08-08 04:36:52 +08:00
|
|
|
// windows only because both inspectcore and nvika depend on net45
|
2018-07-30 02:49:26 +08:00
|
|
|
Task("InspectCode")
|
2018-08-08 04:36:52 +08:00
|
|
|
.WithCriteria(IsRunningOnWindows())
|
2018-08-04 06:02:31 +08:00
|
|
|
.IsDependentOn("Compile")
|
2018-07-30 02:49:26 +08:00
|
|
|
.Does(() => {
|
2018-08-07 04:50:23 +08:00
|
|
|
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
|
2018-08-10 02:45:34 +08:00
|
|
|
|
2018-09-16 22:25:40 +08:00
|
|
|
DotNetCoreRestore(osuSolution.FullPath, new DotNetCoreRestoreSettings {
|
|
|
|
Verbosity = DotNetCoreVerbosity.Quiet
|
|
|
|
});
|
2018-08-06 04:24:52 +08:00
|
|
|
|
2018-07-30 08:12:39 +08:00
|
|
|
InspectCode(osuSolution, new InspectCodeSettings {
|
|
|
|
CachesHome = "inspectcode",
|
|
|
|
OutputFile = "inspectcodereport.xml",
|
|
|
|
});
|
|
|
|
|
2018-08-07 04:50:23 +08:00
|
|
|
StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
2018-07-30 08:12:39 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Task("CodeFileSanity")
|
|
|
|
.Does(() => {
|
2018-08-04 06:01:17 +08:00
|
|
|
ValidateCodeSanity(new ValidateCodeSanitySettings {
|
|
|
|
RootDirectory = ".",
|
|
|
|
IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor
|
|
|
|
});
|
2018-07-30 02:49:26 +08:00
|
|
|
});
|
|
|
|
|
2018-07-26 09:40:28 +08:00
|
|
|
Task("Build")
|
2018-07-30 08:12:39 +08:00
|
|
|
.IsDependentOn("CodeFileSanity")
|
|
|
|
.IsDependentOn("InspectCode")
|
2018-07-26 09:40:28 +08:00
|
|
|
.IsDependentOn("Test");
|
2018-07-24 03:28:56 +08:00
|
|
|
|
|
|
|
RunTarget(target);
|