mirror of
https://github.com/ppy/osu.git
synced 2025-01-09 02:13:21 +08:00
Use dotnet tool
for InspectCode build script
This commit is contained in:
parent
030df8234a
commit
b20898a1ac
@ -13,6 +13,24 @@
|
|||||||
"commands": [
|
"commands": [
|
||||||
"dotnet-format"
|
"dotnet-format"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"jetbrains.resharper.globaltools": {
|
||||||
|
"version": "2020.2.4",
|
||||||
|
"commands": [
|
||||||
|
"jb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nvika": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"commands": [
|
||||||
|
"nvika"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"codefilesanity": {
|
||||||
|
"version": "15.0.0",
|
||||||
|
"commands": [
|
||||||
|
"CodeFileSanity"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,4 @@
|
|||||||
#addin "nuget:?package=CodeFileSanity&version=0.0.36"
|
#addin "nuget:?package=CodeFileSanity&version=0.0.36"
|
||||||
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2020.1.3"
|
|
||||||
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
|
|
||||||
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// ARGUMENTS
|
// ARGUMENTS
|
||||||
@ -18,23 +15,15 @@ var desktopSlnf = rootDirectory.CombineWithFilePath("osu.Desktop.slnf");
|
|||||||
// TASKS
|
// TASKS
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// windows only because both inspectcode and nvika depend on net45
|
|
||||||
Task("InspectCode")
|
Task("InspectCode")
|
||||||
.WithCriteria(IsRunningOnWindows())
|
|
||||||
.Does(() => {
|
.Does(() => {
|
||||||
InspectCode(desktopSlnf, new InspectCodeSettings {
|
var inspectcodereport = "inspectcodereport.xml";
|
||||||
CachesHome = "inspectcode",
|
var cacheDir = "inspectcode";
|
||||||
OutputFile = "inspectcodereport.xml",
|
var verbosity = AppVeyor.IsRunningOnAppVeyor ? "WARN" : "INFO"; // Don't flood CI output
|
||||||
ArgumentCustomization = arg => {
|
|
||||||
if (AppVeyor.IsRunningOnAppVeyor) // Don't flood CI output
|
|
||||||
arg.Append("--verbosity:WARN");
|
|
||||||
return arg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
int returnCode = StartProcess(nVikaToolPath, $@"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
DotNetCoreTool(rootDirectory.FullPath,
|
||||||
if (returnCode != 0)
|
"jb", $@"inspectcode ""{desktopSlnf}"" --output=""{inspectcodereport}"" --caches-home=""{cacheDir}"" --verbosity={verbosity}");
|
||||||
throw new Exception($"inspectcode failed with return code {returnCode}");
|
DotNetCoreTool(rootDirectory.FullPath, "nvika", $@"parsereport ""{inspectcodereport}"" --treatwarningsaserrors");
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("CodeFileSanity")
|
Task("CodeFileSanity")
|
||||||
|
Loading…
Reference in New Issue
Block a user