albacore 2.0.0.rc.2 → 2.0.0.rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,202 +1,262 @@
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
- gem install albacore --prerelease
9
-
10
- ## getting started
11
-
12
- In a command prompt, run:
13
-
14
- @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
15
-
16
- Then start a new powershell, cygwin or mingw32 shell. You can now install the
17
- Ruby framework:
18
-
19
- cinst ruby.devkit
20
-
21
- Now, restart your shell or reload its path variable. You now have rake
22
- installed. Now you can install Albacore, the collection of tasktypes, tasks and
23
- extension points aimed to make your life as a .Net developer easier:
24
-
25
- gem install bundler
26
-
27
- Bundler is a tool that fetches gems for you. Now, specify what ruby gems your
28
- build will use. Create a new file, named `Gemfile`. This file should look like
29
- this:
30
-
31
- source 'http://rubygems.org'
32
- gem 'albacore', '2.0.0.rc.1'
33
-
34
- Now, install albacore from this repository by running:
35
-
36
- bundle
37
-
38
- In order to build your project, you need to create a `Rakefile`, with contents
39
- like these:
40
-
41
- ``` ruby
42
- require 'bundler/setup'
43
-
44
- require 'albacore'
45
- require 'albacore/tasks/versionizer'
46
- require 'albacore/ext/teamcity'
47
-
48
- Albacore::Tasks::Versionizer.new :versioning
49
-
50
- desc 'Perform fast build (warn: doesn\'t d/l deps)'
51
- build :quick_build do |b|
52
- b.logging = 'detailed'
53
- b.sln = 'src/MyProj.sln'
54
- end
55
-
56
- desc 'restore all nugets as per the packages.config files'
57
- nugets_restore :restore do |p|
58
- p.out = 'src/packages'
59
- p.exe = 'buildsupport/NuGet.exe'
60
- end
61
-
62
- desc 'Perform full build'
63
- build :build => [:versioning, :restore] do |b|
64
- b.sln = 'src/MyProj.sln'
65
- # alt: b.file = 'src/MyProj.sln'
66
- end
67
-
68
- directory 'build/pkg'
69
-
70
- desc 'package nugets - finds all projects and package them'
71
- nugets_pack :create_nugets => ['build/pkg', :versioning, :build] do |p|
72
- p.files = FileList['src/**/*.{csproj,fsproj,nuspec}'].
73
- exclude(/Tests/)
74
- p.out = 'build/pkg'
75
- p.exe = 'buildsupport/NuGet.exe'
76
- p.with_metadata do |m|
77
- m.description = 'A cool nuget'
78
- m.authors = 'Henrik'
79
- m.version = ENV['NUGET_VERSION']
80
- end
81
- end
82
-
83
- task :default => :create_nugets
84
- ```
85
-
86
- You can now run:
87
-
88
- rake
89
-
90
- ## Ideas:
91
-
92
- When building multiple configurations,
93
- Build tasks should be invoked with different parameters
94
- According to the graph of tasks to be executed
95
-
96
- ``` ruby
97
- require 'albacore'
98
-
99
- Albacore.vary_by_parameters do |params|
100
- # write to dynamic method
101
- params.Configuration = ['Debug-Tests', 'Release']
102
- end
103
-
104
- build :b do |b|
105
- b.vary_by_param 'Configuration'
106
- end
107
-
108
- nugets_pack :p => :b do |p|
109
- # ...
110
- end
111
-
112
- task :default => :p
113
- ```
114
-
115
- Creating two runs
116
- * `:b[Debug-Tests] => :p => :default` and
117
- * `:b[Release] => :p => :default`
118
-
119
- where only :b is invoked twice, but :p and :default are only invoked only once
120
- each.
121
-
122
- ---
123
-
124
- When building services and/or web sites,
125
- The bundling task_type should take care of packaging for deployment
126
-
127
-
128
- ### Docs: build
129
-
130
- TBD
131
-
132
- ### Docs: nugets_pack
133
-
134
- TBD
135
-
136
- ### Docs: nugets_restore
137
-
138
- TBD
139
-
140
- ### Docs: asmver
141
-
142
- Generate a single file with assembly attributes. Code comments in example below
143
- mention output in F#.
144
-
145
- ``` ruby
146
- asmver :asmver do |a|
147
- a.file_path = 'src/Version.fs' # required, no default
148
- a.namespace = 'Hello.World' # required, no default
149
- # optional
150
- a.attributes assembly_title: 'Hello.World', # generates: [<AssemblyTitle("Hello.World")>]
151
- assembly_version: '0.1.2', # generates: [<AssemblyVersion("0.1.2")>]
152
- my_product_attr: 'Hello world', # generates: [<MyProductAttr("Hello World")>]
153
- a.out = StringIO.new # optional, don't use it this way: takes an IO/Stream
154
- end
155
- ```
156
-
157
- ### Docs: test_runner
158
-
159
- TBD
160
-
161
- ### Docs: nugets_authentication
162
-
163
- TBD
164
-
165
- ### Docs: csprojfiles
166
-
167
- Checks the difference between the filesystem and the files referenced in a
168
- csproj, to make sure that they match. Run as a part of a CI build.
169
-
170
- ``` ruby
171
- desc "Check the difference between the filesystem and the files referenced in a csproj"
172
- csprojfiles do |f|
173
- # Files to ignore
174
- # for instance if you have source control specific files that are not supposed to be in the project
175
- f.ignore_files = [/.*\.srccontrol/]
176
- f.project = "src/MyMvcSite/MyMvcSite.csproj"
177
- end
178
- ```
179
-
180
- When you run this task it will report any differences between the filesystem and
181
- the csproj file.
182
-
183
- Why is this important? It's important to know what resources will be deployed.
184
- For instance if you have added an image. If you forgot to include the image in
185
- the .csproj, it will show up while developing but not when you do a web
186
- deployment (i.e. a release).
187
-
188
- It could also be that you have deleted a file, but forgotten to save the project
189
- when you send your latest commit to source control&hellip;
190
-
191
- How do you use it? The best way is to have it on a CI server in order to get a
192
- notification whenever it detects deviations.
193
-
194
- The task will fail with a message and rake will return with an non zero exit
195
- code. For instance if a file is missing from csproj and another from the
196
- filesystem:
197
-
198
- - Files in src/MyMvcSite/MyMvcSite.csproj but not on filesystem:
199
- file_missing_on_filesystem.cshtml
200
- + Files not in src/MyMvcSite/MyMvcSite.csproj but on filesystem:
201
- file_missing_in_csproj.png
202
-
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
+ Version 2.0 of Albacore.
6
+
7
+ This branch is the next official version. It is currently being used for
8
+ numerous builds for us and is free of known bugs. It works on RMI 1.9.3.
9
+
10
+ gem install albacore --prerelease
11
+
12
+ ## Getting Started
13
+
14
+ In a command prompt, run:
15
+
16
+ @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
17
+
18
+ Then start a new powershell, cygwin or mingw32 shell. You can now install the
19
+ Ruby framework:
20
+
21
+ cinst ruby.devkit
22
+
23
+ Now, restart your shell or reload its path variable. You now have rake
24
+ installed. Now you can install Albacore, the collection of tasktypes, tasks and
25
+ extension points aimed to make your life as a .Net developer easier:
26
+
27
+ gem install bundler
28
+
29
+ Bundler is a tool that fetches gems for you. Now, specify what ruby gems your
30
+ build will use. Create a new file, named `Gemfile`. This file should look like
31
+ this:
32
+
33
+ source 'http://rubygems.org'
34
+ gem 'albacore', '2.0.0.rc.2'
35
+
36
+ Now, install albacore from this repository by running:
37
+
38
+ bundle
39
+
40
+ In order to build your project, you need to create a `Rakefile`, with contents
41
+ like these:
42
+
43
+ ``` ruby
44
+ require 'bundler/setup'
45
+
46
+ require 'albacore'
47
+ require 'albacore/tasks/versionizer'
48
+ require 'albacore/ext/teamcity'
49
+
50
+ Albacore::Tasks::Versionizer.new :versioning
51
+
52
+ desc 'Perform fast build (warn: doesn\'t d/l deps)'
53
+ build :quick_build do |b|
54
+ b.logging = 'detailed'
55
+ b.sln = 'src/MyProj.sln'
56
+ end
57
+
58
+ desc 'restore all nugets as per the packages.config files'
59
+ nugets_restore :restore do |p|
60
+ p.out = 'src/packages'
61
+ p.exe = 'buildsupport/NuGet.exe'
62
+ end
63
+
64
+ desc 'Perform full build'
65
+ build :build => [:versioning, :restore] do |b|
66
+ b.sln = 'src/MyProj.sln'
67
+ # alt: b.file = 'src/MyProj.sln'
68
+ end
69
+
70
+ directory 'build/pkg'
71
+
72
+ desc 'package nugets - finds all projects and package them'
73
+ nugets_pack :create_nugets => ['build/pkg', :versioning, :build] do |p|
74
+ p.files = FileList['src/**/*.{csproj,fsproj,nuspec}'].
75
+ exclude(/Tests/)
76
+ p.out = 'build/pkg'
77
+ p.exe = 'buildsupport/NuGet.exe'
78
+ p.with_metadata do |m|
79
+ m.description = 'A cool nuget'
80
+ m.authors = 'Henrik'
81
+ m.version = ENV['NUGET_VERSION']
82
+ end
83
+ end
84
+
85
+ task :default => :create_nugets
86
+ ```
87
+
88
+ You can now run:
89
+
90
+ rake
91
+
92
+ ## Contributing
93
+
94
+ 1. Create a feature branch with your change:
95
+ a. With unit test
96
+ b. With feature
97
+ 1. Send a PR with that feature branch to this branch
98
+ a. Make sure TravisCI is OK with it
99
+ b. Describe your PR in English.
100
+
101
+ ## Task Types
102
+
103
+ Task types are the pre-built factories for rake tasks. They often take care of
104
+ what's slightly more complex, beyond just invoking commands.
105
+
106
+ ### Docs: build
107
+
108
+ TBD
109
+
110
+ ### Docs: nugets_pack
111
+
112
+ TBD
113
+
114
+ #### #no_project_dependencies
115
+
116
+ Cancel following of references between projects that cause nugets_pack to find and add as nuget dependencies, linked projects.
117
+
118
+ ```
119
+ # TODO
120
+ ```
121
+
122
+ ### Docs: nugets_restore
123
+
124
+ TBD
125
+
126
+ ### Docs: asmver
127
+
128
+ Generate a single file with assembly attributes. Code comments in example below
129
+ mention output in F#.
130
+
131
+ ``` ruby
132
+ asmver :asmver do |a|
133
+ a.file_path = 'src/Version.fs' # required, no default
134
+ a.namespace = 'Hello.World' # required for F#, defaults to empty string '' for C#
135
+ # optional
136
+ a.attributes assembly_title: 'Hello.World', # generates: [<AssemblyTitle("Hello.World")>]
137
+ assembly_version: '0.1.2', # generates: [<AssemblyVersion("0.1.2")>]
138
+ my_product_attr: 'Hello world', # generates: [<MyProductAttr("Hello World")>]
139
+ a.out = StringIO.new # optional, don't use it this way: takes an IO/Stream
140
+ end
141
+ ```
142
+
143
+ ### Docs: test_runner
144
+
145
+ TBD
146
+
147
+ ### Docs: nugets_authentication
148
+
149
+ TBD
150
+
151
+ ## Tasks
152
+
153
+ Tasks are things you can include that create singleton ruby tasks that are
154
+ pre-named and pre-made. As opposed to the task types, these are 'includeable'.
155
+ More info can be found in the
156
+ [README](https://github.com/Albacore/albacore/blob/clean_slate/lib/albacore/tasks/README.md).
157
+
158
+ ### Versionizer
159
+
160
+ Helper for reading a `.semver` file and moving information from that file, as
161
+ well as information from the git commit being built upon, to the execution of
162
+ rake/albacore.
163
+
164
+ Defines/sets ENV vars:
165
+
166
+ * BUILD_VERSION
167
+ * NUGET_VERSION
168
+ * FORMAL_VERSION
169
+
170
+ BUILD_VERSION s constructed as such: `.semver-file -> %Major.%minor.%patch%special.git-sha1`.
171
+
172
+ NUGET_VERSION leaves out the git commit hash.
173
+
174
+ FORMAL_VERSION uses only the integers 'major', 'minor' and 'patch'.
175
+
176
+ Publishes symbol `:build_version`.
177
+
178
+ ``` ruby
179
+ Albacore::Tasks::Versionizer.new :versioning
180
+ ```
181
+
182
+ ## Tools
183
+
184
+ Tools are auxilliary items in albacore. They do not have the same amount of
185
+ testing and are more often one-off utilities. Most of these should be moved to
186
+ being commands in an albacore binary.
187
+
188
+ ### Docs: csprojfiles
189
+
190
+ Checks the difference between the filesystem and the files referenced in a
191
+ csproj, to make sure that they match. Run as a part of a CI build.
192
+
193
+ ``` ruby
194
+ desc "Check the difference between the filesystem and the files referenced in a csproj"
195
+ csprojfiles do |f|
196
+ # Files to ignore
197
+ # for instance if you have source control specific files that are not supposed to be in the project
198
+ f.ignore_files = [/.*\.srccontrol/]
199
+ f.project = "src/MyMvcSite/MyMvcSite.csproj"
200
+ end
201
+ ```
202
+
203
+ When you run this task it will report any differences between the filesystem and
204
+ the csproj file.
205
+
206
+ Why is this important? It's important to know what resources will be deployed.
207
+ For instance if you have added an image. If you forgot to include the image in
208
+ the .csproj, it will show up while developing but not when you do a web
209
+ deployment (i.e. a release).
210
+
211
+ It could also be that you have deleted a file, but forgotten to save the project
212
+ when you send your latest commit to source control&hellip;
213
+
214
+ How do you use it? The best way is to have it on a CI server in order to get a
215
+ notification whenever it detects deviations.
216
+
217
+ The task will fail with a message and rake will return with an non zero exit
218
+ code. For instance if a file is missing from csproj and another from the
219
+ filesystem:
220
+
221
+ - Files in src/MyMvcSite/MyMvcSite.csproj but not on filesystem:
222
+ file_missing_on_filesystem.cshtml
223
+ + Files not in src/MyMvcSite/MyMvcSite.csproj but on filesystem:
224
+ file_missing_in_csproj.png
225
+
226
+ ## Ideas:
227
+
228
+ When building multiple configurations,
229
+ Build tasks should be invoked with different parameters
230
+ According to the graph of tasks to be executed
231
+
232
+ ``` ruby
233
+ require 'albacore'
234
+
235
+ Albacore.vary_by_parameters do |params|
236
+ # write to dynamic method
237
+ params.Configuration = ['Debug-Tests', 'Release']
238
+ end
239
+
240
+ build :b do |b|
241
+ b.vary_by_param 'Configuration'
242
+ end
243
+
244
+ nugets_pack :p => :b do |p|
245
+ # ...
246
+ end
247
+
248
+ task :default => :p
249
+ ```
250
+
251
+ Creating two runs
252
+ * `:b[Debug-Tests] => :p => :default` and
253
+ * `:b[Release] => :p => :default`
254
+
255
+ where only :b is invoked twice, but :p and :default are only invoked only once
256
+ each.
257
+
258
+ ---
259
+
260
+ When building services and/or web sites,
261
+ The bundling task_type should take care of packaging for deployment
262
+