Skip to content

Instantly share code, notes, and snippets.

@squidsoup
Created March 16, 2010 00:41
Show Gist options
  • Save squidsoup/333507 to your computer and use it in GitHub Desktop.
Save squidsoup/333507 to your computer and use it in GitHub Desktop.
# Rakefile for .Net projects using MSBuild and nUnit
require 'rake/clean'
DOT_NET_PATH = "#{ENV["SystemRoot"]}/Microsoft.NET/Framework/v3.5/"
SOLUTION = "src/SOLUTION_NAME.sln"
CONFIG = "Debug"
NUNIT_EXE = "vendor/tools/nunit-console-x86.exe"
OUTPUT_PATH = "build/"
CLEAN.include(OUTPUT_PATH)
task :default => ["clean", "build:all"]
task :test => ["build:test"]
namespace :build do
task :all => [:compile, :test]
desc "Use MSBuild to build the solution: '#{SOLUTION}'"
task :compile do
sh "#{DOT_NET_PATH}msbuild.exe /p:Configuration=#{CONFIG} #{SOLUTION}"
end
desc "Run unit tests on '#{SOLUTION}'"
puts "Running unit tests on '#{SOLUTION}'"
task :test do
tests = FileList["src/**/*.*Tests.dll"].exclude(/obj\//)
puts tests
sh "#{NUNIT_EXE} #{tests} /nologo"
#sh "#{NUNIT_EXE} #{tests} /nologo /xml=#{OUTPUT_PATH}TestResults.xml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment