From df831f29db3cf055f2e0d56b68900192cea241fd Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 19 Jun 2015 21:41:43 -0500 Subject: [PATCH 1/5] add rake clean --- Rakefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 0792408..5261b6a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -require 'bundler/setup' require 'rake/clean' require 'albacore' require 'open-uri' @@ -25,7 +24,17 @@ task :test => [:nunit] desc 'Retrieve, Build, Test' task :preflight => [:retrieve, :build, :test, :cs_lint] +desc 'cleans up artifacts' +task :clean do + puts 'cleaning artifacts from directory' + FileUtils.rm_rf("output") + FileUtils.rm_rf("packages") + FileUtils.rm_rf("tools") + FileUtils.rm_rf(Dir.glob("src/**/*.dll")) + FileUtils.rm_rf(Dir.glob("src/**/*.pdb")) + FileUtils.rm_rf(Dir.glob("src/**/*.mdb")) +end build :compile => ['tools:nuget_fetch'] do |b| b.prop 'Configuration', Configuration @@ -37,7 +46,8 @@ test_runner :nunit do |tests| tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with end -task :cs_lint do +desc 'run static analysis' +task :cs_lint => :build do unless Dir.exists?('output') Dir.mkdir('output') From 68a2c5c472aaf3121cad24fd325ef71b3150df94 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 19 Jun 2015 21:42:09 -0500 Subject: [PATCH 2/5] actually include clean in preflight --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 5261b6a..0315c9c 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,7 @@ desc 'Run the tests' task :test => [:nunit] desc 'Retrieve, Build, Test' -task :preflight => [:retrieve, :build, :test, :cs_lint] +task :preflight => [:clean, :retrieve, :build, :test, :cs_lint] desc 'cleans up artifacts' task :clean do From aeba49e0eade853fa61de2a4997570039178f285 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 19 Jun 2015 21:48:27 -0500 Subject: [PATCH 3/5] use bundle exec with circle --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 999d78d..c024421 100644 --- a/circle.yml +++ b/circle.yml @@ -3,4 +3,4 @@ dependencies: - sudo apt-get update; sudo apt-get install mono-devel test: override: - - rake preflight + - bundle exec rake preflight From 263d7e664b98024a63ee36d1067d39b4cc3fb46d Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 19 Jun 2015 21:52:15 -0500 Subject: [PATCH 4/5] have travis bundle exec as well --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f0d0345..18fb75d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ sudo: false script: - gem install bundle - bundle - - rake preflight + - bundle exec rake preflight From 29582a0a9a86bfe06b73406e938d4d2e29000206 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 19 Jun 2015 22:09:53 -0500 Subject: [PATCH 5/5] if we cannot https we must http for nuget --- Rakefile | 7 ++++--- assets/tools.rake | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 0315c9c..8953f54 100644 --- a/Rakefile +++ b/Rakefile @@ -20,9 +20,11 @@ task :build => [:compile] desc 'Run the tests' task :test => [:nunit] +desc 'run Static analysis linters' +task :lint => [:build, :cs_lint] desc 'Retrieve, Build, Test' -task :preflight => [:clean, :retrieve, :build, :test, :cs_lint] +task :preflight => [:clean, :retrieve, :build, :test, :lint] desc 'cleans up artifacts' task :clean do @@ -46,8 +48,7 @@ test_runner :nunit do |tests| tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with end -desc 'run static analysis' -task :cs_lint => :build do +task :cs_lint do unless Dir.exists?('output') Dir.mkdir('output') diff --git a/assets/tools.rake b/assets/tools.rake index beca1da..7bb6a32 100644 --- a/assets/tools.rake +++ b/assets/tools.rake @@ -7,10 +7,17 @@ namespace :tools do if !FileTest.exist?("#{NUGET}/nuget.exe") puts 'Downloading nuget from nuget.org' + begin FileUtils.mkdir_p("#{NUGET}") File.open("#{NUGET}/nuget.exe", "wb") do |file| file.write open('https://nuget.org/nuget.exe').read end + rescue + FileUtils.rm_rf("#{NUGET}/nuget.exe") + File.open("#{NUGET}/nuget.exe", "wb") do |file| + file.write open('http://nuget.org/nuget.exe').read + end + end end end @@ -27,7 +34,7 @@ namespace :tools do end end - # Make sure we get solution-level deps + # Make sure we get solution-level deps sh "#{CMD_PREFIX} #{NUGET}/nuget.exe i .nuget/packages.config -o packages" FileList["src/**/packages.config"].each { |filepath|