Adding scripts for stylecop

This commit is contained in:
Ryan Nowak 2014-05-21 14:54:56 -07:00
parent 92e0c16499
commit 9a960a5831
3 changed files with 40 additions and 0 deletions

View File

@ -88,6 +88,11 @@ default Configuration='Release'
-// Find all dirs that contain a gruntfile.js file
var gruntDirs = '${GetDirectoriesContaining(Directory.GetCurrentDirectory(), "gruntfile.js")}'
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 @{
string E(string key) { return Environment.GetEnvironmentVariable(key); }

11
build/_stylecop-run.shade Normal file
View File

@ -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}'

View File

@ -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);
}
}