albacore 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/.travis.yml +1 -0
- data/Gemfile +4 -1
- data/lib/albacore/assemblyinfo.rb +2 -1
- data/lib/albacore/config/netversion.rb +11 -8
- data/lib/albacore/output.rb +17 -14
- data/lib/albacore/sqlcmd.rb +3 -1
- data/lib/albacore/xunittestrunner.rb +4 -0
- data/lib/version.rb +1 -1
- data/spec/assemblyinfo_spec.rb +9 -0
- data/spec/msbuild_spec.rb +287 -287
- data/spec/mstesttestrunner_spec.rb +144 -144
- data/spec/netversion_spec.rb +53 -0
- data/spec/nugetinstall_spec.rb +46 -46
- data/spec/output_spec.rb +30 -0
- data/spec/sqlcmd_spec.rb +1 -1
- data/spec/support/CodeCoverage/xunit/assemblies/xunit.xml +2604 -2604
- data/spec/support/TestSolution/LocalTestRun.testrunconfig +4 -4
- data/spec/support/TestSolution/TestSolution.FailingTests/TestSolution.FailingTests.csproj +94 -94
- data/spec/support/TestSolution/TestSolution.FluentMigrator/TestSolution.FluentMigrator.csproj +94 -94
- data/spec/support/TestSolution/TestSolution.MSTestTests.NET40/Properties/AssemblyInfo.cs +36 -36
- data/spec/support/TestSolution/TestSolution.MSTestTests.NET40/TestSolution.MSTestTests.NET40.csproj +52 -52
- data/spec/support/TestSolution/TestSolution.MSTestTests/TestSolution.MSTestTests.csproj +90 -90
- data/spec/support/TestSolution/TestSolution.MSpecTests/TestSolution.MSpecTests.csproj +103 -103
- data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +115 -115
- data/spec/support/TestSolution/TestSolution.Tests/TestSolution.Tests.csproj +100 -100
- data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +101 -101
- data/spec/support/TestSolution/TestSolution.sln +75 -75
- data/spec/support/TestSolution/TestSolution.vsmdi +5 -5
- data/spec/support/TestSolution/TestSolution/TestSolution.csproj +90 -90
- data/spec/support/Tools/MSTest-2010/MSTest.exe.config +31 -31
- data/spec/support/Tools/MSTest-2010/Microsoft.VisualStudio.QualityTools.LoadTestExcelAddIn.dll.manifest +251 -251
- data/spec/support/Tools/MSTest-2010/Microsoft.VisualStudio.QualityTools.LoadTestExcelAddIn.vsto +105 -105
- data/spec/support/Tools/Machine.Specifications-0.5.3/lib/Machine.Specifications.dll.tdnet +5 -5
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/CommandLine.xml +504 -504
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.4.1.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.4.5.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.0 - VS2008.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.0 - VS2010.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.1 - VS2008.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.1 - VS2010.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.0 - VS2008.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.0 - VS2010.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.1 - VS2008.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.1 - VS2010.bat +4 -4
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallTDNetRunner.bat +16 -16
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallTDNetRunnerSilent.bat +16 -16
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/License.txt +53 -53
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/Machine.Specifications.GallioAdapter.plugin +42 -42
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/Machine.Specifications.dll.tdnet +5 -5
- data/spec/support/Tools/Machine.Specifications-0.5.3/tools/install.ps1 +5 -5
- data/spec/support/Tools/XUnit-v1.9/EULA.txt +28 -28
- data/spec/support/Tools/XUnit-v1.9/HTML.xslt +125 -125
- data/spec/support/Tools/XUnit-v1.9/NUnitXml.xslt +120 -120
- data/spec/support/Tools/XUnit-v1.9/xunit.console.clr4.exe.config +20 -20
- data/spec/support/Tools/XUnit-v1.9/xunit.console.clr4.x86.exe.config +20 -20
- data/spec/support/Tools/XUnit-v1.9/xunit.console.exe.config +20 -20
- data/spec/support/Tools/XUnit-v1.9/xunit.console.x86.exe.config +20 -20
- data/spec/support/Tools/XUnit-v1.9/xunit.dll.tdnet +4 -4
- data/spec/support/Tools/XUnit-v1.9/xunit.extensions.xml +805 -805
- data/spec/support/Tools/XUnit-v1.9/xunit.runner.utility.xml +1212 -1212
- data/spec/support/Tools/XUnit-v1.9/xunit.xml +2604 -2604
- data/spec/support/assemblyinfotester.rb +1 -0
- data/spec/xunit_spec.rb +38 -0
- metadata +14 -7
data/.bundle/config
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -12,7 +12,7 @@ class AssemblyInfo
|
|
12
12
|
attr_accessor :input_file, :output_file, :language,
|
13
13
|
:version, :title, :description, :custom_attributes,
|
14
14
|
:copyright, :com_visible, :com_guid, :company_name, :product_name,
|
15
|
-
:file_version, :trademark, :lang_engine
|
15
|
+
:file_version, :trademark, :lang_engine, :informational_version
|
16
16
|
|
17
17
|
attr_array :namespaces, :custom_data
|
18
18
|
attr_hash :custom_attributes
|
@@ -105,6 +105,7 @@ class AssemblyInfo
|
|
105
105
|
|
106
106
|
build_attribute(data, "AssemblyVersion", @version)
|
107
107
|
build_attribute(data, "AssemblyFileVersion", @file_version)
|
108
|
+
build_attribute(data, "AssemblyInformationalVersion", @informational_version)
|
108
109
|
|
109
110
|
data << ""
|
110
111
|
if @custom_attributes != nil
|
@@ -1,21 +1,24 @@
|
|
1
1
|
module Configuration
|
2
2
|
module NetVersion
|
3
|
+
include Failure
|
4
|
+
|
3
5
|
def win_dir
|
4
|
-
|
6
|
+
ENV['windir'] || ENV['WINDIR'] || 'C:/Windows'
|
5
7
|
end
|
6
8
|
|
7
9
|
def get_net_version(netversion)
|
8
10
|
case netversion
|
9
|
-
when :net2, :net20
|
10
|
-
version =
|
11
|
+
when :net2, :net20, :net3, :net30
|
12
|
+
version = 'v2.0.50727'
|
11
13
|
when :net35
|
12
|
-
version =
|
13
|
-
when :net4, :net40
|
14
|
-
version =
|
14
|
+
version = 'v3.5'
|
15
|
+
when :net4, :net40, :net45
|
16
|
+
version = 'v4.0.30319'
|
15
17
|
else
|
16
|
-
|
18
|
+
fail_with_message "The .NET Framework #{netversion} is not supported"
|
17
19
|
end
|
18
|
-
|
20
|
+
|
21
|
+
File.join win_dir, 'Microsoft.NET', 'Framework', version
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
data/lib/albacore/output.rb
CHANGED
@@ -4,7 +4,6 @@ require 'ostruct'
|
|
4
4
|
require 'fileutils'
|
5
5
|
|
6
6
|
class OutputBuilder
|
7
|
-
include FileUtils
|
8
7
|
include ::Rake::DSL if defined?(::Rake::DSL)
|
9
8
|
|
10
9
|
def initialize(dir_to, dir_from)
|
@@ -13,7 +12,7 @@ class OutputBuilder
|
|
13
12
|
end
|
14
13
|
|
15
14
|
def dir(dir)
|
16
|
-
cp_r "#{@dir_from}/#{dir}", @dir_to
|
15
|
+
FileUtils.cp_r "#{@dir_from}/#{dir}", @dir_to
|
17
16
|
end
|
18
17
|
|
19
18
|
def file(f)
|
@@ -23,7 +22,7 @@ class OutputBuilder
|
|
23
22
|
def file(f, ft)
|
24
23
|
#todo find more elegant way to create base dir if missing for file.
|
25
24
|
initialize_to_path(ft)
|
26
|
-
cp "#{@dir_from}/#{f}", "#{@dir_to}/#{ft}"
|
25
|
+
FileUtils.cp "#{@dir_from}/#{f}", "#{@dir_to}/#{ft}"
|
27
26
|
end
|
28
27
|
|
29
28
|
def erb(f, ft, locals)
|
@@ -32,16 +31,16 @@ class OutputBuilder
|
|
32
31
|
File.open("#{@dir_to}/#{ft}", 'w') {|f| f.write erb.result(ErbBinding.new(locals).get_binding)}
|
33
32
|
end
|
34
33
|
|
35
|
-
def self.output_to(dir_to, dir_from)
|
36
|
-
rmtree dir_to
|
37
|
-
|
34
|
+
def self.output_to(dir_to, dir_from, keep_to)
|
35
|
+
FileUtils.rmtree dir_to unless keep_to
|
36
|
+
FileUtils.mkdir_p dir_to unless Dir.exists? dir_to
|
38
37
|
yield OutputBuilder.new(dir_to, dir_from)
|
39
38
|
end
|
40
39
|
|
41
40
|
private
|
42
41
|
def initialize_to_path(ft)
|
43
42
|
topath = File.dirname("#{@dir_to}/#{ft}")
|
44
|
-
mkdir_p topath unless File.exist? topath
|
43
|
+
FileUtils.mkdir_p topath unless File.exist? topath
|
45
44
|
topath
|
46
45
|
end
|
47
46
|
end
|
@@ -58,20 +57,21 @@ class Output
|
|
58
57
|
|
59
58
|
def initialize
|
60
59
|
super()
|
61
|
-
|
60
|
+
|
62
61
|
@files = []
|
63
62
|
@erbs = []
|
64
63
|
@directories = []
|
64
|
+
@keep_to = false
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
def execute()
|
68
68
|
fail_with_message 'No base dir' if @from_dir.nil?
|
69
69
|
fail_with_message 'No output dir' if @to_dir.nil?
|
70
|
-
|
71
|
-
OutputBuilder.output_to(@to_dir, @from_dir) do |o|
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
|
71
|
+
OutputBuilder.output_to(@to_dir, @from_dir, @keep_to) do |o|
|
72
|
+
@directories.each { |f| o.dir f }
|
73
|
+
@files.each { |f| o.file *f }
|
74
|
+
@erbs.each { |f| o.erb *f }
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -80,6 +80,9 @@ class Output
|
|
80
80
|
@files << [f,f_to]
|
81
81
|
end
|
82
82
|
|
83
|
+
def keep_to
|
84
|
+
@keep_to = true
|
85
|
+
end
|
83
86
|
def erb(f, opts={})
|
84
87
|
f_to = opts[:as] || f
|
85
88
|
@erbs << [f,f_to,opts[:locals]||{}]
|
data/lib/albacore/sqlcmd.rb
CHANGED
@@ -51,11 +51,13 @@ class SQLCmd
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def check_command
|
54
|
+
sql2012cmdPath = File.join(ENV['SystemDrive'],'program files','microsoft sql server','110','tools','binn', 'sqlcmd.exe')
|
54
55
|
sql2008cmdPath = File.join(ENV['SystemDrive'],'program files','microsoft sql server','100','tools','binn', 'sqlcmd.exe')
|
55
56
|
sql2005cmdPath = File.join(ENV['SystemDrive'],'program files','microsoft sql server','90','tools','binn', 'sqlcmd.exe')
|
57
|
+
sql2012cmdPathx86 = File.join(ENV['SystemDrive'],'program files (x86)','microsoft sql server','110','tools','binn', 'sqlcmd.exe')
|
56
58
|
sql2008cmdPathx86 = File.join(ENV['SystemDrive'],'program files (x86)','microsoft sql server','100','tools','binn', 'sqlcmd.exe')
|
57
59
|
sql2005cmdPathx86 = File.join(ENV['SystemDrive'],'program files (x86)','microsoft sql server','90','tools','binn', 'sqlcmd.exe')
|
58
|
-
@command = [sql2008cmdPath, sql2005cmdPath, sql2008cmdPathx86, sql2005cmdPathx86].select { |p| File.exist?(p) }.first
|
60
|
+
@command = [sql2012cmdPath, sql2008cmdPath, sql2005cmdPath, sql2012cmdPathx86, sql2008cmdPathx86, sql2005cmdPathx86].select { |p| File.exist?(p) }.first
|
59
61
|
return true if @command != nil
|
60
62
|
fail_with_message 'SQLCmd.command cannot be nil.'
|
61
63
|
return false
|
data/lib/version.rb
CHANGED
data/spec/assemblyinfo_spec.rb
CHANGED
@@ -213,6 +213,7 @@ end
|
|
213
213
|
@asm.com_visible = @tester.com_visible
|
214
214
|
@asm.com_guid = @tester.com_guid
|
215
215
|
@asm.file_version = @tester.file_version
|
216
|
+
@asm.informational_version = @tester.informational_version
|
216
217
|
@asm.trademark = @tester.trademark
|
217
218
|
@asm.company_name = @tester.company_name
|
218
219
|
|
@@ -279,6 +280,10 @@ end
|
|
279
280
|
it "should contain the trademark information" do
|
280
281
|
subject.scan(%Q|#{s}assembly: AssemblyTrademark("#{@tester.trademark}")#{e}|).length.should == 1
|
281
282
|
end
|
283
|
+
|
284
|
+
it "should contain the informational version information" do
|
285
|
+
subject.scan(%Q|#{s}assembly: AssemblyInformationalVersion("#{@tester.informational_version}")#{e}|).length.should == 1
|
286
|
+
end
|
282
287
|
end
|
283
288
|
end
|
284
289
|
|
@@ -325,6 +330,10 @@ describe AssemblyInfo, "when generating an assembly info file with no attributes
|
|
325
330
|
it "should not contain the trademark information" do
|
326
331
|
subject.scan(%Q|[assembly: AssemblyTrademark("#{@tester.trademark}")]|).should be_empty
|
327
332
|
end
|
333
|
+
|
334
|
+
it "should not contain the informational version information" do
|
335
|
+
subject.scan(%Q|[assembly: AssemblyInformationalVersion("#{@tester.informational_version}")]|).should be_empty
|
336
|
+
end
|
328
337
|
end
|
329
338
|
|
330
339
|
describe AssemblyInfo, "when configuring the assembly info generator with a yaml file" do
|
data/spec/msbuild_spec.rb
CHANGED
@@ -1,287 +1,287 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/msbuild'
|
3
|
-
require 'albacore/config/msbuildconfig'
|
4
|
-
require 'msbuildtestdata'
|
5
|
-
|
6
|
-
shared_context "prepping msbuild" do
|
7
|
-
before :all do
|
8
|
-
@testdata = MSBuildTestData.new
|
9
|
-
@msbuild = @testdata.msbuild
|
10
|
-
@strio = StringIO.new
|
11
|
-
@msbuild.log_device = @strio
|
12
|
-
@msbuild.log_level = :diagnostic
|
13
|
-
@msbuild.properties :platform => 'Any CPU'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe MSBuild, "when building a solution with verbose logging turned on" do
|
18
|
-
include_context "prepping msbuild"
|
19
|
-
|
20
|
-
before :all do
|
21
|
-
@msbuild.solution = @testdata.solution_path
|
22
|
-
@strio = StringIO.new
|
23
|
-
@msbuild.log_device = @strio
|
24
|
-
@msbuild.log_level = :verbose
|
25
|
-
@msbuild.execute
|
26
|
-
|
27
|
-
@log_data = @strio.string
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should log the msbuild command line being called" do
|
31
|
-
com = @log_data.downcase().should include("Executing MSBuild: \"C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe\"".downcase())
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe MSBuild, "when building with no solution specified" do
|
36
|
-
include_context "prepping msbuild"
|
37
|
-
|
38
|
-
before :all do
|
39
|
-
@msbuild.extend(FailPatch)
|
40
|
-
@msbuild.execute
|
41
|
-
@log_data = @strio.string
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should log an error message saying the output file is required" do
|
45
|
-
@log_data.should include("solution cannot be nil")
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe MSBuild, "when an msbuild path is not specified" do
|
50
|
-
before :all do
|
51
|
-
@testdata = MSBuildTestData.new
|
52
|
-
@msbuild = @testdata.msbuild
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should default to the .net framework v4" do
|
56
|
-
@msbuild.command.downcase().should == @testdata.msbuild_path.downcase()
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe MSBuild, "when an msbuild path is specified" do
|
61
|
-
before :all do
|
62
|
-
@testdata = MSBuildTestData.new
|
63
|
-
@msbuild = @testdata.msbuild "Some Path"
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should use the specified path for the msbuild exe" do
|
67
|
-
@msbuild.command.should == "Some Path"
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
describe MSBuild, "when msbuild is configured to use a specific .net version" do
|
72
|
-
before :all do
|
73
|
-
Albacore.configure do |config|
|
74
|
-
config.msbuild.use :net35
|
75
|
-
end
|
76
|
-
@testdata = MSBuildTestData.new
|
77
|
-
@msbuild = @testdata.msbuild
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should use the configured version" do
|
81
|
-
win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
|
82
|
-
@msbuild.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
describe MSBuild, "when msbuild is configured to use a specific .net version, and overriding for a specific instance" do
|
87
|
-
before :all do
|
88
|
-
Albacore.configure do |config|
|
89
|
-
config.msbuild.use :net35
|
90
|
-
end
|
91
|
-
@testdata = MSBuildTestData.new
|
92
|
-
@msbuild = @testdata.msbuild
|
93
|
-
@msbuild.use :net40
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should use the override version" do
|
97
|
-
win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
|
98
|
-
@msbuild.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
describe MSBuild, "when building a visual studio solution" do
|
103
|
-
include_context "prepping msbuild"
|
104
|
-
|
105
|
-
before :all do
|
106
|
-
@msbuild.solution = @testdata.solution_path
|
107
|
-
@msbuild.execute
|
108
|
-
end
|
109
|
-
|
110
|
-
it "should output the solution's binaries" do
|
111
|
-
File.exist?(@testdata.output_path).should == true
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
describe MSBuild, "when building a visual studio solution with a single target" do
|
116
|
-
include_context "prepping msbuild"
|
117
|
-
|
118
|
-
before :all do
|
119
|
-
@msbuild.solution = @testdata.solution_path
|
120
|
-
@msbuild.targets :Rebuild
|
121
|
-
@msbuild.execute
|
122
|
-
end
|
123
|
-
|
124
|
-
it "should output the solution's binaries" do
|
125
|
-
File.exist?(@testdata.output_path).should == true
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
describe MSBuild, "when building a visual studio solution for a specified configuration" do
|
130
|
-
before :all do
|
131
|
-
@testdata= MSBuildTestData.new("Release")
|
132
|
-
@msbuild = @testdata.msbuild
|
133
|
-
|
134
|
-
@msbuild.properties :configuration => :Release, :platform => 'Any CPU'
|
135
|
-
@msbuild.solution = @testdata.solution_path
|
136
|
-
@msbuild.execute
|
137
|
-
end
|
138
|
-
|
139
|
-
it "should build with the specified configuration as a property" do
|
140
|
-
@msbuild.system_command.should include("/p:configuration=\"Release\"")
|
141
|
-
end
|
142
|
-
|
143
|
-
it "should output the solution's binaries according to the specified configuration" do
|
144
|
-
File.exist?(@testdata.output_path).should be_true
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
describe MSBuild, "when specifying targets to build" do
|
149
|
-
include_context "prepping msbuild"
|
150
|
-
|
151
|
-
before :all do
|
152
|
-
@msbuild.targets :Clean, :Build
|
153
|
-
@msbuild.solution = @testdata.solution_path
|
154
|
-
@msbuild.execute
|
155
|
-
end
|
156
|
-
|
157
|
-
it "should build the targets" do
|
158
|
-
@msbuild.system_command.should include("/target:Clean;Build")
|
159
|
-
end
|
160
|
-
|
161
|
-
end
|
162
|
-
|
163
|
-
describe MSBuild, "when building a solution with a specific msbuild verbosity" do
|
164
|
-
include_context "prepping msbuild"
|
165
|
-
|
166
|
-
before :all do
|
167
|
-
@msbuild.verbosity = "normal"
|
168
|
-
@msbuild.solution = @testdata.solution_path
|
169
|
-
@msbuild.execute
|
170
|
-
end
|
171
|
-
|
172
|
-
it "should call msbuild with the specified verbosity" do
|
173
|
-
@msbuild.system_command.should include("/verbosity:normal")
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
describe MSBuild, "when specifying multiple configuration properties" do
|
178
|
-
include_context "prepping msbuild"
|
179
|
-
|
180
|
-
before :all do
|
181
|
-
File.delete(@testdata.output_path) if File.exist?(@testdata.output_path)
|
182
|
-
|
183
|
-
@msbuild.targets :Clean, :Build
|
184
|
-
@msbuild.properties :configuration => :Debug, :DebugSymbols => true, :platform => 'Any CPU'
|
185
|
-
@msbuild.solution = @testdata.solution_path
|
186
|
-
@msbuild.execute
|
187
|
-
end
|
188
|
-
|
189
|
-
it "should specify the first property" do
|
190
|
-
@msbuild.system_command.should include("/p:configuration=\"Debug\"")
|
191
|
-
end
|
192
|
-
|
193
|
-
it "should specifiy the second property" do
|
194
|
-
@msbuild.system_command.should include("/p:DebugSymbols=\"true\"")
|
195
|
-
end
|
196
|
-
|
197
|
-
it "should output the solution's binaries" do
|
198
|
-
File.exist?(@testdata.output_path).should == true
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
describe MSBuild, "when specifying a loggermodule" do
|
203
|
-
include_context "prepping msbuild"
|
204
|
-
|
205
|
-
before :all do
|
206
|
-
@msbuild.solution = @testdata.solution_path
|
207
|
-
@msbuild.loggermodule = "FileLogger,Microsoft.Build.Engine;logfile=MyLog.log"
|
208
|
-
@msbuild.execute
|
209
|
-
|
210
|
-
@log_data = @strio.string
|
211
|
-
end
|
212
|
-
|
213
|
-
it "should log the msbuild logger being used" do
|
214
|
-
puts @msbuild.system_command
|
215
|
-
@msbuild.system_command.should include("/logger:FileLogger,Microsoft.Build.Engine;logfile=MyLog.log")
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
describe MSBuild, "when specifying nologo" do
|
220
|
-
include_context "prepping msbuild"
|
221
|
-
|
222
|
-
before :all do
|
223
|
-
@msbuild.nologo
|
224
|
-
@msbuild.solution = @testdata.solution_path
|
225
|
-
@msbuild.execute
|
226
|
-
end
|
227
|
-
|
228
|
-
it "should call msbuild with nologo option" do
|
229
|
-
@msbuild.system_command.should include("/nologo")
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
describe MSBuild, "when specifying max cpu count" do
|
234
|
-
include_context "prepping msbuild"
|
235
|
-
|
236
|
-
before :all do
|
237
|
-
@msbuild.max_cpu_count = 2
|
238
|
-
@msbuild.solution = @testdata.solution_path
|
239
|
-
@msbuild.execute
|
240
|
-
end
|
241
|
-
|
242
|
-
it "should call msbuild with maxcpucount option set" do
|
243
|
-
@msbuild.system_command.should include("/maxcpucount:2")
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
describe MSBuild, "when including a TrueClass switch" do
|
248
|
-
include_context "prepping msbuild"
|
249
|
-
|
250
|
-
before :all do
|
251
|
-
@msbuild.other_switches :noconsolelogger => true
|
252
|
-
@msbuild.solution = @testdata.solution_path
|
253
|
-
@msbuild.execute
|
254
|
-
end
|
255
|
-
|
256
|
-
it 'should call msbuild with the noconsolelogger switch' do
|
257
|
-
@msbuild.system_command.should include('/noconsolelogger')
|
258
|
-
end
|
259
|
-
end
|
260
|
-
|
261
|
-
describe MSBuild, "when including a true symbol switch" do
|
262
|
-
include_context "prepping msbuild"
|
263
|
-
|
264
|
-
before :all do
|
265
|
-
@msbuild.other_switches :noconsolelogger => :true
|
266
|
-
@msbuild.solution = @testdata.solution_path
|
267
|
-
@msbuild.execute
|
268
|
-
end
|
269
|
-
|
270
|
-
it 'should call msbuild with the noconsolelogger switch' do
|
271
|
-
@msbuild.system_command.should include('/noconsolelogger')
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
describe MSBuild, "when including a switch with value" do
|
276
|
-
include_context "prepping msbuild"
|
277
|
-
|
278
|
-
before :all do
|
279
|
-
@msbuild.other_switches :toolsVersion => 3.5
|
280
|
-
@msbuild.solution = @testdata.solution_path
|
281
|
-
@msbuild.execute
|
282
|
-
end
|
283
|
-
|
284
|
-
it 'should call msbuild with the noconsolelogger switch' do
|
285
|
-
@msbuild.system_command.should include("/toolsVersion:\"3.5\"")
|
286
|
-
end
|
287
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/msbuild'
|
3
|
+
require 'albacore/config/msbuildconfig'
|
4
|
+
require 'msbuildtestdata'
|
5
|
+
|
6
|
+
shared_context "prepping msbuild" do
|
7
|
+
before :all do
|
8
|
+
@testdata = MSBuildTestData.new
|
9
|
+
@msbuild = @testdata.msbuild
|
10
|
+
@strio = StringIO.new
|
11
|
+
@msbuild.log_device = @strio
|
12
|
+
@msbuild.log_level = :diagnostic
|
13
|
+
@msbuild.properties :platform => 'Any CPU'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe MSBuild, "when building a solution with verbose logging turned on" do
|
18
|
+
include_context "prepping msbuild"
|
19
|
+
|
20
|
+
before :all do
|
21
|
+
@msbuild.solution = @testdata.solution_path
|
22
|
+
@strio = StringIO.new
|
23
|
+
@msbuild.log_device = @strio
|
24
|
+
@msbuild.log_level = :verbose
|
25
|
+
@msbuild.execute
|
26
|
+
|
27
|
+
@log_data = @strio.string
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should log the msbuild command line being called" do
|
31
|
+
com = @log_data.downcase().should include("Executing MSBuild: \"C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe\"".downcase())
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe MSBuild, "when building with no solution specified" do
|
36
|
+
include_context "prepping msbuild"
|
37
|
+
|
38
|
+
before :all do
|
39
|
+
@msbuild.extend(FailPatch)
|
40
|
+
@msbuild.execute
|
41
|
+
@log_data = @strio.string
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should log an error message saying the output file is required" do
|
45
|
+
@log_data.should include("solution cannot be nil")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe MSBuild, "when an msbuild path is not specified" do
|
50
|
+
before :all do
|
51
|
+
@testdata = MSBuildTestData.new
|
52
|
+
@msbuild = @testdata.msbuild
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should default to the .net framework v4" do
|
56
|
+
@msbuild.command.downcase().should == @testdata.msbuild_path.downcase()
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe MSBuild, "when an msbuild path is specified" do
|
61
|
+
before :all do
|
62
|
+
@testdata = MSBuildTestData.new
|
63
|
+
@msbuild = @testdata.msbuild "Some Path"
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should use the specified path for the msbuild exe" do
|
67
|
+
@msbuild.command.should == "Some Path"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe MSBuild, "when msbuild is configured to use a specific .net version" do
|
72
|
+
before :all do
|
73
|
+
Albacore.configure do |config|
|
74
|
+
config.msbuild.use :net35
|
75
|
+
end
|
76
|
+
@testdata = MSBuildTestData.new
|
77
|
+
@msbuild = @testdata.msbuild
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should use the configured version" do
|
81
|
+
win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
|
82
|
+
@msbuild.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe MSBuild, "when msbuild is configured to use a specific .net version, and overriding for a specific instance" do
|
87
|
+
before :all do
|
88
|
+
Albacore.configure do |config|
|
89
|
+
config.msbuild.use :net35
|
90
|
+
end
|
91
|
+
@testdata = MSBuildTestData.new
|
92
|
+
@msbuild = @testdata.msbuild
|
93
|
+
@msbuild.use :net40
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should use the override version" do
|
97
|
+
win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
|
98
|
+
@msbuild.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe MSBuild, "when building a visual studio solution" do
|
103
|
+
include_context "prepping msbuild"
|
104
|
+
|
105
|
+
before :all do
|
106
|
+
@msbuild.solution = @testdata.solution_path
|
107
|
+
@msbuild.execute
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should output the solution's binaries" do
|
111
|
+
File.exist?(@testdata.output_path).should == true
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
describe MSBuild, "when building a visual studio solution with a single target" do
|
116
|
+
include_context "prepping msbuild"
|
117
|
+
|
118
|
+
before :all do
|
119
|
+
@msbuild.solution = @testdata.solution_path
|
120
|
+
@msbuild.targets :Rebuild
|
121
|
+
@msbuild.execute
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should output the solution's binaries" do
|
125
|
+
File.exist?(@testdata.output_path).should == true
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe MSBuild, "when building a visual studio solution for a specified configuration" do
|
130
|
+
before :all do
|
131
|
+
@testdata= MSBuildTestData.new("Release")
|
132
|
+
@msbuild = @testdata.msbuild
|
133
|
+
|
134
|
+
@msbuild.properties :configuration => :Release, :platform => 'Any CPU'
|
135
|
+
@msbuild.solution = @testdata.solution_path
|
136
|
+
@msbuild.execute
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should build with the specified configuration as a property" do
|
140
|
+
@msbuild.system_command.should include("/p:configuration=\"Release\"")
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should output the solution's binaries according to the specified configuration" do
|
144
|
+
File.exist?(@testdata.output_path).should be_true
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe MSBuild, "when specifying targets to build" do
|
149
|
+
include_context "prepping msbuild"
|
150
|
+
|
151
|
+
before :all do
|
152
|
+
@msbuild.targets :Clean, :Build
|
153
|
+
@msbuild.solution = @testdata.solution_path
|
154
|
+
@msbuild.execute
|
155
|
+
end
|
156
|
+
|
157
|
+
it "should build the targets" do
|
158
|
+
@msbuild.system_command.should include("/target:Clean;Build")
|
159
|
+
end
|
160
|
+
|
161
|
+
end
|
162
|
+
|
163
|
+
describe MSBuild, "when building a solution with a specific msbuild verbosity" do
|
164
|
+
include_context "prepping msbuild"
|
165
|
+
|
166
|
+
before :all do
|
167
|
+
@msbuild.verbosity = "normal"
|
168
|
+
@msbuild.solution = @testdata.solution_path
|
169
|
+
@msbuild.execute
|
170
|
+
end
|
171
|
+
|
172
|
+
it "should call msbuild with the specified verbosity" do
|
173
|
+
@msbuild.system_command.should include("/verbosity:normal")
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
describe MSBuild, "when specifying multiple configuration properties" do
|
178
|
+
include_context "prepping msbuild"
|
179
|
+
|
180
|
+
before :all do
|
181
|
+
File.delete(@testdata.output_path) if File.exist?(@testdata.output_path)
|
182
|
+
|
183
|
+
@msbuild.targets :Clean, :Build
|
184
|
+
@msbuild.properties :configuration => :Debug, :DebugSymbols => true, :platform => 'Any CPU'
|
185
|
+
@msbuild.solution = @testdata.solution_path
|
186
|
+
@msbuild.execute
|
187
|
+
end
|
188
|
+
|
189
|
+
it "should specify the first property" do
|
190
|
+
@msbuild.system_command.should include("/p:configuration=\"Debug\"")
|
191
|
+
end
|
192
|
+
|
193
|
+
it "should specifiy the second property" do
|
194
|
+
@msbuild.system_command.should include("/p:DebugSymbols=\"true\"")
|
195
|
+
end
|
196
|
+
|
197
|
+
it "should output the solution's binaries" do
|
198
|
+
File.exist?(@testdata.output_path).should == true
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
describe MSBuild, "when specifying a loggermodule" do
|
203
|
+
include_context "prepping msbuild"
|
204
|
+
|
205
|
+
before :all do
|
206
|
+
@msbuild.solution = @testdata.solution_path
|
207
|
+
@msbuild.loggermodule = "FileLogger,Microsoft.Build.Engine;logfile=MyLog.log"
|
208
|
+
@msbuild.execute
|
209
|
+
|
210
|
+
@log_data = @strio.string
|
211
|
+
end
|
212
|
+
|
213
|
+
it "should log the msbuild logger being used" do
|
214
|
+
puts @msbuild.system_command
|
215
|
+
@msbuild.system_command.should include("/logger:FileLogger,Microsoft.Build.Engine;logfile=MyLog.log")
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
describe MSBuild, "when specifying nologo" do
|
220
|
+
include_context "prepping msbuild"
|
221
|
+
|
222
|
+
before :all do
|
223
|
+
@msbuild.nologo
|
224
|
+
@msbuild.solution = @testdata.solution_path
|
225
|
+
@msbuild.execute
|
226
|
+
end
|
227
|
+
|
228
|
+
it "should call msbuild with nologo option" do
|
229
|
+
@msbuild.system_command.should include("/nologo")
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
describe MSBuild, "when specifying max cpu count" do
|
234
|
+
include_context "prepping msbuild"
|
235
|
+
|
236
|
+
before :all do
|
237
|
+
@msbuild.max_cpu_count = 2
|
238
|
+
@msbuild.solution = @testdata.solution_path
|
239
|
+
@msbuild.execute
|
240
|
+
end
|
241
|
+
|
242
|
+
it "should call msbuild with maxcpucount option set" do
|
243
|
+
@msbuild.system_command.should include("/maxcpucount:2")
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
describe MSBuild, "when including a TrueClass switch" do
|
248
|
+
include_context "prepping msbuild"
|
249
|
+
|
250
|
+
before :all do
|
251
|
+
@msbuild.other_switches :noconsolelogger => true
|
252
|
+
@msbuild.solution = @testdata.solution_path
|
253
|
+
@msbuild.execute
|
254
|
+
end
|
255
|
+
|
256
|
+
it 'should call msbuild with the noconsolelogger switch' do
|
257
|
+
@msbuild.system_command.should include('/noconsolelogger')
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
describe MSBuild, "when including a true symbol switch" do
|
262
|
+
include_context "prepping msbuild"
|
263
|
+
|
264
|
+
before :all do
|
265
|
+
@msbuild.other_switches :noconsolelogger => :true
|
266
|
+
@msbuild.solution = @testdata.solution_path
|
267
|
+
@msbuild.execute
|
268
|
+
end
|
269
|
+
|
270
|
+
it 'should call msbuild with the noconsolelogger switch' do
|
271
|
+
@msbuild.system_command.should include('/noconsolelogger')
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
describe MSBuild, "when including a switch with value" do
|
276
|
+
include_context "prepping msbuild"
|
277
|
+
|
278
|
+
before :all do
|
279
|
+
@msbuild.other_switches :toolsVersion => 3.5
|
280
|
+
@msbuild.solution = @testdata.solution_path
|
281
|
+
@msbuild.execute
|
282
|
+
end
|
283
|
+
|
284
|
+
it 'should call msbuild with the noconsolelogger switch' do
|
285
|
+
@msbuild.system_command.should include("/toolsVersion:\"3.5\"")
|
286
|
+
end
|
287
|
+
end
|