Created
January 8, 2011 23:25
-
-
Save thecodejunkie/771244 to your computer and use it in GitHub Desktop.
Start of Nancy rake file
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
require 'rubygems' | |
require 'albacore' | |
OUTPUT = "build" | |
CONFIGURATION = 'Release' | |
ROOT_FOLDER = File.expand_path(File.dirname(__FILE__)) | |
ARTIFACTS_FOLDER = File.expand_path(File.join(File.dirname(__FILE__), "build")) + '/' | |
SHARED_ASSEMBLY_INFO = 'src/SharedAssemblyInfo.cs' | |
SOLUTION_FILE = 'src/Nancy.sln' | |
desc "Compiles solution and runs unit tests" | |
task :default => [:clean] #:clean, :version, :compile] | |
desc "Executes all MSpec and Xunit tests" | |
task :test => [:mspec, :xunit] | |
desc "Removed previous build artifacts in preperation for a new build" | |
task :clean do | |
assemblies = FileList["src/**/#{CONFIGURATION}/*.dll"].exclude(/obj\//).exclude(/.Tests/) | |
assemblies.each do |assembly| | |
puts assembly | |
end | |
end | |
desc "Compile solution file" | |
msbuild :compile do |msb| | |
msb.properties :configuration => CONFIGURATION #, :outdir => ARTIFACTS_FOLDER | |
msb.targets :Clean, :Build | |
msb.solution = SOLUTION_FILE | |
end | |
desc "Update shared assemblyinfo file for the build" | |
assemblyinfo :version do |asm| | |
asm.version = "0.1.2.3" | |
asm.company_name = "a test company" | |
asm.product_name = "a product name goes here" | |
asm.title = "my assembly title" | |
asm.description = "this is the assembly description" | |
asm.copyright = "copyright (C) Andreas Hakansson and contributors" | |
asm.output_file = SHARED_ASSEMBLY_INFO | |
end | |
desc "Executes MSpec tests" | |
mspec :mspec do |mspec| | |
mspec.command = "tools/mSpec/mspec.exe" | |
mspec.assemblies "src/Nancy.Tests/bin/#{CONFIGURATION}/Nancy.Tests.dll" | |
end | |
testAssemblies = FileList["src/**/#{CONFIGURATION}/*.Tests.dll"].exclude(/obj\//) | |
testAssemblies.each do |testAssembly| | |
desc "Executes xUnit tests" | |
xunit :xunit do |xunit| | |
xunit.command = "tools/xunit/xunit.console.clr4.x86.exe" | |
xunit.assembly = testAssembly | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment