Add dotnet format check in CI.

This commit is contained in:
Huo Yaoyuan
2019-10-23 21:25:14 +08:00
parent 4248663b88
commit 2e64ffc588
2 changed files with 11 additions and 0 deletions

View File

@@ -7,6 +7,12 @@
"commands": [
"dotnet-cake"
]
},
"dotnet-format": {
"version": "3.1.37601",
"commands": [
"dotnet-format"
]
}
}
}

View File

@@ -19,6 +19,7 @@ var rootDirectory = new DirectoryPath("..");
var tempDirectory = new DirectoryPath("temp");
var artifactsDirectory = rootDirectory.Combine("artifacts");
var sln = rootDirectory.CombineWithFilePath("osu-framework.sln");
var desktopBuilds = rootDirectory.CombineWithFilePath("build/Desktop.proj");
var desktopSlnf = rootDirectory.CombineWithFilePath("osu-framework.Desktop.slnf");
var frameworkProject = rootDirectory.CombineWithFilePath("osu.Framework/osu.Framework.csproj");
@@ -131,6 +132,9 @@ Task("CodeFileSanity")
});
});
Task("DotnetFormat")
.Does(() => DotNetCoreTool(sln.FullPath, "format", "--dry-run --check"));
Task("PackFramework")
.Does(() => {
DotNetCorePack(frameworkProject.FullPath, new DotNetCorePackSettings{
@@ -212,6 +216,7 @@ Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("DetermineAppveyorBuildProperties")
.IsDependentOn("CodeFileSanity")
.IsDependentOn("DotnetFormat")
.IsDependentOn("InspectCode")
.IsDependentOn("Test")
.IsDependentOn("DetermineAppveyorDeployProperties")