Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (61 sloc) 2.681 kb
require 'albacore'
require 'fileutils'
version = IO.read("src/CommonAssemblyInfo.cs").split(/AssemblyInformationalVersion\("/, 2)[1].split(/"/).first
xunit_command_net20 = "packages/xunit.runners.1.9.2/tools/xunit.console.exe"
xunit_command_net40 = "packages/xunit.runners.1.9.2/tools/xunit.console.clr4.exe"
nuget_command = "packages/NuGet.CommandLine.2.7.0/tools/NuGet.exe"
solution = "src/XBehave.sln"
output = "bin"
specs = [
{ :command => xunit_command_net20, :assembly => "src/test/Xbehave.Sdk.Specifications.Net35/bin/Release/Xbehave.Sdk.Specifications.Net35.dll" },
{ :command => xunit_command_net20, :assembly => "src/test/Xbehave.Specifications.Net35/bin/Release/Xbehave.Specifications.Net35.dll" },
{ :command => xunit_command_net40, :assembly => "src/test/Xbehave.Sdk.Specifications.Net40/bin/Release/Xbehave.Sdk.Specifications.Net40.dll" },
{ :command => xunit_command_net40, :assembly => "src/test/Xbehave.Specifications.Net40/bin/Release/Xbehave.Specifications.Net40.dll" }
]
features = [
{ :command => xunit_command_net20, :assembly => "src/test/Xbehave.Features.Net35/bin/Release/Xbehave.Features.Net35.dll" },
{ :command => xunit_command_net40, :assembly => "src/test/Xbehave.Features.Net40/bin/Release/Xbehave.Features.Net40.dll" },
{ :command => xunit_command_net40, :assembly => "src/test/Xbehave.Features.Net45/bin/Release/Xbehave.Features.Net45.dll" }
]
nuspec = "src/Xbehave.nuspec"
Albacore.configure do |config|
config.log_level = :verbose
end
desc "Execute default tasks"
task :default => [:spec, :feature, :pack]
desc "Clean solution"
msbuild :clean do |msb|
FileUtils.rmtree output
msb.properties = { :configuration => :Release }
msb.targets = [:Clean]
msb.solution = solution
end
desc "Build solution"
msbuild :build => [:clean] do |msb|
msb.properties = { :configuration => :Release }
msb.targets = [:Build]
msb.solution = solution
end
desc "Execute specs"
task :spec => [:build] do
execute_xunit specs
end
desc "Execute features"
task :feature => [:build] do
execute_xunit features
end
desc "Create the nuget package"
exec :pack => [:build] do |cmd|
FileUtils.mkpath output
cmd.command = nuget_command
cmd.parameters "pack " + nuspec + " -Version " + version + " -OutputDirectory " + output
end
def execute_xunit(tests)
tests.each do |test|
xunit = XUnitTestRunner.new
xunit.command = test[:command]
xunit.assembly = test[:assembly]
xunit.options "/html", File.expand_path(test[:assembly] + ".TestResults.html"), "/xml", File.expand_path(test[:assembly] + ".TestResults.xml")
xunit.execute
end
end
Jump to Line
Something went wrong with that request. Please try again.