albacore 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,84 +1,84 @@
1
- # Welcome to the Albacore project.
2
-
3
- Albacore is intended to be a professional quality suite of Rake tasks to help automate the process of building a .NET based system. All tasks are built using a test-first approach through rspec, and all tests are included in the Albacore gem.
4
-
5
- ## How To Install Albacore From Gemcutter Gems:
6
-
7
- If you would like to install the current, stable release of Albacore, you can do so easily through the Gemcutter gem server. Follow these simple instructions and you will be good to go.
8
-
9
- **Step 1:** Setup Gemcutter as a gem source
10
-
11
- > gem source -a http://gemcutter.org
12
-
13
- (note: you only need to do this once for any given computer that is going to install gems from gemcutter.)
14
-
15
- **Step 2:** Install the Albacore gem
16
-
17
- > gem install albacore
18
-
19
- (note: as of v0.0.7, the "albacore" gem is spelled with a lowercase "a".)
20
-
21
- ## How To Manually Build And Install The Albacore Gem
22
-
23
- If you would like to install the latest source code for Albacore, and get all the new features and functionality (possibly in an unstable form), you can manually build and install the Albacore gem. Follow these simple instructions and you will be good to go.
24
-
25
- **Step 1:** Clone Albacore
26
-
27
- Use your Github account to fork Albacore, or clone it directly from my public clone URL.
28
-
29
- > git clone git://github.com/derickbailey/Albacore.git Albacore
30
-
31
- **Step 2:** Build the gem
32
-
33
- In your local clone of Albacore, use the jeweler rake tasks to build the latest version of the Albacore code into a gem.
34
-
35
- > rake jeweler:gemspec
36
- >
37
- > rake jeweler:build
38
-
39
- this will produce an 'albacore-#.#.#.gem' file in the 'pkg' folder, where '#.#.#' is the version number. For example 'albacore-0.0.7.gem'.
40
-
41
- **Step 3:** Install the gem
42
-
43
- After building the gem, you can install it from your local file system.
44
-
45
- > gem install -l pkg/albacore-#.#.#.gem
46
-
47
- where '#.#.#' is the version number of the gem. For example 'albacore-0.0.7.gem'
48
-
49
- ## How To Use Albacore
50
-
51
- After installing Albacore, you only need to
52
-
53
- require 'albacore'
54
-
55
- in your rakefile. This will allow you to use the tasks that Albacore includes.
56
-
57
- desc "Run a sample build using the MSBuildTask"
58
- msbuildtask do |msb|
59
- msb.properties = {:configuration => :Debug}
60
- msb.targets [:Clean, :Build]
61
- msb.solution = "spec/support/TestSolution/TestSolution.sln"
62
- end
63
-
64
- Beyond the simple example, check out the [Albacore Wiki](http://wiki.github.com/derickbailey/Albacore) for detailed instructions on how to use the built in tasks and their options.
65
-
66
- ## How To Contribute, Collaborate, Communicate
67
-
68
- If you'd like to get involved with the Albacore framework, we have a discussion group over at google: **[AlbacoreDev](http://groups.google.com/group/albacoredev)**
69
-
70
- Anyone can fork the main repository and submit patches, as well. And lastly, the [wiki](http://wiki.github.com/derickbailey/Albacore) and [issues list](http://github.com/derickbailey/Albacore/issues) are also open for additions, edits, and discussion.
71
-
72
- ## Contributors
73
-
74
- Many thanks for contributions to Albacore are due (in alphabetical order):
75
-
76
- * [Andreone](http://github.com/Andreone): Significant Wiki contributions, questions and contributions on the google group
77
- * [Ben Hall](http://github.com/benhall): Primary contributor. SSH, SFTP, ZipDirectory, Rename, YAML auto config, Wiki pages, and many other great additions
78
- * [Brian Donahue](http://github.com/briandonahue): Inspiration and initial code for the ExpandTemplates task
79
- * [Hibri Marzook](http://github.com/hibri): the PLink and NDepend tasks
80
- * [James Gregory](http://github.com/jagregory): the Docu task
81
- * [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
82
- * [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
83
- * [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
84
- * [Steven Harman](http://github.com/stevenharman): Finding some wicked bugs, patching nunit test runner, and the nant task
1
+ # Welcome to the Albacore project.
2
+
3
+ Albacore is intended to be a professional quality suite of Rake tasks to help automate the process of building a .NET based system. All tasks are built using a test-first approach through rspec, and all tests are included in the Albacore gem.
4
+
5
+ ## How To Install Albacore From Gemcutter Gems:
6
+
7
+ If you would like to install the current, stable release of Albacore, you can do so easily through the Gemcutter gem server. Follow these simple instructions and you will be good to go.
8
+
9
+ **Step 1:** Setup Gemcutter as a gem source
10
+
11
+ > gem source -a http://gemcutter.org
12
+
13
+ (note: you only need to do this once for any given computer that is going to install gems from gemcutter.)
14
+
15
+ **Step 2:** Install the Albacore gem
16
+
17
+ > gem install albacore
18
+
19
+ (note: as of v0.0.7, the "albacore" gem is spelled with a lowercase "a".)
20
+
21
+ ## How To Manually Build And Install The Albacore Gem
22
+
23
+ If you would like to install the latest source code for Albacore, and get all the new features and functionality (possibly in an unstable form), you can manually build and install the Albacore gem. Follow these simple instructions and you will be good to go.
24
+
25
+ **Step 1:** Clone Albacore
26
+
27
+ Use your Github account to fork Albacore, or clone it directly from my public clone URL.
28
+
29
+ > git clone git://github.com/derickbailey/Albacore.git Albacore
30
+
31
+ **Step 2:** Build the gem
32
+
33
+ In your local clone of Albacore, use the jeweler rake tasks to build the latest version of the Albacore code into a gem.
34
+
35
+ > rake jeweler:gemspec
36
+ >
37
+ > rake jeweler:build
38
+
39
+ this will produce an 'albacore-#.#.#.gem' file in the 'pkg' folder, where '#.#.#' is the version number. For example 'albacore-0.0.7.gem'.
40
+
41
+ **Step 3:** Install the gem
42
+
43
+ After building the gem, you can install it from your local file system.
44
+
45
+ > gem install -l pkg/albacore-#.#.#.gem
46
+
47
+ where '#.#.#' is the version number of the gem. For example 'albacore-0.0.7.gem'
48
+
49
+ ## How To Use Albacore
50
+
51
+ After installing Albacore, you only need to
52
+
53
+ require 'albacore'
54
+
55
+ in your rakefile. This will allow you to use the tasks that Albacore includes.
56
+
57
+ desc "Run a sample build using the MSBuildTask"
58
+ msbuildtask do |msb|
59
+ msb.properties = {:configuration => :Debug}
60
+ msb.targets [:Clean, :Build]
61
+ msb.solution = "spec/support/TestSolution/TestSolution.sln"
62
+ end
63
+
64
+ Beyond the simple example, check out the [Albacore Wiki](http://wiki.github.com/derickbailey/Albacore) for detailed instructions on how to use the built in tasks and their options.
65
+
66
+ ## How To Contribute, Collaborate, Communicate
67
+
68
+ If you'd like to get involved with the Albacore framework, we have a discussion group over at google: **[AlbacoreDev](http://groups.google.com/group/albacoredev)**
69
+
70
+ Anyone can fork the main repository and submit patches, as well. And lastly, the [wiki](http://wiki.github.com/derickbailey/Albacore) and [issues list](http://github.com/derickbailey/Albacore/issues) are also open for additions, edits, and discussion.
71
+
72
+ ## Contributors
73
+
74
+ Many thanks for contributions to Albacore are due (in alphabetical order):
75
+
76
+ * [Andreone](http://github.com/Andreone): Significant Wiki contributions, questions and contributions on the google group
77
+ * [Ben Hall](http://github.com/benhall): Primary contributor. SSH, SFTP, ZipDirectory, Rename, YAML auto config, Wiki pages, and many other great additions
78
+ * [Brian Donahue](http://github.com/briandonahue): Inspiration and initial code for the ExpandTemplates task
79
+ * [Hibri Marzook](http://github.com/hibri): the PLink and NDepend tasks
80
+ * [James Gregory](http://github.com/jagregory): the Docu task
81
+ * [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
82
+ * [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
83
+ * [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
84
+ * [Steven Harman](http://github.com/stevenharman): Finding some wicked bugs, patching nunit test runner, and the nant task
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,13 +1,10 @@
1
1
  require 'albacore/support/albacore_helper'
2
2
 
3
3
  class Exec
4
- extend AttrMethods
5
4
  include RunCommand
6
5
  include YAMLConfig
7
6
  include Logging
8
7
 
9
- attr_array :parameters
10
-
11
8
  def initialize
12
9
  @path_to_command=''
13
10
  @parameters = []
@@ -1,61 +1,61 @@
1
- require 'albacore/support/albacore_helper'
2
-
3
- class MSBuild
4
- extend AttrMethods
5
- include RunCommand
6
- include YAMLConfig
7
- include Logging
8
-
9
- attr_accessor :solution, :verbosity
10
- attr_array :targets
11
- attr_hash :properties
12
-
13
- def initialize
14
- @path_to_command = build_path_to_command
15
- super()
16
- end
17
-
18
- def build_path_to_command
19
- win_dir = ENV['windir'] || ENV['WINDIR']
20
- win_dir = 'C:/Windows' if win_dir.nil?
21
-
22
- File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
23
- end
24
-
25
- def build
26
- build_solution(@solution)
27
- end
28
-
29
- def build_solution(solution)
30
- check_solution solution
31
-
32
- command_parameters = []
33
- command_parameters << "\"#{solution}\""
34
- command_parameters << "\"/verbosity:#{@verbosity}\"" if @verbosity != nil
35
- command_parameters << build_properties if @properties != nil
36
- command_parameters << "\"/target:#{build_targets}\"" if @targets != nil
37
-
38
- result = run_command "MSBuild", command_parameters.join(" ")
39
-
40
- failure_message = 'MSBuild Failed. See Build Log For Detail'
41
- fail_with_message failure_message if !result
42
- end
43
-
44
- def check_solution(file)
45
- return if file
46
- msg = 'solution cannot be nil'
47
- fail_with_message msg
48
- end
49
-
50
- def build_targets
51
- @targets.join ";"
52
- end
53
-
54
- def build_properties
55
- option_text = []
56
- @properties.each do |key, value|
57
- option_text << "/p:#{key}\=\"#{value}\""
58
- end
59
- option_text.join(" ")
60
- end
61
- end
1
+ require 'albacore/support/albacore_helper'
2
+
3
+ class MSBuild
4
+ extend AttrMethods
5
+ include RunCommand
6
+ include YAMLConfig
7
+ include Logging
8
+
9
+ attr_accessor :solution, :verbosity
10
+ attr_array :targets
11
+ attr_hash :properties
12
+
13
+ def initialize
14
+ @path_to_command = build_path_to_command
15
+ super()
16
+ end
17
+
18
+ def build_path_to_command
19
+ win_dir = ENV['windir'] || ENV['WINDIR']
20
+ win_dir = 'C:/Windows' if win_dir.nil?
21
+
22
+ File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
23
+ end
24
+
25
+ def build
26
+ build_solution(@solution)
27
+ end
28
+
29
+ def build_solution(solution)
30
+ check_solution solution
31
+
32
+ command_parameters = []
33
+ command_parameters << "\"#{solution}\""
34
+ command_parameters << "\"/verbosity:#{@verbosity}\"" if @verbosity != nil
35
+ command_parameters << build_properties if @properties != nil
36
+ command_parameters << "\"/target:#{build_targets}\"" if @targets != nil
37
+
38
+ result = run_command "MSBuild", command_parameters.join(" ")
39
+
40
+ failure_message = 'MSBuild Failed. See Build Log For Detail'
41
+ fail_with_message failure_message if !result
42
+ end
43
+
44
+ def check_solution(file)
45
+ return if file
46
+ msg = 'solution cannot be nil'
47
+ fail_with_message msg
48
+ end
49
+
50
+ def build_targets
51
+ @targets.join ";"
52
+ end
53
+
54
+ def build_properties
55
+ option_text = []
56
+ @properties.each do |key, value|
57
+ option_text << "/p:#{key}\=\"#{value}\""
58
+ end
59
+ option_text.join(" ")
60
+ end
61
+ end
@@ -1,29 +1,26 @@
1
1
  require "albacore/support/albacore_helper"
2
2
  class NDepend
3
+ extend AttrMethods
3
4
  include RunCommand
4
5
  include Logging
5
6
  include YAMLConfig
6
7
 
7
- attr_accessor :path_to_command, :project_file , :parameters
8
+ attr_accessor :path_to_command, :project_file
8
9
  def initialize()
9
10
  super()
10
- @parameters =[]
11
- @require_valid_command = true
12
11
  end
13
12
 
14
13
  def run
15
14
  check_comand
16
15
  return if @failed
17
- result = run_command @path_to_command, create_parameters
16
+ result = run_command @path_to_command, create_parameters.join(" ")
18
17
  failure_message = 'Command Failed. See Build Log For Detail'
19
18
  fail_with_message failure_message if !result
20
19
  end
21
20
 
22
21
  def create_parameters
23
22
  params = []
24
- params << File.expand_path( @project_file)
25
- params << @parameters.join(" ")
26
- @logger.debug "NDependConsole Parameters" + @parameters.join(" ")
23
+ params << File.expand_path(@project_file)
27
24
  return params
28
25
  end
29
26
 
@@ -25,8 +25,8 @@ class NUnitTestRunner
25
25
 
26
26
  def get_command_parameters
27
27
  command_params = []
28
- command_params << @assemblies.join(" ") unless @assemblies.nil?
29
28
  command_params << @options.join(" ") unless @options.nil?
29
+ command_params << @assemblies.join(" ") unless @assemblies.nil?
30
30
  command_params
31
31
  end
32
32
 
@@ -1,13 +1,16 @@
1
1
  require 'albacore/support/failure'
2
2
 
3
3
  module RunCommand
4
+ extend AttrMethods
4
5
  include Failure
5
6
 
6
7
  attr_accessor :path_to_command, :require_valid_command, :command_directory
8
+ attr_array :parameters
7
9
 
8
10
  def initialize
9
11
  @require_valid_command = true
10
12
  @command_directory = Dir.pwd
13
+ @parameters = []
11
14
  super()
12
15
  end
13
16
 
@@ -15,6 +18,8 @@ module RunCommand
15
18
  if @require_valid_command
16
19
  return false unless valid_command_exists
17
20
  end
21
+
22
+ command_parameters = command_parameters + " #{@parameters.join(' ')}"
18
23
 
19
24
  command = "\"#{@path_to_command}\" #{command_parameters}"
20
25
  @logger.debug "Executing #{command_name}: #{command}"
@@ -8,7 +8,7 @@ module Albacore
8
8
  class AssemblyInfoTask < Albacore::AlbacoreTask
9
9
  def execute(name, task_args)
10
10
  @asm = AssemblyInfo.new
11
- @asm.load_config_by_task_name(self.class.to_s.downcase)
11
+ @asm.load_config_by_task_name(name)
12
12
  @block.call(@asm, *task_args) unless @block.nil?
13
13
  @asm.write
14
14
  fail if @asm.failed
@@ -7,8 +7,6 @@ end
7
7
 
8
8
  module Albacore
9
9
  class NDependTask < Albacore::AlbacoreTask
10
- attr_accessor :project_file , :parameters
11
-
12
10
  def execute(name, task_args)
13
11
  cmd = NDepend.new()
14
12
  cmd.load_config_by_task_name(name)
@@ -31,6 +31,34 @@ describe NCoverConsole, "when specifying assemblies to cover" do
31
31
  end
32
32
  end
33
33
 
34
+ describe NCoverConsole, "when specifying assemblies with spaces in the name" do
35
+ before :all do
36
+ @testdata = NCoverConsoleTestData.new
37
+ File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
38
+
39
+ @ncc = NCoverConsole.new()
40
+
41
+ @ncc.extend(SystemPatch)
42
+ @ncc.log_level = :verbose
43
+ @ncc.path_to_command = @testdata.ncoverpath
44
+ @ncc.output :xml => @testdata.xml_coverage_output
45
+ @ncc.working_directory = @testdata.working_directory
46
+ @ncc.cover_assemblies "with spaces/TestSolution"
47
+
48
+ nunit = NUnitTestRunner.new(@testdata.nunitpath)
49
+ nunit.assemblies @testdata.test_assembly_with_spaces
50
+ nunit.options '/noshadow'
51
+
52
+ @ncc.testrunner = nunit
53
+ @ncc.run
54
+ end
55
+
56
+ it "should provide coverage for the specified assemblies" do
57
+ @ncc.system_command.should include("//assemblies \"with spaces/TestSolution\"")
58
+ end
59
+
60
+ end
61
+
34
62
  describe NCoverConsole, "when specifying assemblies to ignore" do
35
63
  before :all do
36
64
  @testdata = NCoverConsoleTestData.new
@@ -208,8 +236,12 @@ describe NCoverConsole, "when producing an xml coverage report with nunit" do
208
236
  @ncc.system_command.should include(@testdata.nunitpath)
209
237
  end
210
238
 
211
- it "should pass the specified arguments to the test runner" do
212
- @ncc.system_command.should include("TestSolution.Tests.dll /noshadow")
239
+ it "should pass the specified assembly to the test runner" do
240
+ @ncc.system_command.should include("TestSolution.Tests.dll")
241
+ end
242
+
243
+ it "should tell nunit to use the noshadow option" do
244
+ @ncc.system_command.should include("/noshadow")
213
245
  end
214
246
 
215
247
  it "should write the coverage data to the specified file" do
@@ -13,7 +13,7 @@ describe "when executing Ndepend console" do
13
13
  before :each do
14
14
  @ndepend = NDepend.new
15
15
  @ndepend.log_device = StringIO.new
16
- @ndepend.project_file = "spec/support/TestSolution/Ndependproject.xml"
16
+ @ndepend.project_file = "spec/support/TestSolution/NDependProject.xml"
17
17
  @ndepend.path_to_command = "spec/support/tools/Ndepend-v2.12/NDepend.Console.exe"
18
18
 
19
19
  @logger = StringIO.new
@@ -42,7 +42,7 @@ describe "when executing Ndepend console" do
42
42
 
43
43
  it "should accept other parameters" do
44
44
  expected_params = "/ViewReport /Silent /Help"
45
- @ndepend.parameters << expected_params
45
+ @ndepend.parameters expected_params
46
46
  @ndepend.run
47
47
  @log_data.should include(expected_params)
48
48
  end
@@ -1,6 +1,7 @@
1
1
  class NCoverConsoleTestData
2
2
  attr_accessor :ncoverpath, :nunitpath, :xml_coverage_output, :html_coverage_output, :working_directory
3
3
  attr_accessor :test_assembly, :failing_test_assembly, :mspecpath, :mspec_html_output, :mspec_test_assembly
4
+ attr_accessor :test_assembly_with_spaces
4
5
 
5
6
  def initialize
6
7
  @ncoverpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NCover-v3.3', 'NCover.Console.exe')
@@ -9,6 +10,7 @@ class NCoverConsoleTestData
9
10
  @html_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'html', 'test-coverage.html')
10
11
  @working_directory = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit')
11
12
  @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
13
+ @test_assembly_with_spaces = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies/with spaces/', 'TestSolution.Tests.dll')
12
14
  @failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
13
15
 
14
16
  @mspecpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'Machine.Specification-v0.2', 'Machine.Specifications.ConsoleRunner.exe')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derick Bailey
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-01-20 00:00:00 -06:00
14
+ date: 2010-02-09 00:00:00 -06:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -213,6 +213,9 @@ files:
213
213
  - spec/support/CodeCoverage/nunit/assemblies/TestSolution.Tests.dll
214
214
  - spec/support/CodeCoverage/nunit/assemblies/TestSolution.dll
215
215
  - spec/support/CodeCoverage/nunit/assemblies/nunit.framework.dll
216
+ - spec/support/CodeCoverage/nunit/assemblies/with spaces/TestSolution.Tests.dll
217
+ - spec/support/CodeCoverage/nunit/assemblies/with spaces/TestSolution.dll
218
+ - spec/support/CodeCoverage/nunit/assemblies/with spaces/nunit.framework.dll
216
219
  - spec/support/CodeCoverage/nunit/failing_assemblies/TestSolution.FailingTests.dll
217
220
  - spec/support/CodeCoverage/nunit/failing_assemblies/nunit.framework.dll
218
221
  - spec/support/CodeCoverage/report/coverage.xml