rake-dotnet 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.markdown +4 -4
- data/Rakefile +1 -1
- data/lib/rake_dotnet.rb +34 -26
- metadata +7 -5
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 0.1.2 / 2009
|
2
|
+
|
3
|
+
* NEW: NCover: Generate the full-coverage report
|
4
|
+
* FIX: NCover: Exclude-assemblies can be an array
|
5
|
+
* CHANGE: NCover: Ignore ISymWrapper assembly by default; seems to be an NCover artefact
|
6
|
+
|
1
7
|
=== 0.1.1 / 2009-05-20
|
2
8
|
|
3
9
|
* NEW: Add FxCop -> TeamCity code-inspections reporting via TeamCity's service-messages feature
|
data/README.markdown
CHANGED
@@ -29,7 +29,7 @@ Rake-dotnet is a bunch of things that aim at doing the work of creating a featur
|
|
29
29
|
|
30
30
|
* Relies on a whole bunch of third-party tools and libraries which are too big to distribute within the gem or host myself. So users need to fetch these before they can get up and running. So think of a way to make this more frictionless...
|
31
31
|
* InstallPad?
|
32
|
-
* Currently, the directories for each tool are created within [{github}/DemoRoot/3rdparty](http://github.com/petemounce/rake-dotnet/tree/master) and there is a readme.txt next-door with URLs to fetch from.
|
32
|
+
* Currently, the directories for each tool are created within [{github}/presentation/DemoRoot/3rdparty](http://github.com/petemounce/rake-dotnet/tree/master) and there is a readme.txt next-door with URLs to fetch from.
|
33
33
|
|
34
34
|
## Conventions:
|
35
35
|
|
@@ -64,7 +64,7 @@ So our source structure looks like:
|
|
64
64
|
{files}
|
65
65
|
/OtherProduct.sln
|
66
66
|
|
67
|
-
Example: [{github}/DemoRoot](http://github.com/petemounce/rake-dotnet/tree/master)
|
67
|
+
Example: [{github}/presentation/DemoRoot](http://github.com/petemounce/rake-dotnet/tree/master)
|
68
68
|
|
69
69
|
## Roadmap:
|
70
70
|
|
@@ -93,9 +93,9 @@ Example: [{github}/DemoRoot](http://github.com/petemounce/rake-dotnet/tree/maste
|
|
93
93
|
|
94
94
|
1. `gem install rake-dotnet` (prepend `sudo` if you're not on Windows - which doesn't seem likely considering the audience ;-) )
|
95
95
|
2. Create a directory to hold 3rdparty dependencies
|
96
|
-
* if you
|
96
|
+
* if you follow the instructions in [{github}/presentation/DemoRoot/3rdparty/readme.txt](http://github.com/petemounce/rake-dotnet/tree/master/) you'll get default paths that rake-dotnet expects
|
97
97
|
* if you mirror the structure as above, you won't need to pass in a value for TOOLS_DIR when calling rake
|
98
|
-
3. Fetch the 3rdparty dependencies listed in [{github}/DemoRoot/3rdparty/readme.txt](http://github.com/petemounce/rake-dotnet/tree/master/
|
98
|
+
3. Fetch the 3rdparty dependencies listed in [{github}/presentation/DemoRoot/3rdparty/readme.txt](http://github.com/petemounce/rake-dotnet/tree/master/)
|
99
99
|
* rake-dotnet uses tools within the paths taken from the default unzip'd location. For example, svn.exe is expected to live within #{TOOLS_DIR}/svn/bin because that's how svn zip files unzip
|
100
100
|
|
101
101
|
## License:
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'hoe'
|
|
5
5
|
require 'Pathname'
|
6
6
|
require 'rake/clean'
|
7
7
|
|
8
|
-
Hoe.new('rake-dotnet', '0.1.
|
8
|
+
Hoe.new('rake-dotnet', '0.1.2') do |p|
|
9
9
|
p.author = 'Peter Mounce'
|
10
10
|
p.description = 'Making a .NET build-automation dev\'s life easier, one angle-bracket at a time'
|
11
11
|
p.email = 'pete@neverrunwithscissors.com'
|
data/lib/rake_dotnet.rb
CHANGED
@@ -527,14 +527,15 @@ end
|
|
527
527
|
|
528
528
|
module Rake
|
529
529
|
class NCoverTask < TaskLib
|
530
|
+
attr_accessor :profile_options, :reporting_options
|
530
531
|
def initialize(params={})
|
531
532
|
@product_name = params[:product_name] || PRODUCT_NAME
|
532
533
|
@bin_dir = params[:bin_dir] || File.join(OUT_DIR, 'bin')
|
533
534
|
@report_dir = params[:report_dir] || File.join(OUT_DIR, 'reports', 'ncover')
|
534
535
|
@deps = params[:deps] || []
|
535
536
|
tool_defaults = {:arch => ENV['PROCESSOR_ARCHITECTURE']}
|
536
|
-
@
|
537
|
-
@
|
537
|
+
@profile_options = tool_defaults.merge(params[:profile_options] || {})
|
538
|
+
@reporting_options = tool_defaults.merge(params[:reporting_options] || {})
|
538
539
|
|
539
540
|
yield self if block_given?
|
540
541
|
define
|
@@ -550,7 +551,7 @@ module Rake
|
|
550
551
|
reports_dir_regex = regexify(@report_dir)
|
551
552
|
rule(/#{reports_dir_regex}\/.*\.coverage\.xml/) do |r|
|
552
553
|
dll_to_execute = r.name.sub(/#{@report_dir}\/(.*)\.coverage\.xml/, "#{@bin_dir}/\\1.dll")
|
553
|
-
nc = NCover.new(@report_dir, dll_to_execute, @
|
554
|
+
nc = NCover.new(@report_dir, dll_to_execute, @profile_options)
|
554
555
|
nc.run
|
555
556
|
end
|
556
557
|
|
@@ -573,8 +574,8 @@ module Rake
|
|
573
574
|
task :ncover_reports => [:ncover_profile] do
|
574
575
|
# ncover lets us use *.coverage.xml to merge together files
|
575
576
|
include = [File.join(@report_dir, '*.coverage.xml')]
|
576
|
-
@
|
577
|
-
ncr = NCoverReporting.new(@report_dir, include, @
|
577
|
+
@reporting_options[:name] = 'merged'
|
578
|
+
ncr = NCoverReporting.new(@report_dir, include, @reporting_options)
|
578
579
|
ncr.run
|
579
580
|
end
|
580
581
|
|
@@ -584,8 +585,6 @@ module Rake
|
|
584
585
|
|
585
586
|
self
|
586
587
|
end
|
587
|
-
|
588
|
-
self
|
589
588
|
end
|
590
589
|
end
|
591
590
|
|
@@ -597,7 +596,8 @@ class NCover
|
|
597
596
|
@dll_to_execute = dll_to_execute
|
598
597
|
ofname = File.split(dll_to_execute)[1].sub(/(\.dll)/, '') + '.coverage.xml'
|
599
598
|
@output_file = File.join(report_dir, ofname)
|
600
|
-
@exclude_assemblies_regex = params[:exclude_assemblies_regex] || '.*Tests.*'
|
599
|
+
@exclude_assemblies_regex = params[:exclude_assemblies_regex] || ['.*Tests.*']
|
600
|
+
@exclude_assemblies_regex.push('ISymWrapper')
|
601
601
|
@build_id = params[:build_id] || RDNVERSION
|
602
602
|
@working_dir = params[:working_dir] || Pathname.new(@dll_to_execute).dirname
|
603
603
|
end
|
@@ -615,12 +615,15 @@ class NCover
|
|
615
615
|
"//w #{@working_dir}"
|
616
616
|
end
|
617
617
|
|
618
|
-
def
|
619
|
-
|
618
|
+
def exclude_assemblies
|
619
|
+
if @exclude_assemblies_regex.instance_of?(Array)
|
620
|
+
return '//eas ' + @exclude_assemblies_regex.join(';')
|
621
|
+
end
|
622
|
+
return '//eas ' + @exclude_assemblies_regex if @exclude_assemblies_regex.instance_of?(String)
|
620
623
|
end
|
621
624
|
|
622
625
|
def cmd
|
623
|
-
"\"#{@exe}\" #{cmdToRun} //x #{@output_file} #{
|
626
|
+
"\"#{@exe}\" #{cmdToRun} //x #{@output_file} #{exclude_assemblies} #{bi} #{working_dir}"
|
624
627
|
end
|
625
628
|
|
626
629
|
def run
|
@@ -639,12 +642,13 @@ class NCoverReporting
|
|
639
642
|
@exe = params[:ncover_reporting_exe] || File.join(TOOLS_DIR, 'ncover', arch, 'ncover.reporting.exe')
|
640
643
|
|
641
644
|
# required
|
642
|
-
@reports = params[:reports] || ['Summary', 'UncoveredCodeSections']
|
645
|
+
@reports = params[:reports] || ['Summary', 'UncoveredCodeSections', 'FullCoverageReport']
|
643
646
|
@output_path = File.join(@report_dir)
|
644
647
|
|
645
648
|
# optional
|
646
649
|
@build_id = params[:build_id] || RDNVERSION
|
647
|
-
@
|
650
|
+
@sort_order = params[:sort] || 'CoveragePercentageAscending'
|
651
|
+
@project_name = params[:project_name] || PRODUCT_NAME
|
648
652
|
end
|
649
653
|
|
650
654
|
def coverage_files
|
@@ -655,7 +659,7 @@ class NCoverReporting
|
|
655
659
|
list
|
656
660
|
end
|
657
661
|
|
658
|
-
def
|
662
|
+
def build_id
|
659
663
|
"//bi #{@build_id.to_s}"
|
660
664
|
end
|
661
665
|
|
@@ -667,16 +671,20 @@ class NCoverReporting
|
|
667
671
|
return cmd
|
668
672
|
end
|
669
673
|
|
670
|
-
def
|
674
|
+
def output_path
|
671
675
|
"//op \"#{@output_path}\""
|
672
676
|
end
|
673
677
|
|
674
|
-
def
|
675
|
-
"//so #{@
|
678
|
+
def sort_order
|
679
|
+
"//so #{@sort_order}"
|
680
|
+
end
|
681
|
+
|
682
|
+
def project_name
|
683
|
+
"//p #{@project_name}" unless @project_name.nil?
|
676
684
|
end
|
677
685
|
|
678
686
|
def cmd
|
679
|
-
"\"#{@exe}\" #{coverage_files} #{
|
687
|
+
"\"#{@exe}\" #{coverage_files} #{build_id} #{output_reports} #{output_path} #{sort_order} #{project_name}"
|
680
688
|
end
|
681
689
|
|
682
690
|
def run
|
@@ -948,18 +956,18 @@ module Rake
|
|
948
956
|
end
|
949
957
|
|
950
958
|
class XUnit
|
951
|
-
attr_accessor :xunit, :
|
959
|
+
attr_accessor :xunit, :test_dll, :reports_dir, :options
|
952
960
|
|
953
|
-
def initialize(
|
961
|
+
def initialize(test_dll, reports_dir, xunit=nil, options={})
|
954
962
|
@xunit = xunit || File.join(TOOLS_DIR, 'xunit', 'xunit.console.exe')
|
955
963
|
@xunit = File.expand_path(@xunit)
|
956
|
-
@
|
964
|
+
@test_dll = File.expand_path(test_dll)
|
957
965
|
@reports_dir = File.expand_path(reports_dir)
|
958
966
|
@options = options
|
959
967
|
end
|
960
968
|
|
961
969
|
def run
|
962
|
-
test_dir = Pathname.new(
|
970
|
+
test_dir = Pathname.new(test_dll).dirname
|
963
971
|
chdir test_dir do
|
964
972
|
puts cmd if VERBOSE
|
965
973
|
sh cmd
|
@@ -967,7 +975,7 @@ class XUnit
|
|
967
975
|
end
|
968
976
|
|
969
977
|
def cmd
|
970
|
-
cmd = "#{exe} #{
|
978
|
+
cmd = "#{exe} #{test_dll} #{html} #{xml} #{nunit} #{wait} #{noshadow} #{teamcity}"
|
971
979
|
end
|
972
980
|
|
973
981
|
def exe
|
@@ -975,11 +983,11 @@ class XUnit
|
|
975
983
|
end
|
976
984
|
|
977
985
|
def suite
|
978
|
-
@
|
986
|
+
@test_dll.match(/.*\/([\w\.]+)\.dll/)[1]
|
979
987
|
end
|
980
988
|
|
981
|
-
def
|
982
|
-
"\"#{@
|
989
|
+
def test_dll
|
990
|
+
"\"#{@test_dll}\""
|
983
991
|
end
|
984
992
|
|
985
993
|
def html
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-dotnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter MouncePeter Mounce
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-02 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.12.2
|
34
34
|
version:
|
35
35
|
description: Making a .NET build-automation dev's life easier, one angle-bracket at a time
|
36
36
|
email: pete@neverrunwithscissors.compete@neverrunwithscissors.com
|
@@ -52,6 +52,8 @@ files:
|
|
52
52
|
- test/test_rake_dotnet.rb
|
53
53
|
has_rdoc: true
|
54
54
|
homepage: http://blog.neverrunwithscissors.com/tag/rake-dotnet
|
55
|
+
licenses: []
|
56
|
+
|
55
57
|
post_install_message:
|
56
58
|
rdoc_options:
|
57
59
|
- --main
|
@@ -73,9 +75,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
75
|
requirements: []
|
74
76
|
|
75
77
|
rubyforge_project: rake-dotnet
|
76
|
-
rubygems_version: 1.3.
|
78
|
+
rubygems_version: 1.3.3
|
77
79
|
signing_key:
|
78
|
-
specification_version:
|
80
|
+
specification_version: 3
|
79
81
|
summary: Build automation for .NET builds
|
80
82
|
test_files:
|
81
83
|
- test/test_rake_dotnet.rb
|