diff --git a/build/_k-standard-goals.shade b/build/_k-standard-goals.shade index a7f867ad20..c3408b99ef 100644 --- a/build/_k-standard-goals.shade +++ b/build/_k-standard-goals.shade @@ -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); } diff --git a/build/_stylecop-run.shade b/build/_stylecop-run.shade new file mode 100644 index 0000000000..0b729e651f --- /dev/null +++ b/build/_stylecop-run.shade @@ -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}' \ No newline at end of file diff --git a/build/_stylecop-setup.shade b/build/_stylecop-setup.shade new file mode 100644 index 0000000000..7c8e6369e7 --- /dev/null +++ b/build/_stylecop-setup.shade @@ -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); + } +} \ No newline at end of file