Merge pull request #42 from tparnell8/rakeRefactor

Rake refactor
This commit is contained in:
Tommy Parnell
2015-06-19 22:29:06 -05:00
4 changed files with 23 additions and 5 deletions

View File

@@ -7,4 +7,4 @@ sudo: false
script:
- gem install bundle
- bundle
- rake preflight
- bundle exec rake preflight

View File

@@ -1,4 +1,3 @@
require 'bundler/setup'
require 'rake/clean'
require 'albacore'
require 'open-uri'
@@ -21,11 +20,23 @@ 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 => [:retrieve, :build, :test, :cs_lint]
task :preflight => [:clean, :retrieve, :build, :test, :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

View File

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

View File

@@ -3,4 +3,4 @@ dependencies:
- sudo apt-get update; sudo apt-get install mono-devel
test:
override:
- rake preflight
- bundle exec rake preflight