public
Rubygem
Description: Apache Buildr
Homepage: http://incubator.apache.org/buildr
Clone URL: git://github.com/vic/buildr.git
Search Repo:
Now with new and improved release task

git-svn-id: https://svn.apache.org/repos/asf/incubator/buildr/trunk@631024 
13f79535-47bb-0310-9956-ffa450edef68
Assaf (author)
Mon Feb 25 14:47:20 -0800 2008
commit  47c8ca1567df31380b3aa5deab36d4f7008a48d5
tree    63d8325214c4555be4cc863a8d2d6362828c927d
parent  df5d3a345d1b36c9549f0f0b576c0641d6f5e5e6
...
1
 
 
 
 
 
 
 
...
 
1
2
3
4
5
6
7
0
@@ -1,2 +1,8 @@
0
-Apache Buildr is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
0
+Apache Buildr is an effort undergoing incubation at The Apache Software
0
+Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of
0
+all newly accepted projects until a further review indicates that the
0
+infrastructure, communications, and decision making process have stabilized in
0
+a manner consistent with other successful ASF projects. While incubation status
0
+is not necessarily a reflection of the completeness or stability of the code,
0
+it does indicate that the project has yet to be fully endorsed by the ASF.
...
82
83
84
 
 
85
86
87
88
89
90
...
94
95
96
 
97
98
99
100
101
 
 
 
 
 
102
103
 
104
105
 
106
107
108
...
119
120
121
122
 
123
124
125
...
143
144
145
146
 
147
148
149
...
157
158
159
 
 
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
...
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
 
 
 
 
198
199
200
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
203
204
205
206
207
208
209
210
211
212
213
 
 
 
 
 
 
 
 
 
 
 
214
215
 
 
216
217
218
219
220
221
222
223
224
225
 
 
 
 
226
227
228
229
 
 
 
 
 
 
 
 
230
231
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
234
235
236
 
 
 
 
 
 
 
 
 
 
 
237
238
239
240
241
242
243
244
 
 
 
 
 
 
245
246
247
248
249
250
251
252
253
254
255
 
 
 
 
 
256
257
258
259
 
 
 
260
261
262
263
 
 
 
 
 
 
 
 
264
265
266
267
268
269
270
 
 
 
271
272
273
274
275
 
 
 
 
 
 
 
 
 
276
277
278
279
280
281
282
 
 
 
 
 
 
 
 
 
 
283
 
 
 
284
285
286
287
288
289
 
 
 
 
 
 
 
 
 
 
290
291
 
 
 
 
 
 
 
 
 
292
293
294
295
296
297
298
299
300
301
302
303
 
 
 
 
304
305
 
306
307
308
309
310
311
312
313
314
315
 
 
 
 
 
 
 
 
316
317
318
319
320
321
 
 
 
 
 
 
 
 
 
 
 
 
 
322
 
 
 
323
 
 
...
82
83
84
85
86
87
88
89
90
91
92
...
96
97
98
99
100
101
 
 
 
102
103
104
105
106
107
 
108
109
 
110
111
112
113
...
124
125
126
 
127
128
129
130
...
148
149
150
 
151
152
153
154
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
188
189
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
192
193
194
195
 
 
 
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
 
 
 
 
 
 
 
 
 
 
214
215
216
217
218
219
220
221
222
223
224
225
 
226
227
228
 
 
 
 
 
 
 
 
 
229
230
231
232
233
 
234
 
235
236
237
238
239
240
241
242
243
 
 
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
 
 
 
260
261
262
263
264
265
266
267
268
269
270
271
 
 
 
 
 
 
 
272
273
274
275
276
277
278
279
 
 
 
 
 
 
 
 
 
280
281
282
283
284
285
286
 
 
287
288
289
290
 
 
291
292
293
294
295
296
297
298
299
300
 
 
 
 
 
 
301
302
303
304
 
 
 
 
305
306
307
308
309
310
311
312
313
314
 
 
 
 
 
 
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
 
 
 
 
 
330
331
332
333
334
335
336
337
338
339
340
 
341
342
343
344
345
346
347
348
349
350
 
 
 
 
 
 
 
 
 
 
 
351
352
353
354
355
 
356
357
 
 
 
358
359
 
 
 
 
360
361
362
363
364
365
366
367
368
369
 
 
 
 
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
0
@@ -82,6 +82,8 @@
0
 
0
 # Testing is everything.
0
 #
0
+task('clobber') { rm 'failing' rescue nil }
0
+
0
 desc 'Run all specs'
0
 Spec::Rake::SpecTask.new('spec') do |task|
0
   task.spec_files = FileList['spec/**/*_spec.rb']
0
0
0
0
@@ -94,15 +96,18 @@
0
   task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' << '--example' << 'failing'
0
 end
0
 
0
+
0
 namespace 'spec' do
0
 
0
- desc 'Run all specs and generate test/coverage reports in html directory'
0
- Spec::Rake::SpecTask.new('report') do |task|
0
- mkpath 'html'
0
+ directory('reports')
0
+ Rake::Task['rake:clobber'].enhance { rm_rf 'reports' }
0
+
0
+ desc 'Run all specs and generate specification and test coverage reports in html directory'
0
+ Spec::Rake::SpecTask.new('full'=>'reports') do |task|
0
     task.spec_files = FileList['spec/**/*_spec.rb']
0
- task.spec_opts << '--format' << 'html:html/report.html' << '--backtrace'
0
+ task.spec_opts << '--format' << 'html:reports/specs.html' << '--backtrace'
0
     task.rcov = true
0
- task.rcov_dir = 'html/coverage'
0
+ task.rcov_dir = 'reports/coverage'
0
     task.rcov_opts = ['--exclude', 'spec,bin']
0
   end
0
 
0
@@ -119,7 +124,7 @@
0
 #
0
 desc 'Generate RDoc documentation'
0
 rdoc = Rake::RDocTask.new(:rdoc) do |rdoc|
0
- rdoc.rdoc_dir = 'html/rdoc'
0
+ rdoc.rdoc_dir = 'rdoc'
0
   rdoc.title = ruby_spec.name
0
   rdoc.options = ruby_spec.rdoc_options + ['--promiscuous']
0
   rdoc.rdoc_files.include('lib/**/*.rb')
0
@@ -143,7 +148,7 @@
0
     :collection => Docter.collection('Buildr').using('doc/web.toc.yaml').
0
       include('doc/pages', 'LICENSE', 'CHANGELOG'),
0
     :template => Docter.template('doc/web.haml').
0
- include('doc/css', 'doc/images', 'doc/scripts', 'html/report.html', 'html/coverage', 'html/rdoc')
0
+ include('doc/css', 'doc/images', 'doc/scripts', 'reports/specs.html', 'reports/coverage', 'rdoc')
0
   }
0
   print_docs = {
0
     :collection => Docter.collection('Buildr').using('doc/print.toc.yaml').
0
@@ -157,6 +162,8 @@
0
 
0
   desc 'Generate HTML documentation'
0
   html = Docter::Rake.generate('html', web_docs[:collection], web_docs[:template])
0
+ html.enhance ['spec:full']
0
+
0
   desc 'Run Docter server'
0
   Docter::Rake.serve 'docter', web_docs[:collection], web_docs[:template], :port=>3000
0
   task('docs').enhance [html]
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
@@ -181,144 +188,203 @@
0
 end
0
 
0
 
0
-# Commit to SVN, upload and do the release cycle.
0
-#
0
-namespace :svn do
0
- task :clean? do |task|
0
- status = `svn status`.reject { |line| line =~ /\s(pkg|html)$/ }
0
- fail "Cannot release unless all local changes are in SVN:\n#{status}" unless status.empty?
0
- end
0
-
0
- task :tag do |task|
0
- cur_url = `svn info`.scan(/URL: (.*)/)[0][0]
0
- new_url = cur_url.sub(/(trunk$)|(branches\/\w*)$/, "tags/#{ruby_spec.version.to_s}")
0
- system 'svn', 'copy', cur_url, new_url, '-m', "Release #{ruby_spec.version.to_s}"
0
- end
0
-end
0
+namespace 'release' do
0
+ require 'highline'
0
+ require 'highline/import'
0
+ Kernel.def_delegators :$terminal, :color
0
 
0
-namespace :upload do
0
- task :docs=>'rake:docs' do |task|
0
- sh %{rsync -r --del --progress html/* people.apache.org:/www/incubator.apache.org/#{ruby_spec.rubyforge_project.downcase}/}
0
+ # This task does all prerequisites checks before starting the release, for example,
0
+ # that we have Groovy and Scala to run all the test cases, or that we have Allison
0
+ # and PrinceXML to generate the full documentation.
0
+ task 'check'
0
+ # This task does all the preparation work before making a release and also checks
0
+ # that we generate all the right material, for example, that we compiled Java sources,
0
+ # created the PDF, have coverage report.
0
+ task 'prepare'=>['clobber', 'check']
0
+
0
+ # Does CHANGELOG reflects current release?
0
+ task 'check' do
0
+ say 'Checking that CHANGELOG indicates most recent version and today\'s date ... '
0
+ expecting = "#{ruby_spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
0
+ header = File.readlines('CHANGELOG').first
0
+ fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
0
+ say 'OK'
0
   end
0
 
0
- task :packages=>['rake:docs', 'rake:package'] do |task|
0
- require 'rubyforge'
0
-
0
- # Read the changes for this release.
0
- pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
0
- changelog = File.read(__FILE__.pathmap('%d/CHANGELOG'))
0
- changes = changelog.scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash }
0
- current = changes[ruby_spec.version.to_s]
0
- if !current && ruby_spec.version.to_s =~ /\.0$/
0
- current = changes[ruby_spec.version.to_s.split('.')[0..-2].join('.')]
0
+ # License requirement.
0
+ task 'check' do
0
+ say 'Checking that files contain the Apache license ... '
0
+ directories = 'lib', 'spec', 'docs', 'bin'
0
+ ignore = 'class', 'opts'
0
+ FileList['lib/**/*', 'spec/**/*', 'bin/**', 'doc/css/*', 'doc/scripts/*'].
0
+ exclude('doc/css/eiffel.css').reject { |file| File.directory?(file) || ignore.include?(file[/[^.]*$/]) }.each do |file|
0
+ comments = File.read(file).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|<!--(.*?)-->/m).
0
+ map { |match| match.reject(&:nil?) }.flatten.join("\n")
0
+ fail "File #{file} missing Apache License, please add it before making a release!" unless
0
+ comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
0
     end
0
- fail "No changeset found for version #{ruby_spec.version}" unless current
0
+ say 'OK'
0
+ end
0
 
0
- puts "Uploading #{ruby_spec.name} #{ruby_spec.version}"
0
- files = Dir.glob('pkg/*.{gem,tgz,zip}')
0
- rubyforge = RubyForge.new
0
- rubyforge.login
0
- File.open('.changes', 'w'){|f| f.write(current)}
0
- rubyforge.userconfig.merge!('release_changes' => '.changes', 'preformatted' => true)
0
- rubyforge.add_release ruby_spec.rubyforge_project.downcase, ruby_spec.name.downcase, ruby_spec.version, *files
0
- rm '.changes'
0
- puts "Release #{ruby_spec.version} uploaded"
0
+ # No local changes.
0
+ task 'check' do
0
+ status = `svn status`
0
+ fail "Cannot release unless all local changes are in SVN:\n#{status}" unless status.empty?
0
   end
0
-end
0
 
0
-namespace :release do
0
+ # Compile Java libraries.
0
+ task 'prepare' do
0
+ say 'Compiling Java libraries ... '
0
+ FileList['lib/**/*.class'].each { |file| rm file }
0
+ `buildr compile`
0
+ FileList['lib/**/*.java'].each { |src| fail "Can't find .class file for #{src}!" unless File.exist?(src.ext('class')) }
0
+ say 'OK'
0
+ end
0
 
0
- # TODO: Check that we're using allison.
0
- # TODO: Check that we can generate PDFs.
0
+ # Tests, specs and coverage reports.
0
+ task 'check' do
0
+ say 'Checking that we have JRuby, Scala and Groovy available ... '
0
+ fail 'Full testing requires JRuby!' if `which jruby`.empty?
0
+ fail 'Full testing requires Scala!' if `which scalac`.empty? || ENV['SCALA_HOME'].to_s.empty?
0
+ fail 'Full testing requires Groovy!' if `which groovyc`.empty?
0
+ say 'OK'
0
+ end
0
+ task 'prepare' do
0
+ say 'Running test suite using JRuby ...'
0
+ task('spec:jruby').invoke
0
+ say 'Running test suite using Ruby ...'
0
+ task('spec:ruby').invoke
0
+ say 'Done'
0
+ end
0
 
0
- task :ready? do
0
- require 'highline'
0
- require 'highline/import'
0
+ # Documentation (derived from above).
0
+ task 'check' do
0
+ say 'Checking that we can use Allison and PrinceXML ... '
0
+ fail 'Release requires the Allison RDoc template, please gem install allison!' unless rdoc.template =~ /allison.rb/
0
+ fail 'Release requires PrinceXML to generate PDF documentation!' if `which prince`.empty?
0
+ say 'OK'
0
+ end
0
+ task 'prepare'=>'spec:full' do
0
+ say 'Generating RDocs and PDF ...'
0
+ task('docs').invoke
0
+ say 'Done'
0
 
0
- puts "This version: #{ruby_spec.version}"
0
- puts
0
- puts "Top 4 lines form CHANGELOG:'
0
- puts File.readlines('CHANGELOG')[0..3].map { |l| " #{l}" }
0
- puts
0
- ask('Top-entry in CHANGELOG file includes today\'s date?') =~ /yes/i or
0
- fail 'Please update CHANGELOG to include the right date'
0
+ say 'Checking that we have PDF, RDoc, specs and coverage report ... '
0
+ fail 'No RDocs if html/rdoc!' unless File.exist?('html/rdoc/files/lib/buildr_rb.html')
0
+ fail 'No PDF generated, you need to install PrinceXML!' unless File.exist?('html/buildr.pdf')
0
+ fail 'No specifications in html directory!' unless File.exist?('html/specs.html')
0
+ fail 'No coverage reports in html/coverage directory!' unless File.exist?('html/coverage/index.html')
0
+ say 'OK'
0
   end
0
 
0
- task :post do
0
- next_version = ruby_spec.version.to_ints.zip([0, 0, 1]).map { |a| a.inject(0) { |t,i| t + i } }.join('.')
0
- puts "Updating lib/buildr.rb to next version number: #{next_version}"
0
- buildr_rb = File.read(__FILE__.pathmap('%d/lib/buildr.rb')).
0
- sub(/(VERSION\s*=\s*)(['"])(.*)\2/) { |line| "#{$1}#{$2}#{next_version}#{$2}" }
0
- File.open(__FILE__.pathmap('%d/lib/buildr.rb'), 'w') { |file| file.write buildr_rb }
0
- puts 'Adding entry to CHANGELOG'
0
- changelog = File.read(__FILE__.pathmap('%d/CHANGELOG'))
0
- File.open(__FILE__.pathmap('%d/CHANGELOG'), 'w') { |file| file.write "#{next_version} (Pending)\n\n#{changelog}" }
0
+ task 'check' do
0
+ require 'rubyforge' rescue fail 'RubyForge required, please gem install rubyforge!'
0
+ fail 'GnuPG required to create signatures!' if `which gpg`.empty?
0
+ gpg_user = ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
0
+ sh('gpg', '--list-key', gpg_user) { |ok, res| ok or fail "No key matches for GPG_USER=#{gpg_user}" }
0
   end
0
 
0
- task :meat=>['clobber', 'svn:clean?', 'spec:jruby', 'spec:report', 'upload:packages', 'upload:docs', 'svn:tag']
0
-end
0
+
0
+ # Cut the release: upload Gem to RubyForge before updating site (fail safe).
0
+ task 'cut'=>['upload:rubyforge', 'upload:site']
0
 
0
-desc 'Upload release to RubyForge including docs, tag SVN'
0
-task :release=>[ 'release:ready?', 'release:meat', 'release:post' ]
0
 
0
+ namespace 'upload' do
0
+ # Upload site (html directory) to Apache.
0
+ task 'site'=>'rake:docs' do
0
+ say 'Uploading Web site to people.apache.org ... '
0
+ args = Dir.glob('html/*') + ['people.apache.org:/www/incubator.apache.org/' + ruby_spec.rubyforge_project.downcase]
0
+ verbose(false) { sh 'rsync ', '-r', '--del', '--progress', *files }
0
+ say 'Done'
0
+ end
0
 
0
-# Handles Java libraries that are part of Buildr.
0
-#
0
-task 'compile' do
0
- $LOAD_PATH.unshift File.expand_path('lib')
0
- require 'buildr'
0
- require 'buildr/jetty'
0
+ # Upload Gems to RubyForge.
0
+ task 'rubyforge'=>['rake:docs', 'rake:package'] do
0
+ require 'rubyforge'
0
 
0
- # RJB, JUnit and friends.
0
- Dir.chdir 'lib/java' do
0
- `javac -source 1.4 -target 1.4 -Xlint:all org/apache/buildr/*.java`
0
- end
0
+ # Read the changes for this release.
0
+ say 'Looking for changes between this release and previous one ... '
0
+ pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
0
+ changelog = File.read(__FILE__.pathmap('%d/CHANGELOG'))
0
+ changes = changelog.scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash }
0
+ current = changes[ruby_spec.version.to_s]
0
+ current = changes[ruby_spec.version.to_s.split('.')[0..-2].join('.')] if !current && ruby_spec.version.to_s =~ /\.0$/
0
+ fail "No changeset found for version #{ruby_spec.version}" unless current
0
+ say 'OK'
0
 
0
- # Jetty server.
0
- cp = artifacts(Buildr::Jetty::REQUIRES).each { |task| task.invoke }.map(&:name).join(File::PATH_SEPARATOR)
0
- Dir.chdir 'lib/buildr' do
0
- `javac -source 1.4 -target 1.4 -Xlint:all -cp #{cp} org/apache/buildr/*.java`
0
- end
0
-end
0
+ say "Uploading #{ruby_spec.version} to RubyForge ... "
0
+ files = Dir.glob('pkg/*.{gem,tgz,zip}')
0
+ rubyforge = RubyForge.new
0
+ rubyforge.login
0
+ File.open('.changes', 'w'){|f| f.write(current)}
0
+ rubyforge.userconfig.merge!('release_changes' => '.changes', 'preformatted' => true)
0
+ rubyforge.add_release ruby_spec.rubyforge_project.downcase, ruby_spec.name.downcase, ruby_spec.version, *files
0
+ rm '.changes'
0
+ say 'Done'
0
+ end
0
 
0
+ task 'apache'=>['rake:package'] do
0
+ require 'md5'
0
+ require 'sha1'
0
 
0
-# Apache release:
0
-# - Create MD5/SHA1/PGP signatures
0
-# - Upload to people.apache.org:/www/www.apache.org/dist/incubator/buildr
0
-#
0
-namespace 'release' do
0
+ gpg_user = ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
0
+ say 'Creating -incubating packages ... '
0
+ rm_rf 'incubating'
0
+ mkpath 'incubating'
0
+ packages = FileList['pkg/*.{gem,zip,tgz}'].map do |package|
0
+ package.pathmap('incubating/%n-incubating%x').tap do |incubating|
0
+ cp package, incubating
0
+ end
0
+ end
0
+ say 'Done'
0
 
0
- task 'prepare'=>'clobber'
0
+ say 'Signing -incubating packages ... '
0
+ files = packages.each do |package|
0
+ binary = File.read(package)
0
+ File.open(package + '.md5', 'w') { |file| file.write MD5.hexdigest(binary) << ' ' << package }
0
+ File.open(package + '.sha1', 'w') { |file| file.write SHA1.hexdigest(binary) << ' ' << package }
0
+ sh 'gpg', '--local-user', gpg_user, '--armor', '--output', package + '.asc', '--detach-sig', package, :verbose=>true
0
+ [package, package + '.md5', package + '.sha1', package + '.asc']
0
+ end
0
+ say 'Done'
0
 
0
- # Check that all source files have licenses.
0
- task 'prepare' do
0
- puts 'Checking that files contain the Apache license'
0
- directories = 'lib', 'spec', 'docs', 'bin'
0
- ignore = 'class', 'opts'
0
- FileList['lib/**/*', 'spec/**/*', 'bin/**', 'doc/css/*', 'doc/scripts/*'].
0
- exclude('doc/css/eiffel.css').reject { |file| File.directory?(file) || ignore.include?(file[/[^.]*$/]) }.each do |file|
0
- comments = File.read(file).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|<!--(.*?)-->/m).
0
- map { |match| match.reject(&:nil?) }.flatten.join("\n")
0
- fail "File #{file} missing Apache License, please add it before making a release!" unless
0
- comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
0
+ say 'Uploading packages to Apache dist ... '
0
+ args = files.flatten << 'KEYS' << 'people.apache.org:/www.apache.org/dist/incubator/buildr/'
0
+ verbose(false) { sh 'rsync', '-progress', *args }
0
+ say 'Done'
0
     end
0
- end
0
+ Rake::Task['rake:clobber'].enhance { rm_rf 'incubating' }
0
 
0
- # Compile Java libraries.
0
- task 'prepare'=>'compile' do
0
- FileList['lib/**/*.java'].each { |src| fail "Can't find .class file for #{src}!" unless File.exist?(src.ext('class')) }
0
   end
0
 
0
- # Make sure we have RDoc template, Docter and PDF genereation.
0
- task 'prepare'=>[rdoc.template, pdf] do
0
- fail 'Release requires the Allison RDoc template, please gem install allison!' unless rdoc.template =~ /allison.rb/
0
- fail 'No PDF generated, you need to install PrinceXML!' unless File.exist?('html/buildr.pdf')
0
+
0
+ # Tag this release in SVN.
0
+ task 'tag' do
0
+ say "Tagging release as tags/#{ruby_spec.version} ... "
0
+ cur_url = `svn info`.scan(/URL: (.*)/)[0][0]
0
+ new_url = cur_url.sub(/(trunk$)|(branches\/\w*)$/, "tags/#{ruby_spec.version.to_s}")
0
+ sh 'svn', 'copy', cur_url, new_url, '-m', "Release #{ruby_spec.version.to_s}", :verbose=>false
0
+ say "OK"
0
   end
0
 
0
- # Run specs on Ruby and JRuby, make sure we generate test/coverage reports.
0
- task 'prepare'=>['spec:jruby', 'spec:report'] do
0
- fail 'No test reports in html directory!' unless File.exist?('html/report.html')
0
- fail 'No coverage reports in html directory!' unless File.exist?('html/coverage/index.html')
0
+ # Update lib/buildr.rb to next vesion number, add new entry in CHANGELOG.
0
+ task 'next_version'=>'tag' do
0
+ next_version = ruby_spec.version.to_ints.zip([0, 0, 1]).map { |a| a.inject(0) { |t,i| t + i } }.join('.')
0
+ say "Updating lib/buildr.rb to next version number (#{next_version}) ... "
0
+ buildr_rb = File.read(__FILE__.pathmap('%d/lib/buildr.rb')).
0
+ sub(/(VERSION\s*=\s*)(['"])(.*)\2/) { |line| "#{$1}#{$2}#{next_version}#{$2}" }
0
+ File.open(__FILE__.pathmap('%d/lib/buildr.rb'), 'w') { |file| file.write buildr_rb }
0
+ say "OK"
0
+
0
+ say 'Adding new entry to CHANGELOG ... '
0
+ changelog = File.read(__FILE__.pathmap('%d/CHANGELOG'))
0
+ File.open(__FILE__.pathmap('%d/CHANGELOG'), 'w') { |file| file.write "#{next_version} (Pending)\n\n#{changelog}" }
0
+ say "OK"
0
   end
0
+
0
+ # Wrapup comes after cut, and does things like tagging in SVN, updating Buildr version number, etc.
0
+ task 'wrapup'=>['tag', 'next_version']
0
 end
0
+
0
+task 'release'=>['release:prepare', 'release:cut', 'release:wrapup']
...
3
4
5
6
7
8
9
10
 
 
 
 
 
 
11
12
13
...
15
16
17
 
 
 
 
 
 
 
 
 
 
...
3
4
5
 
 
 
 
 
6
7
8
9
10
11
12
13
14
...
16
17
18
19
20
21
22
23
24
25
26
27
28
0
@@ -3,11 +3,12 @@
0
 
0
 h2. Installing Buildr
0
 
0
-The easiest way to install Buildr is using the fabulous RubyGems package manager. Of course,
0
-you will need either Ruby or JRuby, and we recommend a recent version of RubyGems and
0
-if this sounds foreign to you, don't worry. We'll show you how to install Buildr on Linux,
0
-OS/X, Windows and JRuby in the "Getting Started guide":getting_started.html, we even provide
0
-automated installation scripts.
0
+The easiest way to install Buildr is using the fabulous RubyGems package
0
+manager. Of course, you will need either Ruby or JRuby, and we recommend a
0
+recent version of RubyGems and if this sounds foreign to you, don't worry.
0
+We'll show you how to install Buildr on Linux, OS/X, Windows and JRuby in the
0
+"Getting Started guide":getting_started.html, we even provide automated
0
+installation scripts.
0
 
0
 
0
 h2. Binaries and Source Code
0
@@ -15,4 +16,14 @@
0
 At the moment we do not make offical Apache binary and source distributions.
0
 Unofficial binary and source distributions are available form
0
 "RubyForge":http://rubyforge.org/projects/buildr.
0
+
0
+p(note). When downloading from a mirror please check the
0
+"md5sum":http://www.apache.org/dev/release-signing#md5 and verify the
0
+"OpenPGP":http://www.apache.org/dev/release-signing#openpgp compatible
0
+signature from the main Apache site. This
0
+"KEYS":http://www.apache.org/dist/incubator/buildr/KEYS file contains the
0
+public keys used for signing releases. It is recommended that (when possible) a
0
+web of trust is used to confirm the identity of these keys. For more
0
+information, please see the "Apache Release
0
+FAQ":http://www.apache.org/dev/release.html.
...
26
27
28
29
30
 
 
...
26
27
28
 
 
29
30
0
@@ -26,6 +26,6 @@
0
 - Project Status:
0
   - License: license.html
0
   - Change Log: changelog.html
0
- - Test Report: report.html
0
- - Test Coverage: coverage
0
+ - Specs: specs.html
0
+ - Coverage: coverage
...
13
14
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
17
18
...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -13,6 +13,27 @@
0
 # License for the specific language governing permissions and limitations under
0
 # the License.
0
 
0
+# Portion of this file derived from Rake.
0
+# Copyright (c) 2003, 2004 Jim Weirich
0
+#
0
+# Permission is hereby granted, free of charge, to any person obtaining a copy
0
+# of this software and associated documentation files (the "Software"), to deal
0
+# in the Software without restriction, including without limitation the rights
0
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0
+# copies of the Software, and to permit persons to whom the Software is
0
+# furnished to do so, subject to the following conditions:
0
+#
0
+# The above copyright notice and this permission notice shall be included in
0
+# all copies or substantial portions of the Software.
0
+#
0
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0
+# SOFTWARE.
0
+
0
 
0
 require 'benchmark'
0
 

Comments

    No one has commented yet.