Created
March 16, 2010 00:41
-
-
Save squidsoup/333507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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