Adding scripts for stylecop
This commit is contained in:
parent
92e0c16499
commit
9a960a5831
|
|
@ -88,6 +88,11 @@ default Configuration='Release'
|
||||||
-// Find all dirs that contain a gruntfile.js file
|
-// Find all dirs that contain a gruntfile.js file
|
||||||
var gruntDirs = '${GetDirectoriesContaining(Directory.GetCurrentDirectory(), "gruntfile.js")}'
|
var gruntDirs = '${GetDirectoriesContaining(Directory.GetCurrentDirectory(), "gruntfile.js")}'
|
||||||
grunt each='var gruntDir in gruntDirs'
|
grunt each='var gruntDir in gruntDirs'
|
||||||
|
|
||||||
|
#stylecop
|
||||||
|
stylecop-setup
|
||||||
|
stylecop-run each='var projectFile in Files.Include("src/**/project.json")'
|
||||||
|
stylecop-run each='var projectFile in Files.Include("test/**/project.json")'
|
||||||
|
|
||||||
functions @{
|
functions @{
|
||||||
string E(string key) { return Environment.GetEnvironmentVariable(key); }
|
string E(string key) { return Environment.GetEnvironmentVariable(key); }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
@{/*
|
||||||
|
|
||||||
|
stylecop-run
|
||||||
|
Run StyleCop for your project.
|
||||||
|
|
||||||
|
projectFile=''
|
||||||
|
Required. Path to the test project.json to use.
|
||||||
|
|
||||||
|
*/}
|
||||||
|
|
||||||
|
exec program='bin\_stylecop\bin\StyleCop.KRunner.exe' commandline='${projectFile}'
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
@{/*
|
||||||
|
|
||||||
|
stylecop-setup
|
||||||
|
Downloads packages to prepare for running stylecop
|
||||||
|
|
||||||
|
*/}
|
||||||
|
var packagesDirectory = 'bin\_stylecop'
|
||||||
|
var binariesDirectory = 'bin\_stylecop\bin'
|
||||||
|
|
||||||
|
nuget-install package='StyleCop.KRunner' outputDir='${packagesDirectory}' extra='-pre -ExcludeVersion'
|
||||||
|
nuget-install package='StyleCop.KRules' outputDir='${packagesDirectory}' extra='-pre -ExcludeVersion'
|
||||||
|
|
||||||
|
@{
|
||||||
|
var binaries =
|
||||||
|
Files.Include(Path.Combine(packagesDirectory, "*", "*net45*", "*.*"))
|
||||||
|
.Concat(Files.Include(Path.Combine(packagesDirectory, "*lib*", "*.dll")));
|
||||||
|
|
||||||
|
Directory.CreateDirectory(binariesDirectory);
|
||||||
|
|
||||||
|
foreach(var file in binaries)
|
||||||
|
{
|
||||||
|
File.Copy(file, Path.Combine(binariesDirectory, Path.GetFileName(file)), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue