albacore 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/README.markdown +84 -81
  2. data/VERSION +1 -1
  3. data/install_dependencies.rb +10 -10
  4. data/lib/albacore.rb +10 -2
  5. data/lib/albacore/assemblyinfo.rb +100 -100
  6. data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
  7. data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
  8. data/lib/albacore/docu.rb +39 -0
  9. data/lib/albacore/exec.rb +23 -0
  10. data/lib/albacore/expandtemplates.rb +73 -71
  11. data/lib/albacore/msbuild.rb +56 -61
  12. data/lib/albacore/mspectestrunner.rb +44 -42
  13. data/lib/albacore/nant.rb +39 -0
  14. data/lib/albacore/ncoverconsole.rb +68 -61
  15. data/lib/albacore/ncoverreport.rb +56 -55
  16. data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
  17. data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
  18. data/lib/albacore/ncoverreports/classfilter.rb +5 -5
  19. data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
  20. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
  21. data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
  22. data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
  23. data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
  24. data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
  25. data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
  26. data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
  27. data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
  28. data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
  29. data/lib/albacore/ndepend.rb +35 -0
  30. data/lib/albacore/nunittestrunner.rb +36 -35
  31. data/lib/albacore/plink.rb +48 -0
  32. data/lib/albacore/sftp.rb +33 -31
  33. data/lib/albacore/sqlcmd.rb +54 -51
  34. data/lib/albacore/ssh.rb +35 -33
  35. data/lib/albacore/support/albacore_helper.rb +1 -4
  36. data/lib/albacore/support/attrmethods.rb +25 -0
  37. data/lib/albacore/support/failure.rb +17 -17
  38. data/lib/albacore/support/globalconfig.rb +6 -0
  39. data/lib/albacore/support/logging.rb +30 -28
  40. data/lib/albacore/support/runcommand.rb +41 -41
  41. data/lib/albacore/support/yamlconfig.rb +23 -27
  42. data/lib/albacore/unzip.rb +28 -0
  43. data/lib/albacore/xbuild.rb +54 -0
  44. data/lib/albacore/xunittestrunner.rb +40 -43
  45. data/lib/albacore/zipdirectory.rb +72 -63
  46. data/lib/rake/assemblyinfotask.rb +12 -11
  47. data/lib/rake/docutask.rb +17 -0
  48. data/lib/rake/exectask.rb +18 -0
  49. data/lib/rake/expandtemplatestask.rb +12 -11
  50. data/lib/rake/msbuildtask.rb +13 -12
  51. data/lib/rake/mspectask.rb +12 -11
  52. data/lib/rake/nanttask.rb +17 -0
  53. data/lib/rake/ncoverconsoletask.rb +12 -11
  54. data/lib/rake/ncoverreporttask.rb +12 -11
  55. data/lib/rake/ndependtask.rb +23 -0
  56. data/lib/rake/nunittask.rb +12 -11
  57. data/lib/rake/plinktask.rb +23 -0
  58. data/lib/rake/renametask.rb +15 -15
  59. data/lib/rake/sftptask.rb +11 -10
  60. data/lib/rake/sqlcmdtask.rb +13 -12
  61. data/lib/rake/sshtask.rb +11 -10
  62. data/lib/rake/support/albacoretask.rb +16 -15
  63. data/lib/rake/unziptask.rb +17 -0
  64. data/lib/rake/xbuildtask.rb +22 -0
  65. data/lib/rake/xunittask.rb +12 -11
  66. data/lib/rake/ziptask.rb +12 -11
  67. data/rakefile.rb +255 -204
  68. data/spec/assemblyinfo_spec.rb +426 -221
  69. data/spec/assemblyinfotask_spec.rb +21 -21
  70. data/spec/docu_spec.rb +70 -0
  71. data/spec/docutask_spec.rb +39 -0
  72. data/spec/exec_spec.rb +23 -0
  73. data/spec/exectask_spec.rb +31 -0
  74. data/spec/expandtemplates_spec.rb +149 -148
  75. data/spec/expandtemplatestask_spec.rb +21 -21
  76. data/spec/msbuild_spec.rb +150 -139
  77. data/spec/msbuildtask_spec.rb +21 -21
  78. data/spec/mspectask_spec.rb +21 -21
  79. data/spec/nant_spec.rb +101 -0
  80. data/spec/nanttask_spec.rb +31 -0
  81. data/spec/ncoverconsole_spec.rb +253 -221
  82. data/spec/ncoverconsoletask_spec.rb +21 -21
  83. data/spec/ncoverreport_spec.rb +538 -523
  84. data/spec/ncoverreporttask_spec.rb +21 -21
  85. data/spec/ndepend_spec.rb +49 -0
  86. data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
  87. data/spec/nunittask_spec.rb +21 -21
  88. data/spec/nunittestrunner_spec.rb +6 -6
  89. data/spec/patches/docu_patch.rb +13 -0
  90. data/spec/patches/system_patch.rb +18 -18
  91. data/spec/patches/tasklib_patch.rb +10 -10
  92. data/spec/plink_spec.rb +61 -0
  93. data/spec/plinktask_spec.rb +31 -0
  94. data/spec/renametask_spec.rb +21 -21
  95. data/spec/sftp_spec.rb +24 -24
  96. data/spec/sftptask_spec.rb +31 -31
  97. data/spec/sqlcmd_spec.rb +118 -120
  98. data/spec/sqlcmdtask_spec.rb +21 -21
  99. data/spec/ssh_spec.rb +36 -37
  100. data/spec/sshtask_spec.rb +29 -29
  101. data/spec/support/TestSolution/NDependProject.xml +315 -0
  102. data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
  103. data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
  104. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
  105. data/spec/support/TestSolution/TestSolution.build +25 -0
  106. data/spec/support/assemblyinfotester.rb +40 -38
  107. data/spec/support/expandtemplatestestdata.rb +73 -73
  108. data/spec/support/msbuildtestdata.rb +28 -28
  109. data/spec/support/nanttestdata.rb +33 -0
  110. data/spec/support/ncoverconsoletestdata.rb +18 -0
  111. data/spec/support/ncoverreporttestdata.rb +24 -24
  112. data/spec/support/spec_helper.rb +2 -1
  113. data/spec/support/yamlconfig/msbuild.yml +3 -0
  114. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
  115. data/spec/support/ziptestdata.rb +11 -6
  116. data/spec/xunit_spec.rb +63 -0
  117. data/spec/xunittask_spec.rb +19 -19
  118. data/spec/yamlconfig_spec.rb +38 -52
  119. data/spec/zip_spec.rb +56 -11
  120. data/spec/ziptask_spec.rb +22 -22
  121. metadata +53 -8
  122. data/lib/albacore/command.rb +0 -23
  123. data/lib/rake/commandtask.rb +0 -16
  124. data/spec/command_spec.rb +0 -23
@@ -0,0 +1,23 @@
1
+ require 'rake/tasklib'
2
+ require 'albacore'
3
+
4
+ def ndepend(name=:command, *args, &block)
5
+ Albacore::NDepend.new(name, *args, &block)
6
+ end
7
+
8
+ module Albacore
9
+ class NDependTask < Albacore::AlbacoreTask
10
+ attr_accessor :project_file , :parameters
11
+
12
+ def execute(name, task_args)
13
+ cmd = NDepend.new()
14
+ cmd.load_config_by_task_name(name)
15
+ @block.call(cmd, *task_args) unless @block.nil?
16
+ cmd.run
17
+ fail if cmd.failed
18
+ end
19
+ end
20
+ end
21
+
22
+
23
+
@@ -1,16 +1,17 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def nunittask(name=:nunit, *args, &block)
4
- Albacore::NUnitTask.new(name, *args, &block)
3
+ def nunit(name=:nunit, *args, &block)
4
+ Albacore::NUnitTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class NUnitTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @nunit = NUnitTestRunner.new
11
- @block.call(@nunit, *task_args) unless @block.nil?
12
- @nunit.execute
13
- fail if @nunit.failed
14
- end
15
- end
8
+ class NUnitTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @nunit = NUnitTestRunner.new
11
+ @nunit.load_config_by_task_name(name)
12
+ @block.call(@nunit, *task_args) unless @block.nil?
13
+ @nunit.execute
14
+ fail if @nunit.failed
15
+ end
16
+ end
16
17
  end
@@ -0,0 +1,23 @@
1
+ require 'rake/tasklib'
2
+ require 'albacore'
3
+
4
+ def plink(name=:command, *args, &block)
5
+ Albacore::PLinkTask.new(name, *args, &block)
6
+ end
7
+
8
+ module Albacore
9
+ class PLinkTask < Albacore::AlbacoreTask
10
+ attr_accessor :remote_parameters, :remote_path_to_command
11
+
12
+ def execute(name, task_args)
13
+ cmd = PLink.new()
14
+ cmd.load_config_by_task_name(name)
15
+ @block.call(cmd, *task_args) unless @block.nil?
16
+ cmd.run
17
+ fail if cmd.failed
18
+ end
19
+ end
20
+ end
21
+
22
+
23
+
@@ -1,20 +1,20 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def renametask(name=:rename, *args, &block)
4
- Albacore::RenameTask.new(name, *args, &block)
3
+ def rename(name=:rename, *args, &block)
4
+ Albacore::RenameTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class RenameTask < Albacore::AlbacoreTask
9
- attr_accessor :actual_name, :target_name
10
-
11
- def execute(task_args)
12
- @block.call(self, *task_args) unless @block.nil?
13
- if (@actual_name.nil? || @target_name.nil?)
14
- fail
15
- else
16
- File.rename(@actual_name, @target_name)
17
- end
18
- end
19
- end
8
+ class RenameTask < Albacore::AlbacoreTask
9
+ attr_accessor :actual_name, :target_name
10
+
11
+ def execute(name, task_args)
12
+ @block.call(self, *task_args) unless @block.nil?
13
+ if (@actual_name.nil? || @target_name.nil?)
14
+ fail
15
+ else
16
+ File.rename(@actual_name, @target_name)
17
+ end
18
+ end
19
+ end
20
20
  end
@@ -1,15 +1,16 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def sftptask(name=:sftp, *args, &block)
4
- Albacore::SftpTask.new(name, *args, &block)
3
+ def sftp(name=:sftp, *args, &block)
4
+ Albacore::SftpTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class SftpTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @sftp = Sftp.new
11
- @block.call(@sftp, *task_args) unless @block.nil?
12
- @sftp.upload
13
- end
14
- end
8
+ class SftpTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @sftp = Sftp.new
11
+ @sftp.load_config_by_task_name(name)
12
+ @block.call(@sftp, *task_args) unless @block.nil?
13
+ @sftp.upload
14
+ end
15
+ end
15
16
  end
@@ -1,16 +1,17 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def sqlcmdtask(name=:sqlcmd, *args, &block)
4
- Albacore::SQLCmdTask.new(name, *args, &block)
3
+ def sqlcmd(name=:sqlcmd, *args, &block)
4
+ Albacore::SQLCmdTask.new(name, *args, &block)
5
5
  end
6
-
7
- module Albacore
8
- class SQLCmdTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @sqlcmd = SQLCmd.new
11
- @block.call(@sqlcmd, *task_args) unless @block.nil?
12
- @sqlcmd.run
13
- fail if @sqlcmd.failed
14
- end
15
- end
6
+
7
+ module Albacore
8
+ class SQLCmdTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @sqlcmd = SQLCmd.new
11
+ @sqlcmd.load_config_by_task_name(name)
12
+ @block.call(@sqlcmd, *task_args) unless @block.nil?
13
+ @sqlcmd.run
14
+ fail if @sqlcmd.failed
15
+ end
16
+ end
16
17
  end
@@ -1,15 +1,16 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def sshtask(name=:ssh, *args, &block)
4
- Albacore::SshTask.new(name, *args, &block)
3
+ def ssh(name=:ssh, *args, &block)
4
+ Albacore::SshTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class SshTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @ssh = Ssh.new
11
- @block.call(@ssh, *task_args) unless @block.nil?
12
- @ssh.execute
13
- end
14
- end
8
+ class SshTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @ssh = Ssh.new
11
+ @ssh.load_config_by_task_name(name)
12
+ @block.call(@ssh, *task_args) unless @block.nil?
13
+ @ssh.execute
14
+ end
15
+ end
15
16
  end
@@ -1,19 +1,20 @@
1
1
  require 'rake/tasklib'
2
2
 
3
3
  module Albacore
4
- class AlbacoreTask < ::Rake::TaskLib
5
- attr_accessor :name
6
-
7
- def initialize(name, *args, &block)
8
- @block = block
9
- @args = args.insert(0, name)
10
- define
11
- end
12
-
13
- def define
14
- task *@args do |task, task_args|
15
- execute task_args
16
- end
17
- end
18
- end
4
+ class AlbacoreTask < ::Rake::TaskLib
5
+ attr_accessor :name
6
+
7
+ def initialize(name, *args, &block)
8
+ @block = block
9
+ @args = args.insert(0, name)
10
+ @name = name
11
+ define
12
+ end
13
+
14
+ def define
15
+ task *@args do |task, task_args|
16
+ execute @name.to_s, task_args
17
+ end
18
+ end
19
+ end
19
20
  end
@@ -0,0 +1,17 @@
1
+ require 'rake/tasklib'
2
+
3
+ def unzip(name=:unzip, *args, &block)
4
+ Albacore::UnZipTask.new(name, *args, &block)
5
+ end
6
+
7
+ module Albacore
8
+ class UnZipTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @zip = Unzip.new
11
+ @zip.load_config_by_task_name(name)
12
+ @block.call(@zip, *task_args) unless @block.nil?
13
+ @zip.unzip
14
+ fail if @zip.failed
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ require 'rake/tasklib'
2
+
3
+ def xbuild(name=:xbuild, *args, &block)
4
+ Albacore::XBuildTask.new(name, *args, &block)
5
+ end
6
+
7
+ def mono(name=:mono, *args, &block)
8
+ Albacore::XBuildTask.new(name, *args, &block)
9
+ end
10
+
11
+ module Albacore
12
+ class XBuildTask < Albacore::AlbacoreTask
13
+ def execute(name, task_args)
14
+ @xbuild = XBuild.new
15
+ @xbuild.load_config_by_task_name(name)
16
+ @block.call(@xbuild, *task_args) unless @block.nil?
17
+ @xbuild.build
18
+ fail if @xbuild.failed
19
+ end
20
+ end
21
+
22
+ end
@@ -1,16 +1,17 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def xunittask(name=:xunit, *args, &block)
4
- Albacore::XUnitTask.new(name, *args, &block)
3
+ def xunit(name=:xunit, *args, &block)
4
+ Albacore::XUnitTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class XUnitTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @xunit = XUnitTestRunner.new
11
- @block.call(@xunit, *task_args) unless @block.nil?
12
- @xunit.execute
13
- fail if @xunit.failed
14
- end
15
- end
8
+ class XUnitTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @xunit = XUnitTestRunner.new
11
+ @xunit.load_config_by_task_name(name)
12
+ @block.call(@xunit, *task_args) unless @block.nil?
13
+ @xunit.execute
14
+ fail if @xunit.failed
15
+ end
16
+ end
16
17
  end
@@ -1,16 +1,17 @@
1
1
  require 'rake/tasklib'
2
2
 
3
- def ziptask(name=:zip, *args, &block)
4
- Albacore::ZipTask.new(name, *args, &block)
3
+ def zip(name=:zip, *args, &block)
4
+ Albacore::ZipTask.new(name, *args, &block)
5
5
  end
6
-
6
+
7
7
  module Albacore
8
- class ZipTask < Albacore::AlbacoreTask
9
- def execute(task_args)
10
- @zip = ZipDirectory.new
11
- @block.call(@zip, *task_args) unless @block.nil?
12
- @zip.package
13
- fail if @zip.failed
14
- end
15
- end
8
+ class ZipTask < Albacore::AlbacoreTask
9
+ def execute(name, task_args)
10
+ @zip = ZipDirectory.new
11
+ @zip.load_config_by_task_name(name)
12
+ @block.call(@zip, *task_args) unless @block.nil?
13
+ @zip.package
14
+ fail if @zip.failed
15
+ end
16
+ end
16
17
  end
@@ -1,112 +1,147 @@
1
1
  task :default => ['albacore:sample']
2
2
 
3
3
  namespace :specs do
4
- require 'spec/rake/spectask'
5
-
6
- @spec_opts = '--colour --format specdoc'
7
-
8
- desc "Run functional specs for Albacore"
9
- Spec::Rake::SpecTask.new :all do |t|
10
- t.spec_files = 'spec/**/*_spec.rb'
11
- t.spec_opts << @spec_opts
12
- end
13
-
14
- desc "Run rake task specs for Albacore"
15
- Spec::Rake::SpecTask.new :tasks do |t|
16
- t.spec_files = 'spec/**/*task_spec.rb'
17
- t.spec_opts << @spec_opts
18
- end
19
-
20
- desc "Assembly info functional specs"
21
- Spec::Rake::SpecTask.new :assemblyinfo do |t|
22
- t.spec_files = 'spec/assemblyinfo*_spec.rb'
23
- t.spec_opts << @spec_opts
24
- end
25
-
26
- desc "MSBuild functional specs"
27
- Spec::Rake::SpecTask.new :msbuild do |t|
28
- t.spec_files = 'spec/msbuild*_spec.rb'
29
- t.spec_opts << @spec_opts
30
- end
31
-
32
- desc "SQLServer SQLCmd functional specs"
33
- Spec::Rake::SpecTask.new :sqlcmd do |t|
34
- t.spec_files = 'spec/sqlcmd*_spec.rb'
35
- t.spec_opts << @spec_opts
36
- end
37
-
38
- desc "NCover Console functional specs"
39
- Spec::Rake::SpecTask.new :ncoverconsole do |t|
40
- t.spec_files = 'spec/ncoverconsole*_spec.rb'
41
- t.spec_opts << @spec_opts
42
- end
43
-
44
- desc "NCover Report functional specs"
45
- Spec::Rake::SpecTask.new :ncoverreport do |t|
46
- t.spec_files = 'spec/ncoverreport*_spec.rb'
47
- t.spec_opts << @spec_opts
48
- end
49
-
50
- desc "SSH functional specs"
51
- Spec::Rake::SpecTask.new :ssh do |t|
52
- t.spec_files = 'spec/ssh*_spec.rb'
53
- t.spec_opts << @spec_opts
54
- end
55
-
56
- desc "SFTP functional specs"
57
- Spec::Rake::SpecTask.new :sftp do |t|
58
- t.spec_files = 'spec/sftp*_spec.rb'
59
- t.spec_opts << @spec_opts
60
- end
61
-
62
- desc "Expand Templates functional specs"
63
- Spec::Rake::SpecTask.new :templates do |t|
64
- t.spec_files = 'spec/expandtemplates*_spec.rb'
65
- t.spec_opts << @spec_opts
4
+ require 'spec/rake/spectask'
5
+
6
+ @spec_opts = '--colour --format specdoc'
7
+
8
+ desc "Run functional specs for Albacore"
9
+ Spec::Rake::SpecTask.new :all do |t|
10
+ t.spec_files = 'spec/**/*_spec.rb'
11
+ t.spec_opts << @spec_opts
12
+ end
13
+
14
+ desc "Run rake task specs for Albacore"
15
+ Spec::Rake::SpecTask.new :tasks do |t|
16
+ t.spec_files = 'spec/**/*task_spec.rb'
17
+ t.spec_opts << @spec_opts
18
+ end
19
+
20
+ desc "Assembly info functional specs"
21
+ Spec::Rake::SpecTask.new :assemblyinfo do |t|
22
+ t.spec_files = 'spec/assemblyinfo*_spec.rb'
23
+ t.spec_opts << @spec_opts
24
+ end
25
+
26
+ desc "MSBuild functional specs"
27
+ Spec::Rake::SpecTask.new :msbuild do |t|
28
+ t.spec_files = 'spec/msbuild*_spec.rb'
29
+ t.spec_opts << @spec_opts
30
+ end
31
+
32
+ desc "SQLServer SQLCmd functional specs"
33
+ Spec::Rake::SpecTask.new :sqlcmd do |t|
34
+ t.spec_files = 'spec/sqlcmd*_spec.rb'
35
+ t.spec_opts << @spec_opts
36
+ end
37
+
38
+
39
+ desc "Nant functional specs"
40
+ Spec::Rake::SpecTask.new :nant do |t|
41
+ t.spec_files = 'spec/nant*_spec.rb'
42
+ t.spec_opts << @spec_opts
43
+ end
44
+
45
+ desc "NCover Console functional specs"
46
+ Spec::Rake::SpecTask.new :ncoverconsole do |t|
47
+ t.spec_files = 'spec/ncoverconsole*_spec.rb'
48
+ t.spec_opts << @spec_opts
49
+ end
50
+
51
+ desc "NCover Report functional specs"
52
+ Spec::Rake::SpecTask.new :ncoverreport do |t|
53
+ t.spec_files = 'spec/ncoverreport*_spec.rb'
54
+ t.spec_opts << @spec_opts
55
+ end
56
+
57
+ desc "SSH functional specs"
58
+ Spec::Rake::SpecTask.new :ssh do |t|
59
+ t.spec_files = 'spec/ssh*_spec.rb'
60
+ t.spec_opts << @spec_opts
61
+ end
62
+
63
+ desc "Plink functional specs"
64
+ Spec::Rake::SpecTask.new :plink do |t|
65
+ t.spec_files = 'spec/plink*_spec.rb'
66
+ t.spec_opts << @spec_opts
67
+ end
68
+
69
+ desc "Ndepend functional specs"
70
+ Spec::Rake::SpecTask.new :ndepend do |t|
71
+ t.spec_files = 'spec/ndepend*_spec.rb'
72
+ t.spec_opts << @spec_opts
73
+ end
74
+
75
+ desc "SFTP functional specs"
76
+ Spec::Rake::SpecTask.new :sftp do |t|
77
+ t.spec_files = 'spec/sftp*_spec.rb'
78
+ t.spec_opts << @spec_opts
79
+ end
80
+
81
+ desc "Expand Templates functional specs"
82
+ Spec::Rake::SpecTask.new :templates do |t|
83
+ t.spec_files = 'spec/expandtemplates*_spec.rb'
84
+ t.spec_opts << @spec_opts
66
85
  end
67
86
 
68
- desc "Zip functional specs"
69
- Spec::Rake::SpecTask.new :zip do |t|
70
- t.spec_files = 'spec/zip*_spec.rb'
71
- t.spec_opts << @spec_opts
87
+ desc "Zip functional specs"
88
+ Spec::Rake::SpecTask.new :zip do |t|
89
+ t.spec_files = 'spec/zip*_spec.rb'
90
+ t.spec_opts << @spec_opts
72
91
  end
73
92
 
74
- desc "XUnit functional specs"
75
- Spec::Rake::SpecTask.new :xunit do |t|
76
- t.spec_files = 'spec/xunit*_spec.rb'
77
- t.spec_opts << @spec_opts
78
- end
79
-
80
- desc "NUnit functional specs"
81
- Spec::Rake::SpecTask.new :nunit do |t|
82
- t.spec_files = 'spec/nunit*_spec.rb'
83
- t.spec_opts << @spec_opts
84
- end
85
-
86
- desc "MSpec functional specs"
87
- Spec::Rake::SpecTask.new :mspec do |t|
88
- t.spec_files = 'spec/mspec*_spec.rb'
89
- t.spec_opts << @spec_opts
90
- end
91
-
92
- desc "Command functional specs"
93
- Spec::Rake::SpecTask.new :command do |t|
94
- t.spec_files = 'spec/command*_spec.rb'
95
- t.spec_opts << @spec_opts
96
- end
97
-
98
- desc "Rename functional specs"
99
- Spec::Rake::SpecTask.new :rename do |t|
100
- t.spec_files = 'spec/rename*_spec.rb'
101
- t.spec_opts << @spec_opts
102
- end
93
+ desc "XUnit functional specs"
94
+ Spec::Rake::SpecTask.new :xunit do |t|
95
+ t.spec_files = 'spec/xunit*_spec.rb'
96
+ t.spec_opts << @spec_opts
97
+ end
98
+
99
+ desc "NUnit functional specs"
100
+ Spec::Rake::SpecTask.new :nunit do |t|
101
+ t.spec_files = 'spec/nunit*_spec.rb'
102
+ t.spec_opts << @spec_opts
103
+ end
104
+
105
+ desc "MSpec functional specs"
106
+ Spec::Rake::SpecTask.new :mspec do |t|
107
+ t.spec_files = 'spec/mspec*_spec.rb'
108
+ t.spec_opts << @spec_opts
109
+ end
110
+
111
+ desc "Exec functional specs"
112
+ Spec::Rake::SpecTask.new :exec do |t|
113
+ t.spec_files = 'spec/exec*_spec.rb'
114
+ t.spec_opts << @spec_opts
115
+ end
116
+
117
+ desc "Rename functional specs"
118
+ Spec::Rake::SpecTask.new :rename do |t|
119
+ t.spec_files = 'spec/rename*_spec.rb'
120
+ t.spec_opts << @spec_opts
121
+ end
122
+
123
+ desc "Docu functional specs"
124
+ Spec::Rake::SpecTask.new :docu do |t|
125
+ t.spec_files = 'spec/docu*_spec.rb'
126
+ t.spec_opts << @spec_opts
127
+ end
128
+
129
+ desc "YAML Config functional specs"
130
+ Spec::Rake::SpecTask.new :yamlconfig do |t|
131
+ t.spec_files = 'spec/yaml*_spec.rb'
132
+ t.spec_opts << @spec_opts
133
+ end
103
134
  end
104
135
 
105
- namespace :albacore do
106
- require 'lib/albacore'
136
+ namespace :albacore do
137
+ require 'lib/albacore'
138
+
139
+ #global configuration options
140
+ Albacore::yaml_config_folder = "spec/support/yamlconfig"
141
+ Albacore::log_level = :verbose
107
142
 
108
- desc "Run a complete Albacore build sample"
109
- task :sample => ['albacore:assemblyinfo',
143
+ desc "Run a complete Albacore build sample"
144
+ task :sample => ['albacore:assemblyinfo',
110
145
  'albacore:msbuild',
111
146
  'albacore:ncoverconsole',
112
147
  'albacore:ncoverreport',
@@ -114,115 +149,131 @@ namespace :albacore do
114
149
  'albacore:mspec',
115
150
  'albacore:nunit',
116
151
  'albacore:xunit']
117
-
118
- desc "Run a sample build using the MSBuildTask"
119
- msbuildtask do |msb|
120
- msb.properties = {:configuration => :Debug}
121
- msb.targets [:Clean, :Build]
122
- msb.solution = "spec/support/TestSolution/TestSolution.sln"
123
- end
124
-
125
- desc "Run a sample assembly info generator"
126
- assemblyinfotask do |asm|
127
- asm.version = "0.1.2.3"
128
- asm.company_name = "a test company"
129
- asm.product_name = "a product name goes here"
130
- asm.title = "my assembly title"
131
- asm.description = "this is the assembly description"
132
- asm.copyright = "copyright some year, by some legal entity"
133
- asm.custom_attributes :SomeAttribute => "some value goes here", :AnotherAttribute => "with some data"
134
-
135
- asm.output_file = "spec/support/AssemblyInfo/AssemblyInfo.cs"
136
- end
137
-
138
- desc "Run a sample NCover Console code coverage"
139
- ncoverconsoletask do |ncc|
140
- @xml_coverage = "spec/support/CodeCoverage/test-coverage.xml"
141
- File.delete(@xml_coverage) if File.exist?(@xml_coverage)
142
-
143
- ncc.log_level = :verbose
144
- ncc.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Console.exe"
145
- ncc.output = {:xml => @xml_coverage}
146
- ncc.working_directory = "spec/support/CodeCoverage/nunit"
147
-
148
- nunit = NUnitTestRunner.new("spec/support/Tools/NUnit-v2.5/nunit-console-x86.exe")
149
- nunit.log_level = :verbose
150
- nunit.assemblies << "assemblies/TestSolution.Tests.dll"
151
- nunit.options << '/noshadow'
152
-
153
- ncc.testrunner = nunit
154
- end
155
-
156
- desc "Run a sample NCover Report to check code coverage"
157
- ncoverreporttask :ncoverreport => :ncoverconsole do |ncr|
158
- @xml_coverage = "spec/support/CodeCoverage/test-coverage.xml"
159
-
160
- ncr.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Reporting.exe"
161
- ncr.coverage_files << @xml_coverage
162
-
163
- fullcoveragereport = NCover::FullCoverageReport.new
164
- fullcoveragereport.output_path = "spec/support/CodeCoverage/report/output"
165
- ncr.reports << fullcoveragereport
166
-
167
- ncr.required_coverage << NCover::BranchCoverage.new(:minimum => 10)
168
- ncr.required_coverage << NCover::CyclomaticComplexity.new(:maximum => 1)
169
- end
170
-
171
- desc "Run the sample for renaming a File"
172
- renametask do |rename|
173
- FileUtils.touch 'web.uat.config.example'
152
+
153
+ desc "Run a sample MSBuild with YAML autoconfig"
154
+ msbuild
155
+
156
+ desc "Run a sample assembly info generator"
157
+ assemblyinfo do |asm|
158
+ asm.version = "0.1.2.3"
159
+ asm.company_name = "a test company"
160
+ asm.product_name = "a product name goes here"
161
+ asm.title = "my assembly title"
162
+ asm.description = "this is the assembly description"
163
+ asm.copyright = "copyright some year, by some legal entity"
164
+ asm.custom_attributes :SomeAttribute => "some value goes here", :AnotherAttribute => "with some data"
165
+
166
+ asm.output_file = "spec/support/AssemblyInfo/AssemblyInfo.cs"
167
+ end
168
+
169
+ desc "Run a sample NCover Console code coverage"
170
+ ncoverconsole do |ncc|
171
+ @xml_coverage = "spec/support/CodeCoverage/test-coverage.xml"
172
+ File.delete(@xml_coverage) if File.exist?(@xml_coverage)
173
+
174
+ ncc.log_level = :verbose
175
+ ncc.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Console.exe"
176
+ ncc.output :xml => @xml_coverage
177
+ ncc.working_directory = "spec/support/CodeCoverage/nunit"
178
+
179
+ nunit = NUnitTestRunner.new("spec/support/Tools/NUnit-v2.5/nunit-console-x86.exe")
180
+ nunit.log_level = :verbose
181
+ nunit.assemblies "assemblies/TestSolution.Tests.dll"
182
+ nunit.options '/noshadow'
183
+
184
+ ncc.testrunner = nunit
185
+ end
186
+
187
+ desc "Run a sample NCover Report to check code coverage"
188
+ ncoverreport :ncoverreport => :ncoverconsole do |ncr|
189
+ @xml_coverage = "spec/support/CodeCoverage/test-coverage.xml"
190
+
191
+ ncr.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Reporting.exe"
192
+ ncr.coverage_files @xml_coverage
193
+
194
+ fullcoveragereport = NCover::FullCoverageReport.new
195
+ fullcoveragereport.output_path = "spec/support/CodeCoverage/report/output"
196
+ ncr.reports fullcoveragereport
197
+
198
+ ncr.required_coverage(
199
+ NCover::BranchCoverage.new(:minimum => 10),
200
+ NCover::CyclomaticComplexity.new(:maximum => 1)
201
+ )
202
+ end
203
+
204
+ desc "Run the sample for renaming a File"
205
+ rename do |rename|
206
+ FileUtils.touch 'web.uat.config.example'
174
207
 
175
- rename.actual_name = 'web.uat.config.example'
176
- rename.target_name = 'web.config.example'
177
- end
208
+ rename.actual_name = 'web.uat.config.example'
209
+ rename.target_name = 'web.config.example'
210
+ end
178
211
 
179
- desc "Run ZipDirectory example"
180
- ziptask do |zip|
181
- zip.output_path = File.dirname(__FILE__)
182
- zip.directories_to_zip = ["lib", "spec"]
183
- zip.additional_files = "README.markdown"
184
- zip.file = 'albacore_example.zip'
185
- end
212
+ desc "Run ZipDirectory example"
213
+ zip do |zip|
214
+ zip.output_path = File.dirname(__FILE__)
215
+ zip.directories_to_zip = "lib", "spec"
216
+ zip.additional_files "README.markdown"
217
+ zip.output_file = 'albacore_example.zip'
218
+ end
219
+
220
+ desc "Run UnZip example"
221
+ unzip do |zip|
222
+ zip.unzip_path = File.join File.dirname(__FILE__), 'temp'
223
+ zip.zip_file = 'albacore_example.zip'
224
+ end
186
225
 
187
- desc "MSpec Test Runner Example"
188
- mspectask do |mspec|
189
- mspec.path_to_command = "spec/support/Tools/Machine.Specification-v0.2/Machine.Specifications.ConsoleRunner.exe"
190
- mspec.assemblies << "spec/support/CodeCoverage/mspec/assemblies/TestSolution.MSpecTests.dll"
191
- end
192
-
193
- desc "NUnit Test Runner Example"
194
- nunittask do |nunit|
195
- nunit.path_to_command = "spec/support/Tools/NUnit-v2.5/nunit-console.exe"
196
- nunit.assemblies << "spec/support/CodeCoverage/nunit/assemblies/TestSolution.Tests.dll"
197
- end
198
-
199
- desc "XUnit Test Runner Example"
200
- xunittask do |xunit|
201
- xunit.path_to_command = "spec/support/Tools/XUnit-v1.5/xunit.console.exe"
202
- xunit.assemblies << "spec/support/CodeCoverage/xunit/assemblies/TestSolution.XUnitTests.dll"
203
- end
226
+ desc "MSpec Test Runner Example"
227
+ mspec do |mspec|
228
+ mspec.path_to_command = "spec/support/Tools/Machine.Specification-v0.2/Machine.Specifications.ConsoleRunner.exe"
229
+ mspec.assemblies "spec/support/CodeCoverage/mspec/assemblies/TestSolution.MSpecTests.dll"
230
+ end
231
+
232
+ desc "NUnit Test Runner Example"
233
+ nunit do |nunit|
234
+ nunit.path_to_command = "spec/support/Tools/NUnit-v2.5/nunit-console.exe"
235
+ nunit.assemblies "spec/support/CodeCoverage/nunit/assemblies/TestSolution.Tests.dll"
236
+ end
237
+
238
+ desc "XUnit Test Runner Example"
239
+ xunit do |xunit|
240
+ xunit.path_to_command = "spec/support/Tools/XUnit-v1.5/xunit.console.exe"
241
+ xunit.assembly = "spec/support/CodeCoverage/xunit/assemblies/TestSolution.XUnitTests.dll"
242
+ end
243
+
244
+ desc "Exec Task Example"
245
+ exec do |exec|
246
+ exec.command = 'hostname'
247
+ end
248
+
249
+ desc "Mono \ xBuild Example"
250
+ mono do |xbuild|
251
+ xbuild.properties :configuration => :release, :platform => 'Any CPU'
252
+ xbuild.targets :clean, :build
253
+ xbuild.solution = "spec/support/TestSolution/TestSolution.sln"
254
+ end
204
255
  end
205
256
 
206
257
  namespace :jeweler do
207
- require 'jeweler'
208
- Jeweler::Tasks.new do |gs|
209
- gs.name = "albacore"
210
- gs.summary = "A Suite of Rake Build Tasks For .Net Solutions"
211
- gs.description = "Easily build your .NET solutions with rake, using this suite of rake tasks."
212
- gs.email = "derickbailey@gmail.com"
213
- gs.homepage = "http://albacorebuild.net"
214
- gs.authors = ["Derick Bailey", "Ben Hall", "Steven Harman"]
215
- gs.has_rdoc = false
216
- gs.files.exclude("albacore.gemspec", ".gitignore", "spec/support/Tools")
217
-
218
- gs.add_dependency('rake', '>= 0.8.7')
219
- gs.add_dependency('net-ssh', '>= 2.0.15')
220
- gs.add_dependency('net-sftp', '>= 2.0.2')
221
- gs.add_dependency('rubyzip', '>= 0.9.1')
222
-
223
- gs.add_development_dependency('rspec', '>= 1.2.8')
224
- gs.add_development_dependency('jeweler', '>= 1.2.1')
225
- gs.add_development_dependency('derickbailey-notamock', '>= 0.0.1')
226
- gs.add_development_dependency('jekyll', '>= 0.5.4')
227
- end
258
+ require 'jeweler'
259
+ Jeweler::Tasks.new do |gs|
260
+ gs.name = "albacore"
261
+ gs.summary = "A Suite of Rake Build Tasks For .Net Solutions"
262
+ gs.description = "Easily build your .NET solutions with rake, using this suite of rake tasks."
263
+ gs.email = "derickbailey@gmail.com"
264
+ gs.homepage = "http://albacorebuild.net"
265
+ gs.authors = ["Derick Bailey", "Ben Hall", "Steven Harman"]
266
+ gs.has_rdoc = false
267
+ gs.files.exclude("albacore.gemspec", ".gitignore", "spec/support/Tools")
268
+
269
+ gs.add_dependency('rake', '>= 0.8.7')
270
+ gs.add_dependency('net-ssh', '>= 2.0.15')
271
+ gs.add_dependency('net-sftp', '>= 2.0.2')
272
+ gs.add_dependency('rubyzip', '>= 0.9.1')
273
+
274
+ gs.add_development_dependency('rspec', '>= 1.2.8')
275
+ gs.add_development_dependency('jeweler', '>= 1.2.1')
276
+ gs.add_development_dependency('derickbailey-notamock', '>= 0.0.1')
277
+ gs.add_development_dependency('jekyll', '>= 0.5.4')
278
+ end
228
279
  end