albacore 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +84 -81
- data/VERSION +1 -1
- data/install_dependencies.rb +10 -10
- data/lib/albacore.rb +10 -2
- data/lib/albacore/assemblyinfo.rb +100 -100
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
- data/lib/albacore/docu.rb +39 -0
- data/lib/albacore/exec.rb +23 -0
- data/lib/albacore/expandtemplates.rb +73 -71
- data/lib/albacore/msbuild.rb +56 -61
- data/lib/albacore/mspectestrunner.rb +44 -42
- data/lib/albacore/nant.rb +39 -0
- data/lib/albacore/ncoverconsole.rb +68 -61
- data/lib/albacore/ncoverreport.rb +56 -55
- data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
- data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/classfilter.rb +5 -5
- data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
- data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
- data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
- data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
- data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
- data/lib/albacore/ndepend.rb +35 -0
- data/lib/albacore/nunittestrunner.rb +36 -35
- data/lib/albacore/plink.rb +48 -0
- data/lib/albacore/sftp.rb +33 -31
- data/lib/albacore/sqlcmd.rb +54 -51
- data/lib/albacore/ssh.rb +35 -33
- data/lib/albacore/support/albacore_helper.rb +1 -4
- data/lib/albacore/support/attrmethods.rb +25 -0
- data/lib/albacore/support/failure.rb +17 -17
- data/lib/albacore/support/globalconfig.rb +6 -0
- data/lib/albacore/support/logging.rb +30 -28
- data/lib/albacore/support/runcommand.rb +41 -41
- data/lib/albacore/support/yamlconfig.rb +23 -27
- data/lib/albacore/unzip.rb +28 -0
- data/lib/albacore/xbuild.rb +54 -0
- data/lib/albacore/xunittestrunner.rb +40 -43
- data/lib/albacore/zipdirectory.rb +72 -63
- data/lib/rake/assemblyinfotask.rb +12 -11
- data/lib/rake/docutask.rb +17 -0
- data/lib/rake/exectask.rb +18 -0
- data/lib/rake/expandtemplatestask.rb +12 -11
- data/lib/rake/msbuildtask.rb +13 -12
- data/lib/rake/mspectask.rb +12 -11
- data/lib/rake/nanttask.rb +17 -0
- data/lib/rake/ncoverconsoletask.rb +12 -11
- data/lib/rake/ncoverreporttask.rb +12 -11
- data/lib/rake/ndependtask.rb +23 -0
- data/lib/rake/nunittask.rb +12 -11
- data/lib/rake/plinktask.rb +23 -0
- data/lib/rake/renametask.rb +15 -15
- data/lib/rake/sftptask.rb +11 -10
- data/lib/rake/sqlcmdtask.rb +13 -12
- data/lib/rake/sshtask.rb +11 -10
- data/lib/rake/support/albacoretask.rb +16 -15
- data/lib/rake/unziptask.rb +17 -0
- data/lib/rake/xbuildtask.rb +22 -0
- data/lib/rake/xunittask.rb +12 -11
- data/lib/rake/ziptask.rb +12 -11
- data/rakefile.rb +255 -204
- data/spec/assemblyinfo_spec.rb +426 -221
- data/spec/assemblyinfotask_spec.rb +21 -21
- data/spec/docu_spec.rb +70 -0
- data/spec/docutask_spec.rb +39 -0
- data/spec/exec_spec.rb +23 -0
- data/spec/exectask_spec.rb +31 -0
- data/spec/expandtemplates_spec.rb +149 -148
- data/spec/expandtemplatestask_spec.rb +21 -21
- data/spec/msbuild_spec.rb +150 -139
- data/spec/msbuildtask_spec.rb +21 -21
- data/spec/mspectask_spec.rb +21 -21
- data/spec/nant_spec.rb +101 -0
- data/spec/nanttask_spec.rb +31 -0
- data/spec/ncoverconsole_spec.rb +253 -221
- data/spec/ncoverconsoletask_spec.rb +21 -21
- data/spec/ncoverreport_spec.rb +538 -523
- data/spec/ncoverreporttask_spec.rb +21 -21
- data/spec/ndepend_spec.rb +49 -0
- data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
- data/spec/nunittask_spec.rb +21 -21
- data/spec/nunittestrunner_spec.rb +6 -6
- data/spec/patches/docu_patch.rb +13 -0
- data/spec/patches/system_patch.rb +18 -18
- data/spec/patches/tasklib_patch.rb +10 -10
- data/spec/plink_spec.rb +61 -0
- data/spec/plinktask_spec.rb +31 -0
- data/spec/renametask_spec.rb +21 -21
- data/spec/sftp_spec.rb +24 -24
- data/spec/sftptask_spec.rb +31 -31
- data/spec/sqlcmd_spec.rb +118 -120
- data/spec/sqlcmdtask_spec.rb +21 -21
- data/spec/ssh_spec.rb +36 -37
- data/spec/sshtask_spec.rb +29 -29
- data/spec/support/TestSolution/NDependProject.xml +315 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
- data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
- data/spec/support/TestSolution/TestSolution.build +25 -0
- data/spec/support/assemblyinfotester.rb +40 -38
- data/spec/support/expandtemplatestestdata.rb +73 -73
- data/spec/support/msbuildtestdata.rb +28 -28
- data/spec/support/nanttestdata.rb +33 -0
- data/spec/support/ncoverconsoletestdata.rb +18 -0
- data/spec/support/ncoverreporttestdata.rb +24 -24
- data/spec/support/spec_helper.rb +2 -1
- data/spec/support/yamlconfig/msbuild.yml +3 -0
- data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
- data/spec/support/ziptestdata.rb +11 -6
- data/spec/xunit_spec.rb +63 -0
- data/spec/xunittask_spec.rb +19 -19
- data/spec/yamlconfig_spec.rb +38 -52
- data/spec/zip_spec.rb +56 -11
- data/spec/ziptask_spec.rb +22 -22
- metadata +53 -8
- data/lib/albacore/command.rb +0 -23
- data/lib/rake/commandtask.rb +0 -16
- data/spec/command_spec.rb +0 -23
@@ -4,28 +4,28 @@ require 'rake/expandtemplatestask'
|
|
4
4
|
require 'tasklib_patch'
|
5
5
|
|
6
6
|
describe Albacore::ExpandTemplatesTask, "when running" do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
before :each do
|
8
|
+
task = Albacore::ExpandTemplatesTask.new(:expandtemplates) do |t|
|
9
|
+
@yielded_object = t
|
10
|
+
end
|
11
|
+
task.extend(TasklibPatch)
|
12
|
+
Rake::Task[:expandtemplates].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should yield the expand template api" do
|
16
|
+
@yielded_object.kind_of?(ExpandTemplates).should == true
|
17
|
+
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe Albacore::ExpandTemplatesTask, "when execution fails" do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
before :each do
|
22
|
+
@task = Albacore::ExpandTemplatesTask.new(:failingtask)
|
23
|
+
@task.extend(TasklibPatch)
|
24
|
+
@task.fail
|
25
|
+
Rake::Task["failingtask"].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail the rake task" do
|
29
|
+
@task.task_failed.should be_true
|
30
|
+
end
|
31
31
|
end
|
data/spec/msbuild_spec.rb
CHANGED
@@ -2,172 +2,183 @@ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
|
2
2
|
require 'albacore/msbuild'
|
3
3
|
require 'msbuildtestdata'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
5
|
+
shared_examples_for "prepping msbuild" do
|
6
|
+
before :all do
|
7
|
+
@testdata = MSBuildTestData.new
|
8
|
+
@msbuild = @testdata.msbuild
|
9
|
+
@strio = StringIO.new
|
10
|
+
@msbuild.log_device = @strio
|
11
|
+
@msbuild.log_level = :verbose
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe MSBuild, "when building a solution with verbose logging turned on" do
|
16
|
+
it_should_behave_like "prepping msbuild"
|
17
|
+
|
18
|
+
before :all do
|
19
|
+
@msbuild.solution = @testdata.solution_path
|
20
|
+
@msbuild.build
|
21
|
+
|
22
|
+
@log_data = @strio.string
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should log the msbuild command line being called" do
|
26
|
+
@log_data.should include("Executing MSBuild: \"C:\\Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe\"")
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
30
|
describe MSBuild, "when building with no solution specified" do
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
it "should log an error message saying the output file is required" do
|
38
|
-
@log_data.should include("solution cannot be nil")
|
39
|
-
end
|
31
|
+
it_should_behave_like "prepping msbuild"
|
32
|
+
|
33
|
+
before :all do
|
34
|
+
@msbuild.build
|
35
|
+
|
36
|
+
@log_data = @strio.string
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should log an error message saying the output file is required" do
|
40
|
+
@log_data.should include("solution cannot be nil")
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
44
|
describe MSBuild, "when an msbuild path is not specified" do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
before :all do
|
46
|
+
@testdata = MSBuildTestData.new
|
47
|
+
@msbuild = @testdata.msbuild
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should default to the .net framework v3.5" do
|
51
|
+
@msbuild.path_to_command.should == @testdata.msbuild_path
|
52
|
+
end
|
51
53
|
end
|
52
54
|
|
53
55
|
describe MSBuild, "when an msbuild path is specified" do
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
before :all do
|
57
|
+
@testdata = MSBuildTestData.new
|
58
|
+
@msbuild = @testdata.msbuild "Some Path"
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should use the specified path for the msbuild exe" do
|
62
|
+
@msbuild.path_to_command.should == "Some Path"
|
63
|
+
end
|
62
64
|
end
|
63
65
|
|
64
66
|
describe MSBuild, "when an invalid msbuild path is specified" do
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
67
|
+
before :all do
|
68
|
+
@testdata = MSBuildTestData.new
|
69
|
+
msbuild = @testdata.msbuild "/an invalid path/does not exist.exe"
|
70
|
+
@strio = StringIO.new
|
71
|
+
msbuild.log_device = @strio
|
72
|
+
msbuild.log_level = :verbose
|
73
|
+
msbuild.solution = @testdata.solution_path
|
74
|
+
|
75
|
+
msbuild.build
|
76
|
+
|
77
|
+
@log_data = @strio.string
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should log an error message saying the command was not found" do
|
81
|
+
@log_data.should include("Command not found: #{@testdata.msbuild_path}")
|
82
|
+
end
|
81
83
|
end
|
82
84
|
|
83
85
|
describe MSBuild, "when building a visual studio solution" do
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
86
|
+
it_should_behave_like "prepping msbuild"
|
87
|
+
|
88
|
+
before :all do
|
89
|
+
@msbuild.solution = @testdata.solution_path
|
90
|
+
@msbuild.build
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should output the solution's binaries" do
|
94
|
+
File.exist?(@testdata.output_path).should == true
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe MSBuild, "when building a visual studio solution with a single target" do
|
99
|
+
it_should_behave_like "prepping msbuild"
|
100
|
+
|
101
|
+
before :all do
|
102
|
+
@msbuild.solution = @testdata.solution_path
|
103
|
+
@msbuild.targets :Rebuild
|
104
|
+
@msbuild.build
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should output the solution's binaries" do
|
108
|
+
File.exist?(@testdata.output_path).should == true
|
109
|
+
end
|
95
110
|
end
|
96
111
|
|
97
112
|
describe MSBuild, "when building a visual studio solution for a specified configuration" do
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
113
|
+
before :all do
|
114
|
+
@testdata= MSBuildTestData.new("Release")
|
115
|
+
@msbuild = @testdata.msbuild
|
116
|
+
|
117
|
+
@msbuild.properties :configuration => :Release
|
118
|
+
@msbuild.solution = @testdata.solution_path
|
119
|
+
@msbuild.build
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should build with the specified configuration as a property" do
|
123
|
+
@msbuild.system_command.should include("/p:configuration=\"Release\"")
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should output the solution's binaries according to the specified configuration" do
|
127
|
+
File.exist?(@testdata.output_path).should be_true
|
128
|
+
end
|
114
129
|
end
|
115
130
|
|
116
|
-
describe MSBuild, "when specifying targets to build" do
|
117
|
-
|
131
|
+
describe MSBuild, "when specifying targets to build" do
|
132
|
+
it_should_behave_like "prepping msbuild"
|
118
133
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
@msbuild.build
|
125
|
-
end
|
134
|
+
before :all do
|
135
|
+
@msbuild.targets :Clean, :Build
|
136
|
+
@msbuild.solution = @testdata.solution_path
|
137
|
+
@msbuild.build
|
138
|
+
end
|
126
139
|
|
127
|
-
|
128
|
-
|
129
|
-
|
140
|
+
it "should build the targets" do
|
141
|
+
@msbuild.system_command.should include("/target:Clean;Build")
|
142
|
+
end
|
130
143
|
|
131
144
|
end
|
132
145
|
|
133
146
|
describe MSBuild, "when building a solution with a specific msbuild verbosity" do
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
end
|
147
|
+
it_should_behave_like "prepping msbuild"
|
148
|
+
|
149
|
+
before :all do
|
150
|
+
@msbuild.verbosity = "normal"
|
151
|
+
@msbuild.solution = @testdata.solution_path
|
152
|
+
@msbuild.build
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should call msbuild with the specified verbosity" do
|
156
|
+
@msbuild.system_command.should include("/verbosity:normal")
|
157
|
+
end
|
146
158
|
end
|
147
159
|
|
148
|
-
describe MSBuild, "when specifying multiple configuration properties" do
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
end
|
160
|
+
describe MSBuild, "when specifying multiple configuration properties" do
|
161
|
+
it_should_behave_like "prepping msbuild"
|
162
|
+
|
163
|
+
before :all do
|
164
|
+
File.delete(@testdata.output_path) if File.exist?(@testdata.output_path)
|
165
|
+
|
166
|
+
@msbuild.targets :Clean, :Build
|
167
|
+
@msbuild.properties :configuration => :Debug, :DebugSymbols => true
|
168
|
+
@msbuild.solution = @testdata.solution_path
|
169
|
+
@msbuild.build
|
170
|
+
end
|
171
|
+
|
172
|
+
it "should specify the first property" do
|
173
|
+
@msbuild.system_command.should include("/p:configuration=\"Debug\"")
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should specifiy the second property" do
|
177
|
+
@msbuild.system_command.should include("/p:DebugSymbols=\"true\"")
|
178
|
+
end
|
179
|
+
|
180
|
+
it "should output the solution's binaries" do
|
181
|
+
File.exist?(@testdata.output_path).should == true
|
182
|
+
end
|
172
183
|
|
173
184
|
end
|
data/spec/msbuildtask_spec.rb
CHANGED
@@ -4,28 +4,28 @@ require 'rake/msbuildtask'
|
|
4
4
|
require 'tasklib_patch'
|
5
5
|
|
6
6
|
describe Albacore::MSBuildTask, "when running" do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
before :all do
|
8
|
+
task = Albacore::MSBuildTask.new(:msbuild) do |t|
|
9
|
+
@yielded_object = t
|
10
|
+
end
|
11
|
+
task.extend(TasklibPatch)
|
12
|
+
Rake::Task[:msbuild].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should yield the msbuild api" do
|
16
|
+
@yielded_object.kind_of?(MSBuild).should == true
|
17
|
+
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe Albacore::MSBuildTask, "when execution fails" do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
before :all do
|
22
|
+
@task = Albacore::MSBuildTask.new(:failingtask)
|
23
|
+
@task.extend(TasklibPatch)
|
24
|
+
@task.fail
|
25
|
+
Rake::Task["failingtask"].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail the rake task" do
|
29
|
+
@task.task_failed.should == true
|
30
|
+
end
|
31
31
|
end
|
data/spec/mspectask_spec.rb
CHANGED
@@ -4,28 +4,28 @@ require 'rake/mspectask'
|
|
4
4
|
require 'tasklib_patch'
|
5
5
|
|
6
6
|
describe Albacore::MSpecTask, "when running" do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
before :all do
|
8
|
+
task = Albacore::MSpecTask.new(:mspec) do |t|
|
9
|
+
@yielded_object = t
|
10
|
+
end
|
11
|
+
task.extend(TasklibPatch)
|
12
|
+
Rake::Task[:mspec].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should yield the mspec api" do
|
16
|
+
@yielded_object.kind_of?(MSpecTestRunner).should be_true
|
17
|
+
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe Albacore::MSpecTask, "when execution fails" do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
before :all do
|
22
|
+
@task = Albacore::MSpecTask.new(:failingtask)
|
23
|
+
@task.extend(TasklibPatch)
|
24
|
+
@task.fail
|
25
|
+
Rake::Task["failingtask"].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail the rake task" do
|
29
|
+
@task.task_failed.should == true
|
30
|
+
end
|
31
31
|
end
|