albacore 1.0.0 → 2.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. data/.gitignore +6 -21
  2. data/.travis.yml +31 -12
  3. data/Gemfile +14 -6
  4. data/Guardfile +1 -3
  5. data/README.md +200 -47
  6. data/Rakefile +9 -19
  7. data/albacore.gemspec +33 -23
  8. data/lib/albacore.rb +3 -47
  9. data/lib/albacore/albacore_module.rb +57 -0
  10. data/lib/albacore/application.rb +43 -0
  11. data/lib/albacore/cmd_config.rb +66 -0
  12. data/lib/albacore/config_dsl.rb +55 -0
  13. data/lib/albacore/cross_platform_cmd.rb +291 -0
  14. data/lib/albacore/dsl.rb +90 -0
  15. data/lib/albacore/errors/command_failed_error.rb +11 -0
  16. data/lib/albacore/errors/command_not_found_error.rb +13 -0
  17. data/lib/albacore/errors/unfilled_property_error.rb +14 -0
  18. data/lib/albacore/ext/README.md +12 -0
  19. data/lib/albacore/ext/teamcity.rb +64 -0
  20. data/lib/albacore/facts.rb +25 -0
  21. data/lib/albacore/logging.rb +32 -0
  22. data/lib/albacore/nuget_model.rb +387 -0
  23. data/lib/albacore/paths.rb +34 -0
  24. data/lib/albacore/project.rb +141 -0
  25. data/lib/albacore/semver.rb +5 -0
  26. data/lib/albacore/task_types/asmver.rb +72 -0
  27. data/lib/albacore/task_types/asmver/cpp.rb +20 -0
  28. data/lib/albacore/task_types/asmver/cs.rb +17 -0
  29. data/lib/albacore/task_types/asmver/engine.rb +126 -0
  30. data/lib/albacore/task_types/asmver/file_generator.rb +45 -0
  31. data/lib/albacore/task_types/asmver/fs.rb +37 -0
  32. data/lib/albacore/task_types/asmver/vb.rb +27 -0
  33. data/lib/albacore/task_types/build.rb +192 -0
  34. data/lib/albacore/task_types/nugets_authentication.rb +9 -0
  35. data/lib/albacore/task_types/nugets_pack.rb +378 -0
  36. data/lib/albacore/task_types/nugets_restore.rb +138 -0
  37. data/lib/albacore/task_types/test_runner.rb +39 -0
  38. data/lib/albacore/tasks/README.md +16 -0
  39. data/lib/albacore/tasks/albasemver.rb +49 -0
  40. data/lib/albacore/tasks/projectlint.rb +81 -0
  41. data/lib/albacore/tasks/versionizer.rb +65 -0
  42. data/lib/albacore/tools/fluent_migrator.rb +177 -0
  43. data/lib/albacore/tools/restore_hint_paths.rb +112 -0
  44. data/lib/albacore/version.rb +3 -3
  45. data/spec/Rakefile +5 -0
  46. data/spec/albacore_spec.rb +12 -0
  47. data/spec/asmver_spec.rb +151 -0
  48. data/spec/asmver_task_spec.rb +32 -0
  49. data/spec/build_spec.rb +60 -0
  50. data/spec/config_dsl_spec.rb +83 -0
  51. data/spec/cross_platform_cmd_spec.rb +65 -0
  52. data/spec/dsl_spec.rb +39 -0
  53. data/spec/ext_teamcity_spec.rb +71 -0
  54. data/spec/facts_spec.rb +7 -0
  55. data/spec/nuget_model_spec.rb +401 -0
  56. data/spec/nugets_pack_spec.rb +231 -0
  57. data/spec/nugets_restore_spec.rb +55 -0
  58. data/spec/project_spec.rb +26 -0
  59. data/spec/projectlint/added_but_not_on_filesystem/aproject.csproj +29 -0
  60. data/spec/projectlint/correct/File.cs +1 -0
  61. data/spec/projectlint/correct/Image.txt +1 -0
  62. data/spec/projectlint/correct/MyHeavy.heavy +1 -0
  63. data/spec/projectlint/correct/Schema.xsd +1 -0
  64. data/spec/projectlint/correct/SubFolder/AnotherFile.cs +1 -0
  65. data/spec/projectlint/correct/aproject.csproj +29 -0
  66. data/spec/projectlint/on_filesystem_but_not_added/File.cs +1 -0
  67. data/spec/projectlint/on_filesystem_but_not_added/Image.txt +1 -0
  68. data/spec/projectlint/on_filesystem_but_not_added/aproject.csproj +11 -0
  69. data/spec/projectlint_spec.rb +77 -0
  70. data/spec/smoke_spec.rb +55 -0
  71. data/spec/spec_helper.rb +19 -20
  72. data/spec/support/Nuget/NuGet.exe +0 -0
  73. data/spec/support/echo/FSharp.Core.dll +0 -0
  74. data/spec/support/echo/FSharp.Core.xml +10517 -0
  75. data/spec/support/echo/echo.XML +12 -0
  76. data/spec/support/echo/echo.exe +0 -0
  77. data/spec/support/echo/echo.exe.config +17 -0
  78. data/spec/support/echo/echo.pdb +0 -0
  79. data/spec/support/returnstatus/FSharp.Core.dll +0 -0
  80. data/spec/support/returnstatus/FSharp.Core.xml +10517 -0
  81. data/spec/support/returnstatus/returnstatus.XML +12 -0
  82. data/spec/support/returnstatus/returnstatus.exe +0 -0
  83. data/spec/support/returnstatus/returnstatus.exe.config +17 -0
  84. data/spec/support/returnstatus/returnstatus.pdb +0 -0
  85. data/spec/support/sh_interceptor.rb +83 -0
  86. data/spec/testdata/.gitignore +5 -0
  87. data/spec/testdata/DebugProject/.gitignore +1 -0
  88. data/spec/testdata/DebugProject/Degbu.fsproj +57 -0
  89. data/spec/testdata/DebugProject/Degbu.sln +20 -0
  90. data/spec/testdata/DebugProject/Gemfile +1 -0
  91. data/spec/testdata/DebugProject/Library1.fs +4 -0
  92. data/spec/testdata/DebugProject/Rakefile +22 -0
  93. data/spec/testdata/EmptyProject/EmptyProject.csproj +39 -0
  94. data/spec/{assemblyinfo → testdata/EmptyProject/Properties}/AssemblyInfo.cs +5 -5
  95. data/spec/testdata/Gemfile +1 -0
  96. data/spec/testdata/NuGet.exe +0 -0
  97. data/spec/testdata/Project/Library1.fs +4 -0
  98. data/spec/testdata/Project/Project.fsproj +52 -0
  99. data/spec/testdata/Project/Project.sln +20 -0
  100. data/spec/testdata/Project/packages.config +6 -0
  101. data/spec/testdata/Rakefile +22 -0
  102. data/spec/testdata/TestingDependencies/Sample.Commands/Library.fs +6 -0
  103. data/spec/testdata/TestingDependencies/Sample.Commands/Sample.Commands.fsproj +78 -0
  104. data/spec/testdata/TestingDependencies/Sample.Commands/Script.fsx +8 -0
  105. data/spec/testdata/TestingDependencies/Sample.Commands/packages.config +6 -0
  106. data/spec/testdata/TestingDependencies/Sample.Core/Library.fs +3 -0
  107. data/spec/testdata/TestingDependencies/Sample.Core/Sample.Core.fsproj +59 -0
  108. data/spec/testdata/TestingDependencies/Sample.Core/Script.fsx +8 -0
  109. data/spec/testdata/TestingDependencies/Sample.Core/packages.config +4 -0
  110. data/spec/testdata/TestingDependencies/Sample.sln +26 -0
  111. data/spec/testdata/TestingDependencies/vendor/FSharp.Core.dll +0 -0
  112. data/spec/testdata/TestingDependencies/vendor/FSharp.Core.optdata +0 -0
  113. data/spec/testdata/TestingDependencies/vendor/FSharp.Core.sigdata +0 -0
  114. data/spec/testdata/TestingDependencies/vendor/FSharp.Core.xml +8748 -0
  115. data/spec/testdata/example.nuspec +14 -0
  116. data/spec/testdata/example.symbols.nuspec +21 -0
  117. data/spec/tools/fluent_migrator_spec.rb +80 -0
  118. metadata +303 -212
  119. data/.bundle/config +0 -2
  120. data/.rspec +0 -2
  121. data/CONTRIBUTING.md +0 -87
  122. data/LICENSE +0 -21
  123. data/lib/albacore/albacoretask.rb +0 -50
  124. data/lib/albacore/aspnetcompiler.rb +0 -80
  125. data/lib/albacore/assemblyinfo.rb +0 -163
  126. data/lib/albacore/assemblyinfolanguages/assemblyinfoengine.rb +0 -54
  127. data/lib/albacore/assemblyinfolanguages/cppcliengine.rb +0 -18
  128. data/lib/albacore/assemblyinfolanguages/csharpengine.rb +0 -15
  129. data/lib/albacore/assemblyinfolanguages/fsharpengine.rb +0 -23
  130. data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +0 -15
  131. data/lib/albacore/config/aspnetcompilerconfig.rb +0 -30
  132. data/lib/albacore/config/assemblyinfoconfig.rb +0 -18
  133. data/lib/albacore/config/config.rb +0 -22
  134. data/lib/albacore/config/cscconfig.rb +0 -28
  135. data/lib/albacore/config/docuconfig.rb +0 -19
  136. data/lib/albacore/config/execconfig.rb +0 -19
  137. data/lib/albacore/config/fluentmigratorconfig.rb +0 -19
  138. data/lib/albacore/config/ilmergeconfig.rb +0 -19
  139. data/lib/albacore/config/msbuildconfig.rb +0 -29
  140. data/lib/albacore/config/mspecconfig.rb +0 -19
  141. data/lib/albacore/config/mstestconfig.rb +0 -19
  142. data/lib/albacore/config/nantconfig.rb +0 -18
  143. data/lib/albacore/config/nchurnconfig.rb +0 -19
  144. data/lib/albacore/config/ncoverconsoleconfig.rb +0 -19
  145. data/lib/albacore/config/ncoverreportconfig.rb +0 -18
  146. data/lib/albacore/config/ndependconfig.rb +0 -19
  147. data/lib/albacore/config/netversion.rb +0 -28
  148. data/lib/albacore/config/nugetinstallconfig.rb +0 -18
  149. data/lib/albacore/config/nugetpackconfig.rb +0 -18
  150. data/lib/albacore/config/nugetpushconfig.rb +0 -18
  151. data/lib/albacore/config/nugetupdateconfig.rb +0 -18
  152. data/lib/albacore/config/nunitconfig.rb +0 -19
  153. data/lib/albacore/config/nuspecconfig.rb +0 -18
  154. data/lib/albacore/config/plinkconfig.rb +0 -18
  155. data/lib/albacore/config/specflowconfig.rb +0 -18
  156. data/lib/albacore/config/sqlcmdconfig.rb +0 -18
  157. data/lib/albacore/config/unzipconfig.rb +0 -19
  158. data/lib/albacore/config/xbuildconfig.rb +0 -18
  159. data/lib/albacore/config/xunitconfig.rb +0 -18
  160. data/lib/albacore/config/zipdirectoryconfig.rb +0 -18
  161. data/lib/albacore/csc.rb +0 -77
  162. data/lib/albacore/docu.rb +0 -38
  163. data/lib/albacore/exec.rb +0 -20
  164. data/lib/albacore/fluentmigrator.rb +0 -69
  165. data/lib/albacore/ilmerge.rb +0 -38
  166. data/lib/albacore/msbuild.rb +0 -55
  167. data/lib/albacore/mspec.rb +0 -39
  168. data/lib/albacore/mstest.rb +0 -47
  169. data/lib/albacore/nant.rb +0 -41
  170. data/lib/albacore/nchurn.rb +0 -49
  171. data/lib/albacore/ncoverconsole.rb +0 -56
  172. data/lib/albacore/ncoverreport.rb +0 -40
  173. data/lib/albacore/ncoverreports.rb +0 -16
  174. data/lib/albacore/ncoverreports/assemblyfilter.rb +0 -10
  175. data/lib/albacore/ncoverreports/branchcoverage.rb +0 -10
  176. data/lib/albacore/ncoverreports/classfilter.rb +0 -9
  177. data/lib/albacore/ncoverreports/codecoveragebase.rb +0 -27
  178. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +0 -23
  179. data/lib/albacore/ncoverreports/documentfilter.rb +0 -9
  180. data/lib/albacore/ncoverreports/fullcoveragereport.rb +0 -9
  181. data/lib/albacore/ncoverreports/methodcoverage.rb +0 -10
  182. data/lib/albacore/ncoverreports/methodfilter.rb +0 -9
  183. data/lib/albacore/ncoverreports/namespacefilter.rb +0 -9
  184. data/lib/albacore/ncoverreports/reportbase.rb +0 -23
  185. data/lib/albacore/ncoverreports/reportfilterbase.rb +0 -29
  186. data/lib/albacore/ncoverreports/summaryreport.rb +0 -9
  187. data/lib/albacore/ncoverreports/symbolcoverage.rb +0 -9
  188. data/lib/albacore/ndepend.rb +0 -33
  189. data/lib/albacore/nugetinstall.rb +0 -62
  190. data/lib/albacore/nugetpack.rb +0 -50
  191. data/lib/albacore/nugetpush.rb +0 -40
  192. data/lib/albacore/nugetupdate.rb +0 -50
  193. data/lib/albacore/nunit.rb +0 -46
  194. data/lib/albacore/nuspec.rb +0 -180
  195. data/lib/albacore/output.rb +0 -105
  196. data/lib/albacore/plink.rb +0 -50
  197. data/lib/albacore/specflow.rb +0 -30
  198. data/lib/albacore/sqlcmd.rb +0 -67
  199. data/lib/albacore/support/attrmethods.rb +0 -33
  200. data/lib/albacore/support/createtask.rb +0 -50
  201. data/lib/albacore/support/failure.rb +0 -15
  202. data/lib/albacore/support/logging.rb +0 -38
  203. data/lib/albacore/support/openstruct.rb +0 -13
  204. data/lib/albacore/support/platform.rb +0 -25
  205. data/lib/albacore/support/runcommand.rb +0 -45
  206. data/lib/albacore/support/updateattributes.rb +0 -13
  207. data/lib/albacore/support/yamlconfig.rb +0 -18
  208. data/lib/albacore/unzip.rb +0 -42
  209. data/lib/albacore/xbuild.rb +0 -41
  210. data/lib/albacore/xunit.rb +0 -44
  211. data/lib/albacore/zipdirectory.rb +0 -106
  212. data/spec/albacoremodel_spec.rb +0 -52
  213. data/spec/aspnetcompiler_spec.rb +0 -84
  214. data/spec/assemblyinfo_spec.rb +0 -209
  215. data/spec/attrmethods_spec.rb +0 -135
  216. data/spec/config_spec.rb +0 -32
  217. data/spec/createtask_spec.rb +0 -234
  218. data/spec/csc_spec.rb +0 -86
  219. data/spec/docu_spec.rb +0 -31
  220. data/spec/exec_spec.rb +0 -25
  221. data/spec/fluentmigrator_spec.rb +0 -88
  222. data/spec/ilmerge_spec.rb +0 -35
  223. data/spec/msbuild_spec.rb +0 -55
  224. data/spec/mspec_spec.rb +0 -30
  225. data/spec/mstest_spec.rb +0 -35
  226. data/spec/nant_spec.rb +0 -40
  227. data/spec/nchurn_spec.rb +0 -80
  228. data/spec/ncoverconsole_spec.rb +0 -80
  229. data/spec/ncoverreport_spec.rb +0 -139
  230. data/spec/ndepend_spec.rb +0 -26
  231. data/spec/netversion_spec.rb +0 -51
  232. data/spec/nugetinstall_spec.rb +0 -59
  233. data/spec/nugetpack_spec.rb +0 -49
  234. data/spec/nugetpush_spec.rb +0 -39
  235. data/spec/nugetupdate_spec.rb +0 -49
  236. data/spec/nunit_spec.rb +0 -35
  237. data/spec/nuspec/nuspec.xsd +0 -84
  238. data/spec/nuspec_spec.rb +0 -74
  239. data/spec/output/bar/bar.txt +0 -0
  240. data/spec/output/baz.txt +0 -0
  241. data/spec/output/erb.txt +0 -1
  242. data/spec/output/foo/foo/foo.txt +0 -0
  243. data/spec/output_spec.rb +0 -85
  244. data/spec/patch/system_patch.rb +0 -12
  245. data/spec/platform_spec.rb +0 -15
  246. data/spec/plink_spec.rb +0 -56
  247. data/spec/runcommand_spec.rb +0 -92
  248. data/spec/specflow_spec.rb +0 -30
  249. data/spec/sqlcmd_spec.rb +0 -66
  250. data/spec/unzip_spec.rb +0 -56
  251. data/spec/xbuild_spec.rb +0 -40
  252. data/spec/xunit_spec.rb +0 -30
  253. data/spec/yaml/test.yml +0 -3
  254. data/spec/yamlconfig_spec.rb +0 -53
  255. data/spec/zip/baz.txt +0 -0
  256. data/spec/zip/foo/bar/bar.txt +0 -0
  257. data/spec/zip/foo/foo.txt +0 -0
  258. data/spec/zip_spec.rb +0 -97
@@ -1,38 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/ilmergeconfig"
3
-
4
- class ILMerge
5
- TaskName = :ilmerge
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::ILMerge
10
-
11
- attr_accessor :out,
12
- :target_platform
13
-
14
- attr_array :assemblies
15
-
16
- def initialize
17
- @command = "ilmerge"
18
-
19
- super()
20
- update_attributes(ilmerge.to_hash)
21
- end
22
-
23
- def execute
24
- raise "ilmerge requires #out" unless @out
25
- raise "ilmerge requires #assemblies" unless @assemblies
26
-
27
- result = run_command("ILMerge", build_parameters)
28
- fail_with_message("ILMerge failed, see the build log for more details.") unless result
29
- end
30
-
31
- def build_parameters
32
- p = []
33
- p << "/out:\"#{@out}\""
34
- p << "/targetPlatform:#{@target_platform}" if @target_platform
35
- p << @assemblies.map { |asm| "\"#{asm}\"" } if @assemblies
36
- p
37
- end
38
- end
@@ -1,55 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/msbuildconfig"
3
-
4
- class MSBuild
5
- TaskName = :msbuild
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::MSBuild
10
-
11
- attr_reader :no_logo
12
-
13
- attr_accessor :solution,
14
- :verbosity,
15
- # 'logger' property already exists in parent
16
- :logger_module
17
-
18
- attr_array :targets
19
-
20
- attr_hash :properties,
21
- :other_switches
22
-
23
- def initialize
24
- @command = "msbuild"
25
-
26
- super()
27
- update_attributes(msbuild.to_hash)
28
- end
29
-
30
- def execute
31
- unless @solution
32
- fail_with_message("msbuild requires #solution")
33
- return
34
- end
35
-
36
- result = run_command("MSBuild", build_parameters)
37
- fail_with_message("MSBuild failed, see the build log for more details.") unless result
38
- end
39
-
40
- def build_parameters()
41
- p = []
42
- p << "\"#{@solution}\""
43
- p << "/verbosity:#{@verbosity}" if @verbosity
44
- p << "/logger:\"#{@logger_module}\"" if @logger_module
45
- p << "/nologo" if @no_logo
46
- p << @properties.map { |key, value| "/property:#{key}\=\"#{value}\"" } if @properties
47
- p << @other_switches.map { |key, value| "/#{key}:\"#{value}\"" } if @other_switches
48
- p << "/target:\"#{@targets.join(";")}\"" if @targets
49
- p
50
- end
51
-
52
- def no_logo
53
- @no_logo = true
54
- end
55
- end
@@ -1,39 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/mspecconfig"
3
-
4
- class MSpec
5
- TaskName = :mspec
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::MSpec
10
-
11
- attr_array :assemblies
12
-
13
- attr_hash :results_path
14
-
15
- def initialize()
16
- super()
17
- update_attributes(mspec.to_hash)
18
- end
19
-
20
- def execute()
21
- result = run_command("MSpec", build_parameters)
22
- fail_with_message("MSpec failed, see the build log for more details.") unless result
23
- end
24
-
25
- def build_parameters
26
- p = []
27
- p << @assemblies.map { |asm| "\"#{asm}\"" } if @assemblies
28
- p << "--#{@results_path.first.first} \"#{@results_path.first.last}\"" if @results_path
29
- p
30
- end
31
-
32
- def build_command_line
33
- c = []
34
- c << @command
35
- c << build_parameters
36
- c << @parameters
37
- c
38
- end
39
- end
@@ -1,47 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/mstestconfig"
3
-
4
- class MSTest
5
- TaskName = :mstest
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::MSTest
10
-
11
- attr_reader :no_logo
12
-
13
- attr_array :assemblies,
14
- :tests
15
-
16
- def initialize()
17
- @command = "mstest"
18
-
19
- super()
20
- update_attributes(mstest.to_hash)
21
- end
22
-
23
- def execute()
24
- result = run_command("MSTest", build_parameters)
25
- fail_with_message("MSTest failed, see the build log for more details.") unless result
26
- end
27
-
28
- def build_parameters
29
- p = []
30
- p << @assemblies.map { |asm| "/testcontainer:\"#{asm}\"" } if @assemblies
31
- p << @tests.map { |test| "/test:#{test}"} if @tests
32
- p << "/nologo" if @no_logo
33
- p
34
- end
35
-
36
- def build_command_line
37
- c = []
38
- c << @command
39
- c << build_parameters
40
- c << @parameters
41
- c
42
- end
43
-
44
- def no_logo
45
- @no_logo = true
46
- end
47
- end
@@ -1,41 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/nantconfig"
3
-
4
- class NAnt
5
- TaskName = :nant
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::NAnt
10
-
11
- attr_reader :no_logo
12
-
13
- attr_accessor :build_file
14
-
15
- attr_array :targets
16
-
17
- attr_hash :properties
18
-
19
- def initialize
20
- super()
21
- update_attributes(nant.to_hash)
22
- end
23
-
24
- def execute
25
- result = run_command("NAnt", build_parameters)
26
- fail_with_message("NAnt failed, see the build log for more details.") unless result
27
- end
28
-
29
- def build_parameters
30
- p = []
31
- p << "-buildfile:\"#{@build_file}\"" if @build_file
32
- p << @properties.map { |key, value| "-D:#{key}=\"#{value}\"" } if @properties
33
- p << @targets if @targets
34
- p << "-nologo" if @no_logo
35
- p
36
- end
37
-
38
- def no_logo
39
- @no_logo = true
40
- end
41
- end
@@ -1,49 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/nchurnconfig"
3
-
4
- class NChurn
5
- TaskName = :nchurn
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::NChurn
10
-
11
- attr_accessor :from,
12
- :churn,
13
- :churn_percent,
14
- :top,
15
- :report_as,
16
- :adapter,
17
- :exclude,
18
- :include,
19
- :input,
20
- :output
21
-
22
- attr_array :env_paths
23
-
24
- def initialize
25
- super()
26
- update_attributes(nchurn.to_hash)
27
- end
28
-
29
- def execute
30
- result = run_command("NChurn", build_parameters)
31
- fail_with_message("NChurn failed, see the build log for more details.") unless result
32
- end
33
-
34
- def build_parameters
35
- p = []
36
- p << "-d \"#{@from.strftime("%d-%m-%Y")}\"" if @from
37
- p << "-i \"#{@input}\"" if @input
38
- p << "-c #{@churn_percent / 100.0}" if @churn_percent
39
- p << "-c #{@churn}" if @churn
40
- p << "-t #{@top}" if @top
41
- p << "-r #{@report_as}" if @report_as
42
- p << "-p \"#{@env_paths.join(";")}\"" if @env_paths
43
- p << "-a #{@adapter}" if @adapter
44
- p << "-x \"#{@exclude}\"" if @exclude
45
- p << "-n \"#{@include}\"" if @include
46
- p << "> \"#{@output}\"" if @output
47
- p
48
- end
49
- end
@@ -1,56 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/config/ncoverconsoleconfig"
3
-
4
- class NCoverConsole
5
- TaskName = :ncoverconsole
6
-
7
- include Albacore::Task
8
- include Albacore::RunCommand
9
- include Configuration::NCoverConsole
10
-
11
- attr_reader :register
12
-
13
- attr_accessor :test_runner
14
-
15
- attr_array :include_assemblies,
16
- :exclude_assemblies,
17
- :include_attributes,
18
- :exclude_attributes,
19
- :coverage
20
-
21
- attr_hash :output
22
-
23
- def initialize
24
- @register = true
25
-
26
- super()
27
- update_attributes(ncoverconsole.to_hash)
28
- end
29
-
30
- def execute
31
- unless @test_runner
32
- fail_with_message("ncoverconsole requires #test_runner")
33
- return
34
- end
35
-
36
- result = run_command("ncoverconsole", build_parameters)
37
- fail_with_message("NCover Console failed, see the build log for more details.") unless result
38
- end
39
-
40
- def build_parameters
41
- p = []
42
- p << "//reg" if @register
43
- p << @output.map { |key, value| "//#{key} \"#{value}\"" } if @output
44
- p << "//include-assemblies \"#{@include_assemblies.join(";")}\"" if @include_assemblies
45
- p << "//exclude-assemblies \"#{@exclude_assemblies.join(";")}\"" if @exclude_assemblies
46
- p << "//include-attributes \"#{@include_attributes.join(";")}\"" if @include_attributes
47
- p << "//exclude-attributes \"#{@exclude_attributes.join(";")}\"" if @exclude_attributes
48
- p << "//coverage-type \"#{@coverage.join(", ")}\"" if @coverage
49
- p << @test_runner.build_command_line
50
- p
51
- end
52
-
53
- def no_registration
54
- @register = false
55
- end
56
- end
@@ -1,40 +0,0 @@
1
- require "albacore/albacoretask"
2
- require "albacore/ncoverreports"
3
- require "albacore/config/ncoverreportconfig"
4
-
5
- class NCoverReport
6
- TaskName = :ncoverreport
7
-
8
- include Albacore::Task
9
- include Albacore::RunCommand
10
- include Configuration::NCoverReport
11
-
12
- attr_array :coverage_files,
13
- :reports,
14
- :required_coverage,
15
- :filters
16
-
17
- def initialize
18
- super()
19
- update_attributes(ncoverreport.to_hash)
20
- end
21
-
22
- def execute
23
- unless @command
24
- fail_with_message("ncoverreport requires #command")
25
- return
26
- end
27
-
28
- result = run_command("ncoverreport", build_parameters)
29
- fail_with_message("NCover Report failed, see the build log for more details.") unless result
30
- end
31
-
32
- def build_parameters
33
- p = []
34
- p << @coverage_files.map { |file| "\"#{file}\"" } if @coverage_files
35
- p << @reports.map { |report| "//or #{report.get_report_options}" } if @reports
36
- p << @required_coverage.map { |coverage| "//mc #{coverage.get_coverage_options}" } if @required_coverage
37
- p << @filters.map { |filter| "//cf #{filter.get_filter_options}" } if @filters
38
- p
39
- end
40
- end
@@ -1,16 +0,0 @@
1
- require "albacore/ncoverreports/reportbase"
2
- require "albacore/ncoverreports/fullcoveragereport"
3
- require "albacore/ncoverreports/summaryreport"
4
-
5
- require "albacore/ncoverreports/codecoveragebase"
6
- require "albacore/ncoverreports/branchcoverage"
7
- require "albacore/ncoverreports/methodcoverage"
8
- require "albacore/ncoverreports/symbolcoverage"
9
- require "albacore/ncoverreports/cyclomaticcomplexity"
10
-
11
- require "albacore/ncoverreports/reportfilterbase"
12
- require "albacore/ncoverreports/assemblyfilter"
13
- require "albacore/ncoverreports/classfilter"
14
- require "albacore/ncoverreports/documentfilter"
15
- require "albacore/ncoverreports/methodfilter"
16
- require "albacore/ncoverreports/namespacefilter"
@@ -1,10 +0,0 @@
1
- require 'albacore/ncoverreports/reportfilterbase'
2
-
3
- module NCover
4
- class AssemblyFilter < NCover::ReportFilterBase
5
- def initialize(params={})
6
- super("Assembly", params)
7
- end
8
- end
9
- end
10
-
@@ -1,10 +0,0 @@
1
- require 'albacore/ncoverreports/codecoveragebase'
2
-
3
- module NCover
4
- class BranchCoverage < NCover::CodeCoverageBase
5
- def initialize(params={})
6
- super("BranchCoverage", params)
7
- end
8
- end
9
- end
10
-
@@ -1,9 +0,0 @@
1
- require 'albacore/ncoverreports/reportfilterbase'
2
-
3
- module NCover
4
- class ClassFilter < NCover::ReportFilterBase
5
- def initialize(params={})
6
- super("Class", params)
7
- end
8
- end
9
- end
@@ -1,27 +0,0 @@
1
- require 'albacore/support/updateattributes'
2
-
3
- module NCover
4
- class CodeCoverageBase
5
- include UpdateAttributes
6
-
7
- attr_accessor :coverage_type,
8
- :minimum,
9
- :item_type
10
-
11
- def initialize(coverage_type, params={})
12
- @coverage_type = coverage_type
13
- @minimum = 0
14
- @item_type = :View
15
- update_attributes(params) if params
16
- super()
17
- end
18
-
19
- def get_coverage_options
20
- o = "#{@coverage_type}"
21
- o << ":#{@minimum}" if @minimum
22
- o << ":#{@item_type}" if @item_type
23
- o
24
- end
25
- end
26
- end
27
-