Files
Untappd.Net/Rakefile
2015-06-19 15:37:15 -07:00

70 lines
1.7 KiB
Ruby

require 'bundler/setup'
require 'rake/clean'
require 'albacore'
require 'open-uri'
require 'fileutils'
require 'os'
require 'nokogiri'
import 'assets/tools.rake'
PACKAGES = File.expand_path("packages")
TOOLS = File.expand_path("tools")
NUGET = File.expand_path("#{TOOLS}/nuget")
Configuration = ENV['CONFIGURATION'] || 'Release'
desc 'retrieve dependencies'
task :retrieve => ['tools:nuget_fetch']
desc 'build the project'
task :build => [:compile]
desc 'Run the tests'
task :test => [:nunit]
desc 'Retrieve, Build, Test'
task :preflight => [:retrieve, :build, :test, :cs_lint]
build :compile => ['tools:nuget_fetch'] do |b|
b.prop 'Configuration', Configuration
b.sln = 'Untappd.Net.sln'
end
test_runner :nunit do |tests|
tests.files = FileList["src/**/*UnitTests/bin/#{Configuration}/*UnitTests.dll"] # dll files with test
tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with
end
task :cs_lint do
unless Dir.exists?('output')
Dir.mkdir('output')
end
CMD_PREFIX = ""
if !OS.windows?
CMD_PREFIX = "mono"
end
sh "#{CMD_PREFIX} packages/Mono.Gendarme.2.11.0.20121120/tools/gendarme.exe src/Untappd.Net/bin/#{Configuration}/Untappd.Net.dll --html output/gendarme.html --severity high+ --ignore assets/gendarme/gendarme.ignore --console"
end
# task :tests => :'tests:unit'
#task :ensure_nuget_key do
# raise 'missing env NUGET_KEY value' unless ENV['NUGET_KEY']
#end
#Albacore::Tasks::Release.new :release,
# pkg_dir: 'build/pkg',
# depend_on: [:create_nugets, :ensure_nuget_key],
# nuget_exe: 'packages/NuGet.CommandLine/tools/NuGet.exe',
# api_key: ENV['NUGET_KEY']