albacore 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/.autotest +4 -4
  2. data/.bundle/config +2 -2
  3. data/.rvmrc +1 -1
  4. data/Gemfile +12 -12
  5. data/README.markdown +92 -68
  6. data/VERSION +1 -1
  7. data/lib/albacore.rb +9 -9
  8. data/lib/albacore/albacoretask.rb +50 -50
  9. data/lib/albacore/aspnetcompiler.rb +58 -58
  10. data/lib/albacore/assemblyinfo.rb +140 -140
  11. data/lib/albacore/assemblyinfolanguages/cppcliengine.rb +17 -0
  12. data/lib/albacore/assemblyinfolanguages/csharpengine.rb +18 -18
  13. data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +18 -18
  14. data/lib/albacore/config/aspnetcompilerconfig.rb +29 -29
  15. data/lib/albacore/config/assemblyinfoconfig.rb +13 -13
  16. data/lib/albacore/config/config.rb +22 -22
  17. data/lib/albacore/config/cscconfig.rb +28 -28
  18. data/lib/albacore/config/docuconfig.rb +23 -23
  19. data/lib/albacore/config/execconfig.rb +15 -15
  20. data/lib/albacore/config/fluentmigratorrunnerconfig.rb +15 -15
  21. data/lib/albacore/config/msbuildconfig.rb +29 -29
  22. data/lib/albacore/config/mspectestrunnerconfig.rb +15 -15
  23. data/lib/albacore/config/mstesttestrunnerconfig.rb +15 -15
  24. data/lib/albacore/config/nantconfig.rb +15 -15
  25. data/lib/albacore/config/nchurnconfig.rb +15 -15
  26. data/lib/albacore/config/ncoverconsoleconfig.rb +15 -15
  27. data/lib/albacore/config/ncoverreportconfig.rb +15 -15
  28. data/lib/albacore/config/ndependconfig.rb +15 -15
  29. data/lib/albacore/config/netversion.rb +21 -21
  30. data/lib/albacore/config/nugetpackconfig.rb +3 -3
  31. data/lib/albacore/config/nugetpublishconfig.rb +19 -0
  32. data/lib/albacore/config/nugetpushconfig.rb +19 -0
  33. data/lib/albacore/config/nunittestrunnerconfig.rb +14 -14
  34. data/lib/albacore/config/specflowreportconfig.rb +24 -24
  35. data/lib/albacore/config/sqlcmdconfig.rb +15 -15
  36. data/lib/albacore/config/unzipconfig.rb +15 -15
  37. data/lib/albacore/config/vssgetconfig.rb +14 -0
  38. data/lib/albacore/config/xbuildconfig.rb +15 -15
  39. data/lib/albacore/config/xunittestrunnerconfig.rb +15 -15
  40. data/lib/albacore/config/zipdirectoryconfig.rb +15 -15
  41. data/lib/albacore/csc.rb +66 -62
  42. data/lib/albacore/docu.rb +41 -41
  43. data/lib/albacore/exec.rb +18 -18
  44. data/lib/albacore/fluentmigratorrunner.rb +51 -46
  45. data/lib/albacore/msbuild.rb +55 -55
  46. data/lib/albacore/mspectestrunner.rb +50 -50
  47. data/lib/albacore/mstesttestrunner.rb +43 -43
  48. data/lib/albacore/nant.rb +38 -38
  49. data/lib/albacore/nchurn.rb +74 -74
  50. data/lib/albacore/ncoverconsole.rb +68 -68
  51. data/lib/albacore/ncoverreport.rb +62 -62
  52. data/lib/albacore/ncoverreports/assemblyfilter.rb +9 -9
  53. data/lib/albacore/ncoverreports/branchcoverage.rb +9 -9
  54. data/lib/albacore/ncoverreports/classfilter.rb +9 -9
  55. data/lib/albacore/ncoverreports/codecoveragebase.rb +25 -25
  56. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +23 -23
  57. data/lib/albacore/ncoverreports/documentfilter.rb +9 -9
  58. data/lib/albacore/ncoverreports/fullcoveragereport.rb +13 -13
  59. data/lib/albacore/ncoverreports/methodcoverage.rb +9 -9
  60. data/lib/albacore/ncoverreports/methodfilter.rb +9 -9
  61. data/lib/albacore/ncoverreports/namespacefilter.rb +9 -9
  62. data/lib/albacore/ncoverreports/reportfilterbase.rb +26 -26
  63. data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
  64. data/lib/albacore/ncoverreports/symbolcoverage.rb +9 -9
  65. data/lib/albacore/ndepend.rb +33 -33
  66. data/lib/albacore/nugetpublish.rb +47 -0
  67. data/lib/albacore/nugetpush.rb +46 -0
  68. data/lib/albacore/nunittestrunner.rb +41 -41
  69. data/lib/albacore/nuspec.rb +133 -109
  70. data/lib/albacore/output.rb +99 -99
  71. data/lib/albacore/plink.rb +47 -47
  72. data/lib/albacore/specflowreport.rb +62 -62
  73. data/lib/albacore/sqlcmd.rb +80 -80
  74. data/lib/albacore/support/attrmethods.rb +33 -33
  75. data/lib/albacore/support/createtask.rb +50 -30
  76. data/lib/albacore/support/failure.rb +15 -15
  77. data/lib/albacore/support/logging.rb +38 -38
  78. data/lib/albacore/support/openstruct.rb +13 -13
  79. data/lib/albacore/support/runcommand.rb +45 -45
  80. data/lib/albacore/support/supportlinux.rb +23 -23
  81. data/lib/albacore/support/updateattributes.rb +13 -13
  82. data/lib/albacore/support/yamlconfig.rb +18 -18
  83. data/lib/albacore/unzip.rb +28 -28
  84. data/lib/albacore/vssget.rb +44 -0
  85. data/lib/albacore/xbuild.rb +54 -54
  86. data/lib/albacore/xunittestrunner.rb +52 -52
  87. data/lib/albacore/zipdirectory.rb +105 -105
  88. data/rakefile.rb +297 -297
  89. data/spec/albacoremodel_spec.rb +53 -53
  90. data/spec/assemblyinfo_spec.rb +541 -541
  91. data/spec/attrmethods_spec.rb +136 -136
  92. data/spec/config_spec.rb +34 -34
  93. data/spec/createtask_spec.rb +236 -236
  94. data/spec/csc_spec.rb +253 -253
  95. data/spec/docu_spec.rb +109 -109
  96. data/spec/exec_spec.rb +45 -45
  97. data/spec/fluentmigratorrunner_spec.rb +254 -185
  98. data/spec/msbuild_spec.rb +215 -215
  99. data/spec/mspec_spec.rb +28 -28
  100. data/spec/mstesttestrunner_spec.rb +142 -142
  101. data/spec/nant_spec.rb +110 -110
  102. data/spec/nchurn_spec.rb +75 -75
  103. data/spec/ncoverconsole_spec.rb +353 -353
  104. data/spec/ncoverreport_spec.rb +619 -619
  105. data/spec/ndepend_spec.rb +72 -72
  106. data/spec/nunittestrunner_spec.rb +122 -122
  107. data/spec/nuspec_spec.rb +78 -78
  108. data/spec/patches/docu_patch.rb +12 -12
  109. data/spec/patches/fail_patch.rb +8 -8
  110. data/spec/patches/system_patch.rb +20 -20
  111. data/spec/plink_spec.rb +62 -62
  112. data/spec/runcommand_spec.rb +94 -94
  113. data/spec/spec_helper.rb +17 -17
  114. data/spec/specflowreport_spec.rb +146 -146
  115. data/spec/sqlcmd_spec.rb +334 -334
  116. data/spec/support/assemblyinfotester.rb +51 -51
  117. data/spec/support/ironruby_validator.rb +26 -26
  118. data/spec/support/msbuildtestdata.rb +32 -32
  119. data/spec/support/nanttestdata.rb +33 -33
  120. data/spec/support/ncoverconsoletestdata.rb +19 -19
  121. data/spec/support/ncoverreporttestdata.rb +26 -26
  122. data/spec/support/nokogiri_validator.rb +15 -15
  123. data/spec/support/outputtestdata.rb +12 -12
  124. data/spec/support/ziptestdata.rb +12 -12
  125. data/spec/unzip_spec.rb +15 -15
  126. data/spec/xbuild_spec.rb +15 -15
  127. data/spec/xunit_spec.rb +168 -168
  128. data/spec/yamlconfig_spec.rb +49 -49
  129. data/spec/zip_spec.rb +104 -104
  130. data/watchrtesting.rb +8 -8
  131. metadata +15 -119
data/.autotest CHANGED
@@ -1,4 +1,4 @@
1
- Autotest.add_hook :initialize do |at|
2
- %w{.git .svn rakefile spec/spec.opts spec/support .autotest .DS_Store }.each {|exception|at.add_exception(exception)}
3
- end
4
-
1
+ Autotest.add_hook :initialize do |at|
2
+ %w{.git .svn rakefile spec/spec.opts spec/support .autotest .DS_Store }.each {|exception|at.add_exception(exception)}
3
+ end
4
+
@@ -1,2 +1,2 @@
1
- ---
2
- BUNDLE_DISABLE_SHARED_GEMS: "1"
1
+ ---
2
+ BUNDLE_DISABLE_SHARED_GEMS: "1"
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.2@albacore --create
1
+ rvm 1.9.2@albacore --create
data/Gemfile CHANGED
@@ -1,12 +1,12 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rubyzip', '0.9.4'
4
-
5
- group :development do
6
- gem 'nokogiri', '1.4.4'
7
- gem 'version_bumper', '0.3.0'
8
- gem 'jeweler', '1.4.0'
9
- gem 'rspec', '1.2.9'
10
- gem 'jekyll', '0.8.0'
11
- gem 'watchr', '0.7'
12
- end
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rubyzip', '0.9.4'
4
+
5
+ group :development do
6
+ gem 'nokogiri', '1.4.4'
7
+ gem 'version_bumper', '0.3.0'
8
+ gem 'jeweler', '1.4.0'
9
+ gem 'rspec', '1.2.9'
10
+ gem 'jekyll', '0.8.0'
11
+ gem 'watchr', '0.7'
12
+ end
@@ -1,68 +1,92 @@
1
- # Welcome to the albacore project.
2
-
3
- albacore is a suite of Rake tasks to automate the process of building a .NET based system. It's like MSBuild or Nant... but without all the stabby-bracket xmlhell.
4
-
5
- ## How To Use albacore
6
-
7
- 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.
8
-
9
- If you are new to Ruby and Rake, head over to the [getting started](https://github.com/derickbailey/Albacore/wiki/Getting-Started) wiki page.
10
-
11
- ## How To Contribute, Collaborate, Communicate
12
-
13
- See the wiki page for [contributing to albacore](https://github.com/derickbailey/Albacore/wiki/HowToContribute)
14
-
15
- ## Contributors
16
-
17
- Many thanks for contributions to albacore are due (in alphabetical order):
18
-
19
- * [Andreone](http://github.com/Andreone): Significant Wiki contributions, questions and contributions on the google group
20
- * [Andrew Vos](http://github.com/AndrewVos): Fixes and additions to SQLCmd task
21
- * [Ben Hall](http://github.com/benhall): Primary contributor. SSH, SFTP, ZipDirectory, Rename, YAML auto config, Wiki pages, and many other great additions
22
- * [Brett Veenstra](http://github.com/brettveenstra): SQLCmd options (truted connection, batch abort), etc
23
- * [Brian Donahue](http://github.com/briandonahue): Inspiration and initial code for the ExpandTemplates task
24
- * [ChrisAnn](http://github.com/ChrisAnn): MSBuild logger module settings
25
- * [Chris Geihsler](http://github.com/geihsler): MSTest task
26
- * [Dotan Nahum](http://github.com/jondot): NChurn task, Output task, wiki updates, etc
27
- * [Hernan Garcia](http://github.com/hgarcia): Specflow Report task
28
- * [Hibri Marzook](http://github.com/hibri): PLink (deprecated) and NDepend tasks
29
- * [James Gregory](http://github.com/jagregory): Docu task, zip task contributions, nuspec contributions, etc
30
- * [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
31
- * [Louis Salin](http://github.com/louissalin): Support for nix path separators in CSC task
32
- * [Mark Boltuc](http://github.com/mboltuc): Fluent Migrator task
33
- * [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
34
- * [Mike Nichols](http://github.com/mnichols): XUnit contributions, bug reports, etc
35
- * [Nathan Fisher](:http://github.com/nfisher): additions to CSC task
36
- * [Nils Jonsson](http://github.com/njonsson): AssemblyInfo corrections, rakefile corrections
37
- * [Prabir Shrestha](http://github.com/prabirshrestha): Nupack task, bug fixes for xunit test runner, etc.
38
- * [Panda Wood](http://github.com/pandawood): NCover Console options and wiki edits
39
- * [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
40
- * [Steven Harman](http://github.com/stevenharman): Primary contributor. Nant task, issue tickets, disucssions, and much much more.
41
- * [Steve Hebert](http://github.com/stevehebert): Nuspec task
42
- * [Steven Johnson](http://github.com/2020steve): Expand Templates (deprecated task) supplimental data, etc
43
- * [thomasvm](http://github.com/thomasvm): AssemblyInfo read / update existing file, MSSql additions
44
- * [Tobias Grimm](http://github.com/e-tobi): AssemblyInfo custom\_data, working directory code refactoring, relative project paths for executables
45
-
46
- And to anyone and everyone else who has contributed in any way, to the mailing list, spreading the word, blog posts, etc: thank you!
47
-
48
- ## Legal Mumbo Jumbo (MIT License)
49
-
50
- Copyright (c) 2011 Derick Bailey
51
-
52
- Permission is hereby granted, free of charge, to any person obtaining a copy
53
- of this software and associated documentation files (the "Software"), to deal
54
- in the Software without restriction, including without limitation the rights
55
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56
- copies of the Software, and to permit persons to whom the Software is
57
- furnished to do so, subject to the following conditions:
58
-
59
- The above copyright notice and this permission notice shall be included in
60
- all copies or substantial portions of the Software.
61
-
62
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
68
- THE SOFTWARE.
1
+ # Welcome to the albacore project.
2
+
3
+ albacore is a suite of Rake tasks to automate the process of building a .NET based system. It's like MSBuild or Nant... but without all the stabby-bracket xmlhell.
4
+
5
+ ## How To Use albacore
6
+
7
+ 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.
8
+
9
+ If you are new to Ruby and Rake, head over to the [getting started](https://github.com/derickbailey/Albacore/wiki/Getting-Started) wiki page.
10
+
11
+ ## Supported Versions Of Ruby And Rake
12
+
13
+ Albacore has been tested against the following versions of rake:
14
+
15
+ * Rake v0.8.7
16
+ * Rake v0.9.2
17
+
18
+ Albacore has been tested against the following versions of Ruby for Windows:
19
+
20
+ * RubyInstaller v1.8.7
21
+ * RubyInstaller v1.9.2
22
+ * IronRuby v1.0
23
+ * IronRuby v1.1
24
+ * IronRuby v1.1.1
25
+ * IronRuby v1.1.2
26
+ * IronRuby v1.1.3
27
+
28
+ ### Unsupported Versions Of Ruby
29
+
30
+ Support for the following versions of ruby has been dropped. Albacore will no longer be tested against, or have code written to work with these versions of ruby. Use these versions at your own risk.
31
+
32
+ * RubyInstaller v1.8.6
33
+ * RubyInstaller v1.9.1
34
+
35
+ ### Notes About IronRuby
36
+
37
+ Due to an incompatibility with the Rubyzip gem, IronRuby does not support the ‘zip’ and ‘unzip’ tasks. If you need zip / unzip support, look into using a third party tool such as [7-zip](http://7-zip.org) or [SharpZipLib](http://sharpdevelop.net/OpenSource/SharpZipLib/).
38
+
39
+ ## Contributors
40
+
41
+ Many thanks for contributions to albacore are due (in alphabetical order):
42
+
43
+ * [Andreone](http://github.com/Andreone): Significant Wiki contributions, questions and contributions on the google group
44
+ * [Andrew Vos](http://github.com/AndrewVos): Fixes and additions to SQLCmd task
45
+ * [Ben Hall](http://github.com/benhall): Primary contributor. SSH, SFTP, ZipDirectory, Rename, YAML auto config, Wiki pages, and many other great additions
46
+ * [Brett Veenstra](http://github.com/brettveenstra): SQLCmd options (truted connection, batch abort), etc
47
+ * [Brian Donahue](http://github.com/briandonahue): Inspiration and initial code for the ExpandTemplates task
48
+ * [ChrisAnn](http://github.com/ChrisAnn): MSBuild logger module settings
49
+ * [Chris Geihsler](http://github.com/geihsler): MSTest task
50
+ * [Dotan Nahum](http://github.com/jondot): NChurn task, Output task, wiki updates, etc
51
+ * [Hernan Garcia](http://github.com/hgarcia): Specflow Report task
52
+ * [Hibri Marzook](http://github.com/hibri): PLink (deprecated) and NDepend tasks
53
+ * [James Gregory](http://github.com/jagregory): Docu task, zip task contributions, nuspec contributions, etc
54
+ * [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
55
+ * [Louis Salin](http://github.com/louissalin): Support for nix path separators in CSC task
56
+ * [Mark Boltuc](http://github.com/mboltuc): Fluent Migrator task
57
+ * [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
58
+ * [Mike Nichols](http://github.com/mnichols): XUnit contributions, bug reports, etc
59
+ * [Nathan Fisher](:http://github.com/nfisher): additions to CSC task
60
+ * [Nils Jonsson](http://github.com/njonsson): AssemblyInfo corrections, rakefile corrections
61
+ * [Prabir Shrestha](http://github.com/prabirshrestha): Nupack task, bug fixes for xunit test runner, etc.
62
+ * [Panda Wood](http://github.com/pandawood): NCover Console options and wiki edits
63
+ * [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
64
+ * [Steven Harman](http://github.com/stevenharman): Primary contributor. Nant task, issue tickets, disucssions, and much much more.
65
+ * [Steve Hebert](http://github.com/stevehebert): Nuspec task
66
+ * [Steven Johnson](http://github.com/2020steve): Expand Templates (deprecated task) supplimental data, etc
67
+ * [thomasvm](http://github.com/thomasvm): AssemblyInfo read / update existing file, MSSql additions
68
+ * [Tobias Grimm](http://github.com/e-tobi): AssemblyInfo custom\_data, working directory code refactoring, relative project paths for executables
69
+
70
+ And to anyone and everyone else who has contributed in any way, to the mailing list, spreading the word, blog posts, etc: thank you!
71
+
72
+ ## Legal Mumbo Jumbo (MIT License)
73
+
74
+ Copyright (c) 2011 Derick Bailey
75
+
76
+ Permission is hereby granted, free of charge, to any person obtaining a copy
77
+ of this software and associated documentation files (the "Software"), to deal
78
+ in the Software without restriction, including without limitation the rights
79
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
80
+ copies of the Software, and to permit persons to whom the Software is
81
+ furnished to do so, subject to the following conditions:
82
+
83
+ The above copyright notice and this permission notice shall be included in
84
+ all copies or substantial portions of the Software.
85
+
86
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
87
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
88
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
89
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
90
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
91
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
92
+ THE SOFTWARE.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -1,9 +1,9 @@
1
- albacore_root = File.expand_path(File.dirname(__FILE__))
2
- $: << albacore_root
3
- $: << File.join(albacore_root, "albacore")
4
- $: << File.join(albacore_root, "albacore", 'support')
5
- $: << File.join(albacore_root, "albacore", 'config')
6
-
7
- IS_IRONRUBY = (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby")
8
-
9
- Dir.glob(File.join(albacore_root, 'albacore/*.rb')).each {|f| require f }
1
+ albacore_root = File.expand_path(File.dirname(__FILE__))
2
+ $: << albacore_root
3
+ $: << File.join(albacore_root, "albacore")
4
+ $: << File.join(albacore_root, "albacore", 'support')
5
+ $: << File.join(albacore_root, "albacore", 'config')
6
+
7
+ IS_IRONRUBY = (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby")
8
+
9
+ Dir.glob(File.join(albacore_root, 'albacore/*.rb')).each {|f| require f }
@@ -1,50 +1,50 @@
1
- require 'albacore/support/attrmethods'
2
- require 'albacore/support/failure'
3
- require 'albacore/support/logging'
4
- require 'albacore/support/yamlconfig'
5
- require 'albacore/support/runcommand'
6
- require 'albacore/support/updateattributes'
7
- require 'albacore/support/createtask'
8
- require 'albacore/config/config'
9
-
10
- module Albacore
11
- module Task
12
- include Failure
13
- include Logging
14
- include YAMLConfig
15
- include UpdateAttributes
16
-
17
- def self.included(mod)
18
- mod.extend AttrMethods
19
- self.create_rake_task mod
20
- self.include_config mod, caller[0]
21
- end
22
-
23
- def self.include_config(mod, calledby)
24
- dir = clean_dirname(calledby)
25
- configfile = File.expand_path(File.join(dir, "config", "#{mod.name.downcase}config.rb"))
26
- require configfile if File.exist?(configfile)
27
- end
28
-
29
- def self.clean_dirname(file)
30
- last = file.rindex "/"
31
- file[0..last]
32
- end
33
-
34
- def self.create_rake_task(mod)
35
- if mod.class == Class
36
- tasknames = Array.new
37
-
38
- if mod.const_defined?("TaskName")
39
- tasknames << eval("#{mod}::TaskName")
40
- else
41
- tasknames << mod.name.downcase
42
- end
43
-
44
- tasknames.flatten.each do |taskname|
45
- Albacore.create_task taskname, mod
46
- end
47
- end
48
- end
49
- end
50
- end
1
+ require 'albacore/support/attrmethods'
2
+ require 'albacore/support/failure'
3
+ require 'albacore/support/logging'
4
+ require 'albacore/support/yamlconfig'
5
+ require 'albacore/support/runcommand'
6
+ require 'albacore/support/updateattributes'
7
+ require 'albacore/support/createtask'
8
+ require 'albacore/config/config'
9
+
10
+ module Albacore
11
+ module Task
12
+ include Failure
13
+ include Logging
14
+ include YAMLConfig
15
+ include UpdateAttributes
16
+
17
+ def self.included(mod)
18
+ mod.extend AttrMethods
19
+ self.create_rake_task mod
20
+ self.include_config mod, caller[0]
21
+ end
22
+
23
+ def self.include_config(mod, calledby)
24
+ dir = clean_dirname(calledby)
25
+ configfile = File.expand_path(File.join(dir, "config", "#{mod.name.downcase}config.rb"))
26
+ require configfile if File.exist?(configfile)
27
+ end
28
+
29
+ def self.clean_dirname(file)
30
+ last = file.rindex "/"
31
+ file[0..last]
32
+ end
33
+
34
+ def self.create_rake_task(mod)
35
+ if mod.class == Class
36
+ tasknames = Array.new
37
+
38
+ if mod.const_defined?("TaskName")
39
+ tasknames << eval("#{mod}::TaskName")
40
+ else
41
+ tasknames << mod.name.downcase
42
+ end
43
+
44
+ tasknames.flatten.each do |taskname|
45
+ Albacore.create_task taskname, mod
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -1,58 +1,58 @@
1
- require 'albacore/albacoretask'
2
- require 'albacore/config/aspnetcompilerconfig'
3
- require 'albacore/support/supportlinux'
4
-
5
- class AspNetCompiler
6
- include Albacore::Task
7
- include Albacore::RunCommand
8
- include Configuration::AspNetCompiler
9
- include SupportsLinuxEnvironment
10
-
11
- # http://msdn.microsoft.com/en-us/library/ms164291.aspx
12
-
13
- attr_accessor :clean, # Optional Boolean parameter. If this parameter is true, the precompiled application will be built clean. Any previously compiled components will be recompiled. The default value is false. This parameter corresponds to the -c switch on aspnet_compiler.exe.
14
- #:allow_partially_trusted_callers, # Optional Boolean parameter. If this parameter is true, the strong-name assembly will allow partially trusted callers.
15
- :debug, # Optional Boolean parameter. If this parameter is true, debug information (.PDB file) is emitted during compilation. The default value is false. This parameter corresponds to the -d switch on aspnet_compiler.exe.
16
- :delay_sign, # Optional Boolean parameter. If this parameter is true, the assembly is not fully signed when created.
17
- :fixed_names, # Optional Boolean parameter. If this parameter is true, the compiled assemblies will be given fixed names.
18
- :force, # Optional Boolean parameter. If this parameter is true, the task will overwrite the target directory if it already exists. Existing contents are lost. The default value is false. This parameter corresponds to the -f switch on aspnet_compiler.exe.
19
- #:key_container, # Optional String parameter. Specifies a strong name key container.
20
- #:key_file, # Optional String parameter. Specifies the physical path to the strong name key file..
21
- #:metabase_path, # Optional String parameter. Specifies the full IIS metabase path of the application. This parameter cannot be combined with the VirtualPath or PhysicalPath parameters. This parameter corresponds to the -m switch on aspnet_compiler.exe.
22
- :physical_path, # Optional String parameter. Specifies the physical path of the application to be compiled. If this parameter is missing, the IIS metabase is used to locate the application. This parameter corresponds to the -p switch on aspnet_compiler.exe.
23
- #:target_framework_moniker, # Optional String parameter. Specifies the TargetFrameworkMoniker indicating which .NET Framework version of aspnet_compiler.exe should be used. Only accepts .NET Framework monikers.
24
- :target_path, # Optional String parameter. Specifies the physical path to which the application is compiled. If not specified, the application is precompiled in-place.
25
- :updateable, # Optional Boolean parameter. If this parameter is true, the precompiled application will be updateable. The default value is false. This parameter corresponds to the -u switch on aspnet_compiler.exe.
26
- :virtual_path # Optional String parameter. The virtual path of the application to be compiled. If PhysicalPath specified, the physical path is used to locate the application. Otherwise, the IIS metabase is used, and the application is assumed to be in the default site. This parameter corresponds to the -v switch on aspnet_compiler.exe.
27
-
28
- def initialize
29
- @clean = false
30
- @debug = false
31
- @delay_sign = false
32
- @fixed_names = false
33
- @force = false
34
- @updateable = false
35
- @virtual_path = '/'
36
- super()
37
- update_attributes aspnetcompiler.to_hash
38
- end
39
-
40
- def execute
41
- params = []
42
- params << "-v #{@virtual_path}" unless @virtual_path.nil?
43
- params << "-p #{format_path(@physical_path)}" unless @physical_path.nil?
44
- params << "-c" if @clean
45
- params << "-delaysign" if @delay_sign
46
- params << "-fixednames" if @fixed_names
47
- params << "-d" if @debug
48
- params << "-u" if @updateable
49
- params << "-f" if @force
50
- params << format_path(@target_path) unless @target_path.nil?
51
-
52
- result = run_command "AspNetCompiler", params
53
-
54
- failure_message = 'AspNetCompiler Failed. See Build Log For Detail'
55
- fail_with_message failure_message if !result
56
- end
57
-
58
- end
1
+ require 'albacore/albacoretask'
2
+ require 'albacore/config/aspnetcompilerconfig'
3
+ require 'albacore/support/supportlinux'
4
+
5
+ class AspNetCompiler
6
+ include Albacore::Task
7
+ include Albacore::RunCommand
8
+ include Configuration::AspNetCompiler
9
+ include SupportsLinuxEnvironment
10
+
11
+ # http://msdn.microsoft.com/en-us/library/ms164291.aspx
12
+
13
+ attr_accessor :clean, # Optional Boolean parameter. If this parameter is true, the precompiled application will be built clean. Any previously compiled components will be recompiled. The default value is false. This parameter corresponds to the -c switch on aspnet_compiler.exe.
14
+ #:allow_partially_trusted_callers, # Optional Boolean parameter. If this parameter is true, the strong-name assembly will allow partially trusted callers.
15
+ :debug, # Optional Boolean parameter. If this parameter is true, debug information (.PDB file) is emitted during compilation. The default value is false. This parameter corresponds to the -d switch on aspnet_compiler.exe.
16
+ :delay_sign, # Optional Boolean parameter. If this parameter is true, the assembly is not fully signed when created.
17
+ :fixed_names, # Optional Boolean parameter. If this parameter is true, the compiled assemblies will be given fixed names.
18
+ :force, # Optional Boolean parameter. If this parameter is true, the task will overwrite the target directory if it already exists. Existing contents are lost. The default value is false. This parameter corresponds to the -f switch on aspnet_compiler.exe.
19
+ #:key_container, # Optional String parameter. Specifies a strong name key container.
20
+ #:key_file, # Optional String parameter. Specifies the physical path to the strong name key file..
21
+ #:metabase_path, # Optional String parameter. Specifies the full IIS metabase path of the application. This parameter cannot be combined with the VirtualPath or PhysicalPath parameters. This parameter corresponds to the -m switch on aspnet_compiler.exe.
22
+ :physical_path, # Optional String parameter. Specifies the physical path of the application to be compiled. If this parameter is missing, the IIS metabase is used to locate the application. This parameter corresponds to the -p switch on aspnet_compiler.exe.
23
+ #:target_framework_moniker, # Optional String parameter. Specifies the TargetFrameworkMoniker indicating which .NET Framework version of aspnet_compiler.exe should be used. Only accepts .NET Framework monikers.
24
+ :target_path, # Optional String parameter. Specifies the physical path to which the application is compiled. If not specified, the application is precompiled in-place.
25
+ :updateable, # Optional Boolean parameter. If this parameter is true, the precompiled application will be updateable. The default value is false. This parameter corresponds to the -u switch on aspnet_compiler.exe.
26
+ :virtual_path # Optional String parameter. The virtual path of the application to be compiled. If PhysicalPath specified, the physical path is used to locate the application. Otherwise, the IIS metabase is used, and the application is assumed to be in the default site. This parameter corresponds to the -v switch on aspnet_compiler.exe.
27
+
28
+ def initialize
29
+ @clean = false
30
+ @debug = false
31
+ @delay_sign = false
32
+ @fixed_names = false
33
+ @force = false
34
+ @updateable = false
35
+ @virtual_path = '/'
36
+ super()
37
+ update_attributes aspnetcompiler.to_hash
38
+ end
39
+
40
+ def execute
41
+ params = []
42
+ params << "-v #{@virtual_path}" unless @virtual_path.nil?
43
+ params << "-p #{format_path(@physical_path)}" unless @physical_path.nil?
44
+ params << "-c" if @clean
45
+ params << "-delaysign" if @delay_sign
46
+ params << "-fixednames" if @fixed_names
47
+ params << "-d" if @debug
48
+ params << "-u" if @updateable
49
+ params << "-f" if @force
50
+ params << format_path(@target_path) unless @target_path.nil?
51
+
52
+ result = run_command "AspNetCompiler", params
53
+
54
+ failure_message = 'AspNetCompiler Failed. See Build Log For Detail'
55
+ fail_with_message failure_message if !result
56
+ end
57
+
58
+ end
@@ -1,140 +1,140 @@
1
- require 'albacore/albacoretask'
2
- require 'albacore/assemblyinfolanguages/csharpengine'
3
- require 'albacore/assemblyinfolanguages/vbnetengine'
4
-
5
- class AssemblyInfo
6
- include Albacore::Task
7
-
8
- attr_accessor :input_file, :output_file
9
- attr_accessor :version, :title, :description, :custom_attributes
10
- attr_accessor :copyright, :com_visible, :com_guid, :company_name, :product_name
11
- attr_accessor :file_version, :trademark, :lang_engine, :custom_data
12
-
13
- attr_array :namespaces
14
- attr_hash :custom_attributes
15
- attr_array :custom_data
16
-
17
- def initialize
18
- @namespaces = []
19
- super()
20
- update_attributes Albacore.configuration.assemblyinfo.to_hash
21
- end
22
-
23
- def use(file)
24
- @input_file = @output_file = file
25
- end
26
-
27
- def execute
28
- @lang_engine = CSharpEngine.new unless check_lang_engine
29
- write_assemblyinfo @output_file, @input_file
30
- end
31
-
32
- def write_assemblyinfo(assemblyinfo_file, input_file)
33
- valid = check_output_file assemblyinfo_file
34
- return if !valid
35
-
36
- input_data = read_input_file input_file
37
- asm_data = build_assembly_info_data input_data
38
-
39
- @logger.info "Generating Assembly Info File At: " + File.expand_path(assemblyinfo_file)
40
- File.open(assemblyinfo_file, 'w') do |f|
41
- asm_data.each do |line|
42
- f.puts line
43
- end
44
- end
45
- end
46
-
47
- def read_input_file(file)
48
- data = []
49
- return data if file.nil?
50
-
51
- File.open(file, 'r') do |file|
52
- file.each_line do |line|
53
- data << line.strip
54
- end
55
- end
56
-
57
- data
58
- end
59
-
60
- def check_output_file(file)
61
- return true if file
62
- fail_with_message 'output_file cannot be nil'
63
- return false
64
- end
65
-
66
- def check_lang_engine
67
- return !@lang_engine.nil?
68
- end
69
-
70
- def build_assembly_info_data(data)
71
- if data.empty?
72
- data = build_using_statements
73
- end
74
-
75
- build_attribute(data, "AssemblyTitle", @title) if @title != nil
76
- build_attribute(data, "AssemblyDescription", @description) if @description != nil
77
- build_attribute(data, "AssemblyCompany", @company_name) if @company_name != nil
78
- build_attribute(data, "AssemblyProduct", @product_name) if @product_name != nil
79
-
80
- build_attribute(data, "AssemblyCopyright", @copyright) if @copyright != nil
81
- build_attribute(data, "AssemblyTrademark", @trademark) if @trademark != nil
82
-
83
- build_attribute(data, "ComVisible", @com_visible) if @com_visible != nil
84
- build_attribute(data, "Guid", @com_guid) if @com_guid != nil
85
-
86
- build_attribute(data, "AssemblyVersion", @version) if @version != nil
87
- build_attribute(data, "AssemblyFileVersion", @file_version) if @file_version != nil
88
-
89
- data << ""
90
- if @custom_attributes != nil
91
- attributes = build_custom_attributes()
92
- data += attributes
93
- data << ""
94
- end
95
-
96
- if @custom_data != nil
97
- @custom_data.each do |cdata|
98
- data << cdata unless data.include? cdata
99
- end
100
- end
101
-
102
- data
103
- end
104
-
105
- def build_attribute(data, attr_name, attr_data)
106
- attr_value = @lang_engine.build_attribute(attr_name, attr_data)
107
- attr_re = @lang_engine.build_attribute_re(attr_name)
108
- result = nil
109
- @logger.debug "Build Assembly Info Attribute: " + attr_value
110
- data.each do |line|
111
- break unless result.nil?
112
- result = line.sub! attr_re, attr_value
113
- end
114
- data << attr_value if result.nil?
115
- end
116
-
117
- def build_using_statements
118
- @namespaces = [] if @namespaces.nil?
119
-
120
- @namespaces << "System.Reflection"
121
- @namespaces << "System.Runtime.InteropServices"
122
- @namespaces.uniq!
123
-
124
- ns = []
125
- @namespaces.each do |n|
126
- ns << @lang_engine.build_using_statement(n)
127
- end
128
-
129
- ns
130
- end
131
-
132
- def build_custom_attributes()
133
- attributes = []
134
- @custom_attributes.each do |key, value|
135
- attributes << @lang_engine.build_attribute(key, value)
136
- end
137
- attributes
138
- end
139
-
140
- end
1
+ require 'albacore/albacoretask'
2
+ require 'albacore/assemblyinfolanguages/csharpengine'
3
+ require 'albacore/assemblyinfolanguages/vbnetengine'
4
+
5
+ class AssemblyInfo
6
+ include Albacore::Task
7
+
8
+ attr_accessor :input_file, :output_file
9
+ attr_accessor :version, :title, :description, :custom_attributes
10
+ attr_accessor :copyright, :com_visible, :com_guid, :company_name, :product_name
11
+ attr_accessor :file_version, :trademark, :lang_engine, :custom_data
12
+
13
+ attr_array :namespaces
14
+ attr_hash :custom_attributes
15
+ attr_array :custom_data
16
+
17
+ def initialize
18
+ @namespaces = []
19
+ super()
20
+ update_attributes Albacore.configuration.assemblyinfo.to_hash
21
+ end
22
+
23
+ def use(file)
24
+ @input_file = @output_file = file
25
+ end
26
+
27
+ def execute
28
+ @lang_engine = CSharpEngine.new unless check_lang_engine
29
+ write_assemblyinfo @output_file, @input_file
30
+ end
31
+
32
+ def write_assemblyinfo(assemblyinfo_file, input_file)
33
+ valid = check_output_file assemblyinfo_file
34
+ return if !valid
35
+
36
+ input_data = read_input_file input_file
37
+ asm_data = build_assembly_info_data input_data
38
+
39
+ @logger.info "Generating Assembly Info File At: " + File.expand_path(assemblyinfo_file)
40
+ File.open(assemblyinfo_file, 'w') do |f|
41
+ asm_data.each do |line|
42
+ f.puts line
43
+ end
44
+ end
45
+ end
46
+
47
+ def read_input_file(file)
48
+ data = []
49
+ return data if file.nil?
50
+
51
+ File.open(file, 'r') do |file|
52
+ file.each_line do |line|
53
+ data << line.strip
54
+ end
55
+ end
56
+
57
+ data
58
+ end
59
+
60
+ def check_output_file(file)
61
+ return true if file
62
+ fail_with_message 'output_file cannot be nil'
63
+ return false
64
+ end
65
+
66
+ def check_lang_engine
67
+ return !@lang_engine.nil?
68
+ end
69
+
70
+ def build_assembly_info_data(data)
71
+ if data.empty?
72
+ data = build_using_statements
73
+ end
74
+
75
+ build_attribute(data, "AssemblyTitle", @title) if @title != nil
76
+ build_attribute(data, "AssemblyDescription", @description) if @description != nil
77
+ build_attribute(data, "AssemblyCompany", @company_name) if @company_name != nil
78
+ build_attribute(data, "AssemblyProduct", @product_name) if @product_name != nil
79
+
80
+ build_attribute(data, "AssemblyCopyright", @copyright) if @copyright != nil
81
+ build_attribute(data, "AssemblyTrademark", @trademark) if @trademark != nil
82
+
83
+ build_attribute(data, "ComVisible", @com_visible) if @com_visible != nil
84
+ build_attribute(data, "Guid", @com_guid) if @com_guid != nil
85
+
86
+ build_attribute(data, "AssemblyVersion", @version) if @version != nil
87
+ build_attribute(data, "AssemblyFileVersion", @file_version) if @file_version != nil
88
+
89
+ data << ""
90
+ if @custom_attributes != nil
91
+ attributes = build_custom_attributes()
92
+ data += attributes
93
+ data << ""
94
+ end
95
+
96
+ if @custom_data != nil
97
+ @custom_data.each do |cdata|
98
+ data << cdata unless data.include? cdata
99
+ end
100
+ end
101
+
102
+ data
103
+ end
104
+
105
+ def build_attribute(data, attr_name, attr_data)
106
+ attr_value = @lang_engine.build_attribute(attr_name, attr_data)
107
+ attr_re = @lang_engine.build_attribute_re(attr_name)
108
+ result = nil
109
+ @logger.debug "Build Assembly Info Attribute: " + attr_value
110
+ data.each do |line|
111
+ break unless result.nil?
112
+ result = line.sub! attr_re, attr_value
113
+ end
114
+ data << attr_value if result.nil?
115
+ end
116
+
117
+ def build_using_statements
118
+ @namespaces = [] if @namespaces.nil?
119
+
120
+ @namespaces << "System.Reflection"
121
+ @namespaces << "System.Runtime.InteropServices"
122
+ @namespaces.uniq!
123
+
124
+ ns = []
125
+ @namespaces.each do |n|
126
+ ns << @lang_engine.build_using_statement(n)
127
+ end
128
+
129
+ ns
130
+ end
131
+
132
+ def build_custom_attributes()
133
+ attributes = []
134
+ @custom_attributes.each do |key, value|
135
+ attributes << @lang_engine.build_attribute(key, value)
136
+ end
137
+ attributes
138
+ end
139
+
140
+ end