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
@@ -1,48 +1,45 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
class XUnitTestRunner
|
4
|
+
extend AttrMethods
|
4
5
|
include RunCommand
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def build_html_output
|
46
|
-
"/html #{@html_output}"
|
47
|
-
end
|
6
|
+
include YAMLConfig
|
7
|
+
|
8
|
+
attr_accessor :html_output, :assembly
|
9
|
+
attr_array :options
|
10
|
+
|
11
|
+
def initialize(path_to_command='')
|
12
|
+
@path_to_command = path_to_command
|
13
|
+
@options=[]
|
14
|
+
super()
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_command_line
|
18
|
+
command_params = []
|
19
|
+
command_params << @path_to_command
|
20
|
+
command_params << get_command_parameters
|
21
|
+
commandline = command_params.join(" ")
|
22
|
+
@logger.debug "Build XUnit Test Runner Command Line: " + commandline
|
23
|
+
commandline
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_command_parameters
|
27
|
+
command_params = []
|
28
|
+
command_params << assembly.inspect unless @assembly.nil?
|
29
|
+
command_params << @options.join(" ") unless @options.nil?
|
30
|
+
command_params << build_html_output unless @html_output.nil?
|
31
|
+
command_params
|
32
|
+
end
|
33
|
+
|
34
|
+
def execute()
|
35
|
+
command_params = get_command_parameters
|
36
|
+
result = run_command "XUnit", command_params.join(" ")
|
37
|
+
|
38
|
+
failure_message = 'XUnit Failed. See Build Log For Detail'
|
39
|
+
fail_with_message failure_message if !result
|
40
|
+
end
|
41
|
+
|
42
|
+
def build_html_output
|
43
|
+
"/html #{@html_output}"
|
44
|
+
end
|
48
45
|
end
|
@@ -4,73 +4,82 @@ require 'zip/zipfilesystem'
|
|
4
4
|
include Zip
|
5
5
|
|
6
6
|
class ZipDirectory
|
7
|
-
|
8
|
-
|
7
|
+
extend AttrMethods
|
8
|
+
include YAMLConfig
|
9
|
+
include Failure
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
attr_accessor :output_path, :output_file
|
12
|
+
attr_accessor :flatten_zip
|
13
|
+
attr_array :directories_to_zip, :additional_files, :exclusions
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
def initialize
|
16
|
+
@flatten_zip = true
|
17
|
+
@exclusions = []
|
18
|
+
super()
|
19
|
+
end
|
20
|
+
|
21
|
+
def package()
|
22
|
+
fail_with_message 'Output File cannot be empty' if @output_file.nil?
|
23
|
+
return if @output_file.nil?
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
+
clean_directories_names
|
26
|
+
remove zip_name
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def zip_name()
|
46
|
-
@output_path = set_output_path
|
47
|
-
File.join(@output_path, @output_file)
|
48
|
-
end
|
28
|
+
ZipFile.open(zip_name, 'w') do |zipfile|
|
29
|
+
zip_directory(zipfile)
|
30
|
+
zip_additional(zipfile)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def clean_directories_names
|
35
|
+
return if @directories_to_zip.nil?
|
36
|
+
@directories_to_zip.each { |d| d.sub!(%r[/$],'')}
|
37
|
+
end
|
38
|
+
|
39
|
+
def remove(filename)
|
40
|
+
FileUtils.rm filename, :force=>true
|
41
|
+
end
|
42
|
+
|
43
|
+
def reject_file(f)
|
44
|
+
f == zip_name || is_excluded(f)
|
45
|
+
end
|
49
46
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
47
|
+
def is_excluded(f)
|
48
|
+
@exclusions.any? do |e|
|
49
|
+
return true if e.respond_to? '~' and f =~ e
|
50
|
+
e == f
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def zip_name()
|
55
|
+
@output_path = set_output_path
|
56
|
+
File.join(@output_path, @output_file)
|
57
|
+
end
|
58
|
+
|
59
|
+
def set_output_path()
|
60
|
+
path = ''
|
61
|
+
path = @directories_to_zip.first unless @directories_to_zip.nil?
|
62
|
+
path = @output_path unless @output_path.nil?
|
63
|
+
return path
|
64
|
+
end
|
56
65
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
66
|
+
|
67
|
+
def zip_directory(zipfile)
|
68
|
+
return if @directories_to_zip.nil?
|
69
|
+
@directories_to_zip.each do |d|
|
70
|
+
Dir["#{d}/**/**"].reject{|f| reject_file(f)}.each do |file_path|
|
71
|
+
file_name = file_path
|
72
|
+
file_name = file_path.sub(d + '/','') if @flatten_zip
|
73
|
+
zipfile.add(file_name, file_path)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def zip_additional(zipfile)
|
79
|
+
return if @additional_files.nil?
|
80
|
+
@additional_files.reject{|f| reject_file(f)}.each do |file_path|
|
81
|
+
file_name = file_path.split('/').last if @flatten_zip
|
82
|
+
zipfile.add(file_name, file_path)
|
83
|
+
end
|
84
|
+
end
|
76
85
|
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def assemblyinfo(name=:assemblyinfo, *args, &block)
|
4
|
+
Albacore::AssemblyInfoTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
class AssemblyInfoTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@asm = AssemblyInfo.new
|
11
|
+
@asm.load_config_by_task_name(self.class.to_s.downcase)
|
12
|
+
@block.call(@asm, *task_args) unless @block.nil?
|
13
|
+
@asm.write
|
14
|
+
fail if @asm.failed
|
15
|
+
end
|
16
|
+
end
|
16
17
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rake/tasklib'
|
2
|
+
|
3
|
+
def docu(name=:docu, *args, &block)
|
4
|
+
Albacore::DocuTask.new(name, *args, &block)
|
5
|
+
end
|
6
|
+
|
7
|
+
module Albacore
|
8
|
+
class DocuTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@docu = Docu.new
|
11
|
+
@docu.load_config_by_task_name(name)
|
12
|
+
@block.call(@docu, *task_args) unless @block.nil?
|
13
|
+
@docu.execute
|
14
|
+
fail if @docu.failed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rake/tasklib'
|
2
|
+
|
3
|
+
def exec(name=:exec, *args, &block)
|
4
|
+
Albacore::ExecTask.new(name, *args, &block)
|
5
|
+
end
|
6
|
+
|
7
|
+
module Albacore
|
8
|
+
class ExecTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@exec = Exec.new
|
11
|
+
@exec.load_config_by_task_name(name)
|
12
|
+
@block.call(@exec, *task_args) unless @block.nil?
|
13
|
+
@exec.execute
|
14
|
+
fail if @exec.failed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def expandtemplates(name=:expandtemplates, *args, &block)
|
4
|
+
Albacore::ExpandTemplatesTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
7
|
-
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
|
7
|
+
module Albacore
|
8
|
+
class ExpandTemplatesTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@exp = ExpandTemplates.new
|
11
|
+
@exp.load_config_by_task_name(name)
|
12
|
+
@block.call(@exp, *task_args) unless @block.nil?
|
13
|
+
@exp.expand
|
14
|
+
end
|
15
|
+
end
|
15
16
|
end
|
data/lib/rake/msbuildtask.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def msbuild(name=:msbuild, *args, &block)
|
4
|
+
Albacore::MSBuildTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
class MSBuildTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@msbuild = MSBuild.new
|
11
|
+
@msbuild.load_config_by_task_name(name)
|
12
|
+
@block.call(@msbuild, *task_args) unless @block.nil?
|
13
|
+
@msbuild.build
|
14
|
+
fail if @msbuild.failed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
17
18
|
end
|
data/lib/rake/mspectask.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def mspec(name=:mspec, *args, &block)
|
4
|
+
Albacore::MSpecTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
class MSpecTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@mspec = MSpecTestRunner.new
|
11
|
+
@mspec.load_config_by_task_name(name)
|
12
|
+
@block.call(@mspec, *task_args) unless @block.nil?
|
13
|
+
@mspec.execute
|
14
|
+
fail if @mspec.failed
|
15
|
+
end
|
16
|
+
end
|
16
17
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rake/tasklib'
|
2
|
+
|
3
|
+
def nant(name=:nant, *args, &block)
|
4
|
+
Albacore::NAntTask.new(name, *args, &block)
|
5
|
+
end
|
6
|
+
|
7
|
+
module Albacore
|
8
|
+
class NAntTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
nant = NAnt.new
|
11
|
+
nant.load_config_by_task_name(name)
|
12
|
+
@block.call(nant, *task_args) unless @block.nil?
|
13
|
+
nant.run
|
14
|
+
fail if nant.failed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def ncoverconsole(name=:ncoverconsole, *args, &block)
|
4
|
+
Albacore::NCoverConsoleTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
class NCoverConsoleTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@ncover = NCoverConsole.new
|
11
|
+
@ncover.load_config_by_task_name(name)
|
12
|
+
@block.call(@ncover, *task_args) unless @block.nil?
|
13
|
+
@ncover.run
|
14
|
+
fail if @ncover.failed
|
15
|
+
end
|
16
|
+
end
|
16
17
|
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'rake/tasklib'
|
2
2
|
|
3
|
-
def
|
4
|
-
|
3
|
+
def ncoverreport(name=:ncoverreport, *args, &block)
|
4
|
+
Albacore::NCoverReportTask.new(name, *args, &block)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module Albacore
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
class NCoverReportTask < Albacore::AlbacoreTask
|
9
|
+
def execute(name, task_args)
|
10
|
+
@ncoverreport = NCoverReport.new
|
11
|
+
@ncoverreport.load_config_by_task_name(name)
|
12
|
+
@block.call(@ncoverreport, *task_args) unless @block.nil?
|
13
|
+
@ncoverreport.run
|
14
|
+
fail if @ncoverreport.failed
|
15
|
+
end
|
16
|
+
end
|
16
17
|
end
|