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,10 +1,10 @@
|
|
1
1
|
require 'albacore/ncoverreports/codecoveragebase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
4
|
+
class MethodCoverage < NCover::CodeCoverageBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("MethodCoverage", params)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'albacore/ncoverreports/reportfilterbase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class MethodFilter < NCover::ReportFilterBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("Method", params)
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'albacore/ncoverreports/reportfilterbase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class NamespaceFilter < NCover::ReportFilterBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("Namespace", params)
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,26 +1,26 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
4
|
+
class ReportFilterBase
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :filter, :filter_type, :item_type, :is_regex
|
8
|
+
|
9
|
+
def initialize(item_type, params={})
|
10
|
+
@filter = ""
|
11
|
+
@item_type = item_type
|
12
|
+
@is_regex = false
|
13
|
+
@filter_type = :exclude
|
14
|
+
parse_config(params) unless params.nil?
|
15
|
+
super()
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_filter_options
|
19
|
+
filter = "\"#{@filter}\""
|
20
|
+
filter << ":#{@item_type}"
|
21
|
+
filter << ":#{@is_regex}"
|
22
|
+
filter << ":#{(@filter_type == :include)}"
|
23
|
+
filter
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
4
|
+
class SummaryReport
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :output_path
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@report_format = :Xml
|
11
|
+
super()
|
12
|
+
end
|
13
|
+
|
14
|
+
def report_type
|
15
|
+
:Summary
|
16
|
+
end
|
17
|
+
|
18
|
+
def report_format
|
19
|
+
:Html
|
20
|
+
end
|
21
|
+
end
|
22
22
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'albacore/ncoverreports/codecoveragebase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
4
|
+
class SymbolCoverage < NCover::CodeCoverageBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("SymbolCoverage", params)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "albacore/support/albacore_helper"
|
2
|
+
class NDepend
|
3
|
+
include RunCommand
|
4
|
+
include Logging
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :path_to_command, :project_file , :parameters
|
8
|
+
def initialize()
|
9
|
+
super()
|
10
|
+
@parameters =[]
|
11
|
+
@require_valid_command = true
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
check_comand
|
16
|
+
return if @failed
|
17
|
+
result = run_command @path_to_command, create_parameters
|
18
|
+
failure_message = 'Command Failed. See Build Log For Detail'
|
19
|
+
fail_with_message failure_message if !result
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_parameters
|
23
|
+
params = []
|
24
|
+
params << File.expand_path( @project_file)
|
25
|
+
params << @parameters.join(" ")
|
26
|
+
@logger.debug "NDependConsole Parameters" + @parameters.join(" ")
|
27
|
+
return params
|
28
|
+
end
|
29
|
+
|
30
|
+
def check_comand
|
31
|
+
return if @project_file
|
32
|
+
fail_with_message 'A ndepend project file is required'
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -1,39 +1,40 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
class NUnitTestRunner
|
4
|
-
|
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
|
-
|
4
|
+
extend AttrMethods
|
5
|
+
include RunCommand
|
6
|
+
include YAMLConfig
|
7
|
+
|
8
|
+
attr_array :assemblies, :options
|
9
|
+
|
10
|
+
def initialize(path_to_command='')
|
11
|
+
@path_to_command = path_to_command
|
12
|
+
@options=[]
|
13
|
+
@assemblies=[]
|
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 NUnit Test Runner Command Line: " + commandline
|
23
|
+
commandline
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_command_parameters
|
27
|
+
command_params = []
|
28
|
+
command_params << @assemblies.join(" ") unless @assemblies.nil?
|
29
|
+
command_params << @options.join(" ") unless @options.nil?
|
30
|
+
command_params
|
31
|
+
end
|
32
|
+
|
33
|
+
def execute()
|
34
|
+
command_params = get_command_parameters
|
35
|
+
result = run_command "NUnit", command_params.join(" ")
|
36
|
+
|
37
|
+
failure_message = 'NUnit Failed. See Build Log For Detail'
|
38
|
+
fail_with_message failure_message if !result
|
39
|
+
end
|
39
40
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'albacore/support/albacore_helper'
|
2
|
+
|
3
|
+
class PLink
|
4
|
+
extend AttrMethods
|
5
|
+
include RunCommand
|
6
|
+
include YAMLConfig
|
7
|
+
include Logging
|
8
|
+
|
9
|
+
attr_accessor :host, :port, :user, :key, :verbose
|
10
|
+
attr_array :commands
|
11
|
+
|
12
|
+
def initialize()
|
13
|
+
@require_valid_command = false
|
14
|
+
@port = 22
|
15
|
+
@verbose = false
|
16
|
+
@commands = []
|
17
|
+
super()
|
18
|
+
end
|
19
|
+
|
20
|
+
def run()
|
21
|
+
check_command
|
22
|
+
return if @failed
|
23
|
+
parameters = create_parameters
|
24
|
+
result = run_command "Plink", parameters.join(" ")
|
25
|
+
failure_message = 'Command Failed. See Build Log For Detail'
|
26
|
+
fail_with_message failure_message if !result
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_parameters
|
30
|
+
parameters = []
|
31
|
+
parameters << "#{@user}@#{@host} -P #{@port} "
|
32
|
+
parameters << build_parameter("i", @key) unless @key.nil?
|
33
|
+
parameters << "-batch"
|
34
|
+
parameters << "-v" if @verbose
|
35
|
+
parameters << @commands
|
36
|
+
@logger.debug "PLink Parameters" + parameters.join(" ")
|
37
|
+
return parameters
|
38
|
+
end
|
39
|
+
|
40
|
+
def build_parameter(param_name, param_value)
|
41
|
+
"-#{param_name} #{param_value}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def check_command
|
45
|
+
return if @path_to_command
|
46
|
+
fail_with_message 'Plink.path_to_command cannot be nil.'
|
47
|
+
end
|
48
|
+
end
|
data/lib/albacore/sftp.rb
CHANGED
@@ -2,39 +2,41 @@ require 'albacore/support/albacore_helper'
|
|
2
2
|
require 'net/sftp'
|
3
3
|
|
4
4
|
class Sftp
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
attr_accessor :server, :username, :password, :upload_files, :port, :key, :debug
|
5
|
+
extend AttrMethods
|
6
|
+
include YAMLConfig
|
7
|
+
include Logging
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
super()
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_connection_options
|
16
|
-
options = {}
|
17
|
-
options[:verbose] = :debug if @debug == true
|
18
|
-
options[:password] = @password if @password
|
19
|
-
options[:port] = @port if @port
|
20
|
-
options[:keys] = [@key] if @key
|
21
|
-
options
|
22
|
-
end
|
9
|
+
attr_accessor :server, :username, :password, :port, :key, :debug
|
10
|
+
attr_hash :upload_files
|
23
11
|
|
24
|
-
|
25
|
-
|
12
|
+
def initialize
|
13
|
+
@upload_files = {}
|
14
|
+
super()
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_connection_options
|
18
|
+
options = {}
|
19
|
+
options[:verbose] = :debug if @debug == true
|
20
|
+
options[:password] = @password if @password
|
21
|
+
options[:port] = @port if @port
|
22
|
+
options[:keys] = [@key] if @key
|
23
|
+
options
|
24
|
+
end
|
25
|
+
|
26
|
+
def upload()
|
27
|
+
warn_about_key if @key
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
Net::SFTP.start(@server, @username, get_connection_options) do |sftp|
|
30
|
+
@logger.debug "Starting File Upload"
|
31
|
+
@upload_files.each {|local_file, remote_file|
|
32
|
+
@logger.debug "Uploading #{local_file} to #{remote_file}"
|
33
|
+
sftp.upload!(local_file, remote_file)
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
def warn_about_key()
|
39
|
+
info.debug 'When using a key, you need an SSH-Agent running to manage the keys.'
|
40
|
+
info.debug 'On Windows, a recommended agent is called Pageant, downloadable from the Putty site.'
|
41
|
+
end
|
40
42
|
end
|
data/lib/albacore/sqlcmd.rb
CHANGED
@@ -1,55 +1,58 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
class SQLCmd
|
4
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
4
|
+
extend AttrMethods
|
5
|
+
include RunCommand
|
6
|
+
include YAMLConfig
|
7
|
+
|
8
|
+
attr_accessor :server, :database, :username, :password
|
9
|
+
attr_array :scripts
|
10
|
+
attr_hash :variables
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@require_valid_command = false
|
14
|
+
@scripts=[]
|
15
|
+
@variables={}
|
16
|
+
super()
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
check_command
|
21
|
+
return if @failed
|
22
|
+
|
23
|
+
cmd_params=[]
|
24
|
+
cmd_params << build_parameter("S", @server) unless @server.nil?
|
25
|
+
cmd_params << build_parameter("d", @database) unless @database.nil?
|
26
|
+
cmd_params << build_parameter("U", @username) unless @username.nil?
|
27
|
+
cmd_params << build_parameter("P", @password) unless @password.nil?
|
28
|
+
cmd_params << build_variable_list if @variables.length > 0
|
29
|
+
cmd_params << build_script_list if @scripts.length > 0
|
30
|
+
|
31
|
+
result = run_command "SQLCmd", cmd_params.join(" ")
|
32
|
+
|
33
|
+
failure_msg = 'SQLCmd Failed. See Build Log For Detail.'
|
34
|
+
fail_with_message failure_msg if !result
|
35
|
+
end
|
36
|
+
|
37
|
+
def check_command
|
38
|
+
return if @path_to_command
|
39
|
+
fail_with_message 'SQLCmd.path_to_command cannot be nil.'
|
40
|
+
end
|
41
|
+
|
42
|
+
def build_script_list
|
43
|
+
@scripts.map{|s| "-i \"#{s}\""}.join(" ")
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_parameter(param_name, param_value)
|
47
|
+
"-#{param_name} \"#{param_value}\""
|
48
|
+
end
|
49
|
+
|
50
|
+
def build_variable_list
|
51
|
+
vars = []
|
52
|
+
@variables.each do |k,v|
|
53
|
+
vars << "-v #{k}=#{v}"
|
54
|
+
end
|
55
|
+
vars.join(" ")
|
56
|
+
end
|
57
|
+
|
55
58
|
end
|