Skip to content

Commit 85c13ec

Browse files
committed
choose build runner - xbuild or ms
1 parent b02f66d commit 85c13ec

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

RakeFile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,21 @@ namespace :source do
8585
args.with_defaults :nhibernate_version => ENV['nhibernate_version'] || NH_VERSION
8686
end
8787

88-
desc 'Compile the source'
89-
msbuild :compile, [:nhibernate_version] => :nhibernate_version do |msbuild, args|
90-
args.with_defaults :nhibernate_version => ENV['nhibernate_version'] || NH_VERSION
88+
task :choose_build_runner do |cmd, args|
89+
task_name = 'source:' + (Platform.is_nix? 'ms': 'x') + 'build'
90+
91+
Rake::Task[task_name].reenable
92+
Rake::Task[task_name].invoke(args)
93+
end
94+
95+
xbuild :xbuild do |xb|
96+
xb.solution = SLN
97+
xb.targets = [:Clean, :Build]
98+
xb.properties = {:Configuration => "Release"}
99+
end
100+
101+
msbuild :msbuild, [:nhibernate_version] => :nhibernate_version do |msbuild, args|
102+
args.with_defaults :nhibernate_version => NH_VERSION
91103

92104
nh_version_precompiler_switch = 'NH' + args.nhibernate_version.gsub('.', '')
93105

@@ -125,7 +137,7 @@ end
125137

126138
namespace :build do
127139
desc 'Run full build including tests'
128-
task :all => ['source:update_version', 'source:compile', 'specs:all'] do
140+
task :all => ['source:update_version', 'source:choose_build_runner', 'specs:all'] do
129141
puts 'Copying output to build directory'
130142
Dir.mkdir 'build' unless File.exist? 'build'
131143
Dir.glob 'src/FluentNHibernate/bin/Release/*.{dll,pdb,xml}' do |path|

0 commit comments

Comments
 (0)