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
data/.gitignore CHANGED
@@ -1,24 +1,9 @@
1
- *.swp
2
- *~
3
- .idea
4
-
5
1
  Gemfile.lock
6
-
2
+ tmp/
3
+ *.swp
7
4
  pkg/
8
- obj/
9
- bin/
10
- build/
11
-
12
- _ReSharper.*
13
- *.csproj.user
14
- *.resharper.user
15
- *.resharper
16
- *.suo
17
- *.cache
18
- ~$*
19
- *.tmp
20
- *.eprj
21
- *.bkp
5
+ .DS_Store
6
+ spec/testdata/TestingDependencies/Sample.Commands/Sample.Commands.nuspec
7
+ spec/testdata/Project/Sample.Nuget.nuspec
8
+ spec/testdata/TestingDependencies/Sample.Core/Sample.Core.nuspec
22
9
 
23
- /spec/support/Tools/NDepend-v2.12/NDependProLicense.xml
24
- Gemfile.lock
@@ -1,16 +1,35 @@
1
+ # kisses and hugs to https://raw.github.com/NancyFx/Nancy/master/.travis.yml
2
+
1
3
  language: ruby
4
+
5
+ install:
6
+ - sudo bash -c "echo deb http://badgerports.org lucid main >> /etc/apt/sources.list"
7
+ - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E1FAD0C
8
+ - sudo apt-get update
9
+ - sudo apt-get install mono-devel mono-gmcs mono-vbnc
10
+ - sudo apt-get install gettext
11
+ - sudo wget -q -P "/opt" "http://samples.nancyfx.org/content/mono-3.0.12-x64-bin.tar.bz2"
12
+ - bundle install
13
+ - echo set -e >> ./travis.sh
14
+ - echo set -o pipefail >> ./travis.sh
15
+ - echo echo Running on Mono 3.x >> ./travis.sh
16
+ - echo sudo tar xk -C "/opt" -f /opt/mono-3.0.12-x64-bin.tar.bz2 >> ./travis.sh
17
+ - echo export PATH="/opt/mono/bin:$PATH" >> ./travis.sh
18
+ - echo export LD_LIBRARY_PATH="/opt/mono/bin" >> ./travis.sh
19
+ - echo bundle exec rake spec >> ./travis.sh
20
+ - chmod +x ./travis.sh
21
+
22
+ script: ./travis.sh
23
+
2
24
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - jruby
6
- script: bundle exec rake specs:all
7
- bundler_args: --without=wiki
25
+ - 1.9.3
26
+ - 2.0.0
27
+ # - jruby
28
+
29
+ branches:
30
+ only: clean_slate
31
+
8
32
  notifications:
9
- email: false
33
+ email: henrik@haf.se
34
+
10
35
  gemfile: Gemfile
11
- deploy:
12
- provider: rubygems
13
- api_key:
14
- secure: c8WYx8M7i68fZzucth/eI7kj0OX55f6te5Toz88HhDRYdycJ7xu6GJBErOGQBK+26cLnu2sfi//TJXOBayCm7mluTcNSoQMrYalm9s5+oCNyNKbMCZtRZ/kYqHZY4cvOobqKeTTrTJH5puD3PUFbCqat3s4HKrQUjCthfd6ZUeY=
15
- on:
16
- tags: true
data/Gemfile CHANGED
@@ -1,6 +1,14 @@
1
- source "http://rubygems.org"
2
- gemspec
3
-
4
- group :wiki do
5
- gem "jekyll"
6
- end
1
+ #ruby=1.9.3
2
+ #ruby-gemset=albacore_clean_slate
3
+
4
+ source "http://rubygems.org"
5
+
6
+ # Windows Rubies (RubyInstaller)
7
+ platforms :mswin, :mingw do
8
+ gem 'wdm' # for listening to Windows Directory Notifications
9
+ end
10
+
11
+ # needed to do development and read the version of albacore
12
+ gem 'nokogiri', '~>1.5'
13
+
14
+ gemspec
data/Guardfile CHANGED
@@ -1,9 +1,7 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'rspec', :version => 2 do
3
+ guard 'rspec' do
5
4
  watch(%r{^spec/.+_spec\.rb$})
6
5
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
6
  end
9
7
 
data/README.md CHANGED
@@ -1,47 +1,200 @@
1
- # Albacore
2
- [![Build Status](https://travis-ci.org/Albacore/albacore.svg?branch=releases%2Fv1.x)](https://travis-ci.org/Albacore/albacore) [![Gem Version](https://badge.fury.io/rb/albacore.png)](http://badge.fury.io/rb/albacore) [![Dependency Status](https://gemnasium.com/Albacore/albacore.png)](https://gemnasium.com/Albacore/albacore) [![Code Climate](https://codeclimate.com/github/Albacore/albacore.png)](https://codeclimate.com/github/Albacore/albacore)
3
-
4
- Albacore is a professional quality suite of Rake tasks for building .NET or Mono based systems. It's like MSBuild or NAnt without all the stabby-bracket XML hell! The tasks are built using a test-first approach and all tests are included in the gem. If you're new to Ruby/Rake read the [quick start][2]. Or, browse the [detailed instructions][1] for each task in our wiki.
5
-
6
- Details about goals and releases can be found at [albacorebuild.net](http://albacorebuild.net) and by following [@albacorebuild](https://twitter.com/albacorebuild).
7
-
8
- ## Installation
9
-
10
- Add this line to the Gemfile where you maintain the dependencies for your build (we recommend the latest RC for RubyZip 1.0 support, only remove the version spec if you know what you're doing!):
11
-
12
- ```ruby
13
- gem "albacore", "~> 1.0.0"
14
- ```
15
-
16
- And then execute
17
-
18
- ```batch
19
- > bundle install
20
- ```
21
-
22
- Or install it yourself:
23
-
24
- ```batch
25
- > gem install albacore
26
- ```
27
-
28
- ## Usage
29
-
30
- Require the Albacore gem at the top of your rakefile and start using the custom tasks. Consult the [quick start][3] or the detailed [task instructions][1] for more information on how to use Albacore tasks in your Rake build.
31
-
32
- ```ruby
33
- require "albacore"
34
- ```
35
-
36
- ## Supported Rubies
37
-
38
- Albacore has been tested against the following versions of Ruby for Windows and Linux. Use unsupported versions at your own risk!
39
-
40
- * MRI: `1.9.3`, `2.0.0` (x86 only, Nokogiri does not support x64 yet)
41
- * JRuby: `HEAD`
42
-
43
-
44
-
45
- [1]: https://github.com/Albacore/albacore/wiki
46
- [2]: https://github.com/Albacore/albacore/wiki#rake-quick-start
47
- [3]: https://github.com/Albacore/albacore/wiki#albacore-quick-start
1
+ # Albacore Clean Slate
2
+
3
+ [![Build Status](https://secure.travis-ci.org/Albacore/albacore.png?branch=clean_slate)](http://travis-ci.org/Albacore/albacore)
4
+
5
+ This branch is the next official version. It is currently being used for
6
+ numerous builds for us and is free of known bugs. It works on RMI 1.9.3.
7
+
8
+ ## getting started
9
+
10
+ In a command prompt, run:
11
+
12
+ @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
13
+
14
+ Then start a new powershell, cygwin or mingw32 shell. You can now install the
15
+ Ruby framework:
16
+
17
+ cinst ruby.devkit
18
+
19
+ Now, restart your shell or reload its path variable. You now have rake
20
+ installed. Now you can install Albacore, the collection of tasktypes, tasks and
21
+ extension points aimed to make your life as a .Net developer easier:
22
+
23
+ gem install bundler
24
+
25
+ Bundler is a tool that fetches gems for you. Now, specify what ruby gems your
26
+ build will use. Create a new file, named `Gemfile`. This file should look like
27
+ this:
28
+
29
+ source 'http://rubygems.org'
30
+ gem "albacore", :git => "git://github.com/Albacore/albacore.git", :branch => 'clean_slate'
31
+
32
+ Now, install albacore from this repository by running:
33
+
34
+ bundle
35
+
36
+ In order to build your project, you need to create a `Rakefile`, with contents
37
+ like these:
38
+
39
+ ``` ruby
40
+ require 'bundler/setup'
41
+
42
+ require 'albacore'
43
+ require 'albacore/tasks/versionizer'
44
+ require 'albacore/ext/teamcity'
45
+
46
+ Albacore::Tasks::Versionizer.new :versioning
47
+
48
+ desc 'Perform fast build (warn: doesn't d/l deps)'
49
+ build :quick_build do |b|
50
+ b.logging = 'detailed'
51
+ b.sln = 'src/MyProj.sln'
52
+ end
53
+
54
+ desc 'restore all nugets as per the packages.config files'
55
+ nugets_restore :restore do |p|
56
+ p.out = 'src/packages'
57
+ p.exe = 'buildsupport/NuGet.exe'
58
+ end
59
+
60
+ desc 'Perform full build'
61
+ build :build => [:versioning, :restore] do |b|
62
+ b.sln = 'src/MyProj.sln'
63
+ # alt: b.file = 'src/MyProj.sln'
64
+ end
65
+
66
+ directory 'build/pkg'
67
+
68
+ desc 'package nugets - finds all projects and package them'
69
+ nugets_pack :create_nugets => ['build/pkg', :versioning, :build] do |p|
70
+ p.files = FileList['src/**/*.{csproj,fsproj,nuspec}'].
71
+ exclude(/Tests/)
72
+ p.out = 'build/pkg'
73
+ p.exe = 'buildsupport/NuGet.exe'
74
+ p.with_metadata do |m|
75
+ m.description = 'A cool nuget'
76
+ m.authors = 'Henrik'
77
+ m.version = ENV['NUGET_VERSION']
78
+ end
79
+ end
80
+
81
+ task :default => :create_nugets
82
+ ```
83
+
84
+ You can now run:
85
+
86
+ rake
87
+
88
+ ## Ideas:
89
+
90
+ When building multiple configurations,
91
+ Build tasks should be invoked with different parameters
92
+ According to the graph of tasks to be executed
93
+
94
+ ``` ruby
95
+ require 'albacore'
96
+
97
+ Albacore.vary_by_parameters do |params|
98
+ # write to dynamic method
99
+ params.Configuration = ['Debug-Tests', 'Release']
100
+ end
101
+
102
+ build :b do |b|
103
+ b.vary_by_param 'Configuration'
104
+ end
105
+
106
+ nugets_pack :p => :b do |p|
107
+ # ...
108
+ end
109
+
110
+ task :default => :p
111
+ ```
112
+
113
+ Creating two runs
114
+ * `:b[Debug-Tests] => :p => :default` and
115
+ * `:b[Release] => :p => :default`
116
+
117
+ where only :b is invoked twice, but :p and :default are only invoked only once
118
+ each.
119
+
120
+ ---
121
+
122
+ When building services and/or web sites,
123
+ The bundling task_type should take care of packaging for deployment
124
+
125
+
126
+ ### Docs: build
127
+
128
+ TBD
129
+
130
+ ### Docs: nugets_pack
131
+
132
+ TBD
133
+
134
+ ### Docs: nugets_restore
135
+
136
+ TBD
137
+
138
+ ### Docs: asmver
139
+
140
+ Generate a single file with assembly attributes. Code comments in example below
141
+ mention output in F#.
142
+
143
+ ``` ruby
144
+ asmver :asmver do |a|
145
+ a.file_path = 'src/Version.fs' # required, no default
146
+ a.namespace = 'Hello.World' # required, no default
147
+ # optional
148
+ a.attributes assembly_title: 'Hello.World', # generates: [<AssemblyTitle("Hello.World")>]
149
+ assembly_version: '0.1.2', # generates: [<AssemblyVersion("0.1.2")>]
150
+ my_product_attr: 'Hello world', # generates: [<MyProductAttr("Hello World")>]
151
+ a.out = StringIO.new # optional, don't use it this way: takes an IO/Stream
152
+ end
153
+ ```
154
+
155
+ ### Docs: test_runner
156
+
157
+ TBD
158
+
159
+ ### Docs: nugets_authentication
160
+
161
+ TBD
162
+
163
+ ### Docs: csprojfiles
164
+
165
+ Checks the difference between the filesystem and the files referenced in a
166
+ csproj, to make sure that they match. Run as a part of a CI build.
167
+
168
+ ``` ruby
169
+ desc "Check the difference between the filesystem and the files referenced in a csproj"
170
+ csprojfiles do |f|
171
+ # Files to ignore
172
+ # for instance if you have source control specific files that are not supposed to be in the project
173
+ f.ignore_files = [/.*\.srccontrol/]
174
+ f.project = "src/MyMvcSite/MyMvcSite.csproj"
175
+ end
176
+ ```
177
+
178
+ When you run this task it will report any differences between the filesystem and
179
+ the csproj file.
180
+
181
+ Why is this important? It's important to know what resources will be deployed.
182
+ For instance if you have added an image. If you forgot to include the image in
183
+ the .csproj, it will show up while developing but not when you do a web
184
+ deployment (i.e. a release).
185
+
186
+ It could also be that you have deleted a file, but forgotten to save the project
187
+ when you send your latest commit to source control&hellip;
188
+
189
+ How do you use it? The best way is to have it on a CI server in order to get a
190
+ notification whenever it detects deviations.
191
+
192
+ The task will fail with a message and rake will return with an non zero exit
193
+ code. For instance if a file is missing from csproj and another from the
194
+ filesystem:
195
+
196
+ - Files in src/MyMvcSite/MyMvcSite.csproj but not on filesystem:
197
+ file_missing_on_filesystem.cshtml
198
+ + Files not in src/MyMvcSite/MyMvcSite.csproj but on filesystem:
199
+ file_missing_in_csproj.png
200
+
data/Rakefile CHANGED
@@ -1,19 +1,9 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- task :default => ["specs:all"]
5
-
6
- namespace :specs do
7
- desc "Run all specs"
8
- RSpec::Core::RakeTask.new(:all)
9
-
10
- # make a task for each *_spec.rb in spec/
11
- FileList["spec/*_spec.rb"].each do |path|
12
- ctx = File.basename(path, "*.rb").split("_").first
13
-
14
- desc "Run the #{ctx} spec"
15
- RSpec::Core::RakeTask.new(ctx) do |t|
16
- t.pattern = "spec/#{ctx}_spec.rb"
17
- end
18
- end
19
- end
1
+ require 'rubygems/tasks'
2
+ Gem::Tasks.new
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec) do |c|
6
+ c.rspec_opts = ['--color', '--format=doc']
7
+ end
8
+
9
+ task :default => :build
@@ -1,29 +1,39 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
1
+ # -*- encoding: utf-8 -*-
4
2
 
5
- require "albacore/version"
3
+ $:.push File.expand_path("../lib", __FILE__)
4
+ require 'albacore/version'
6
5
 
7
- Gem::Specification.new do |spec|
8
- spec.name = "albacore"
9
- spec.version = Albacore::VERSION
10
- spec.authors = ["Henrik Feldt", "Anthony Mastrean", "Derick Bailey"]
11
- spec.email = ["albacorebuild@gmail.com"]
12
- spec.description = %q{Albacore is a professional quality suite of Rake tasks for building .NET or Mono based systems.}
13
- spec.summary = %q{Dolphin-safe .NET and Mono rake tasks}
14
- spec.homepage = "http://albacorebuild.net"
15
- spec.license = "MIT"
6
+ Gem::Specification.new do |s|
7
+ s.name = 'albacore'
8
+ s.version = Albacore::VERSION
9
+ s.platform = Gem::Platform::RUBY
10
+ s.authors = ['Henrik Feldt', 'Anthony Mastrean']
11
+ s.email = 'henrik@haf.se'
12
+ s.homepage = 'http://albacorebuild.net'
13
+ s.summary = 'Dolphin-safe and awesome Mono and .Net Rake-tasks'
14
+ s.description = <<-EOF
15
+ Easily build your .Net or Mono project using this collection of Rake tasks.
16
+ Albacore assist you in creating nugets, managing nugets, building your projects,
17
+ handling the .Net compilers while making it very easy to integrate your ruby-code
18
+ with existing dev-ops tools, such as Puppet, Chef, Capistrano or Vagrant/VirtualBox.
19
+ EOF
16
20
 
17
- spec.files = `git ls-files`.split($/)
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ["lib"]
21
+ s.rubyforge_project = 'albacore'
21
22
 
22
- spec.add_dependency "nokogiri", "~> 1.5"
23
- spec.add_dependency "rake", "~> 10.0"
24
- spec.add_dependency "rubyzip", "~> 1.0"
23
+ s.add_dependency 'rake', '>10' # this gem builds on rake
24
+ s.add_dependency 'map', '~>6.5' # https://github.com/ahoward/map for options handling
25
+ s.add_dependency 'nokogiri', '~> 1.5' # used to manipulate and read *proj files
26
+ s.add_dependency 'facter', '~> 1.7' # used to gather system data
27
+ s.add_dependency 'semver2', '~> 3.3'
28
+ s.add_dependency 'ProcessPilot', '~> 2.0'
29
+ s.add_dependency 'highline', '~> 1.6'
30
+ s.add_dependency 'rubyzip', '=0.9.9'
31
+
32
+ s.add_development_dependency 'rubygems-tasks', '~>0.2'
33
+ s.add_development_dependency 'rspec', '>= 2.13'
25
34
 
26
- spec.add_development_dependency "rspec", "~> 2.99"
27
-
28
- spec.rubyforge_project = "albacore"
35
+ s.files = `git ls-files`.split("\n")
36
+ s.test_files = `git ls-files -- spec/*`.split("\n")
37
+ # s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
38
+ s.require_paths = ['lib']
29
39
  end