Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 426 lines (345 sloc) 10.937 kb
de564de Initial revision
jimweirich authored
1 # Rakefile for rake -*- ruby -*-
2
dd80335 Added rf abbreviation.
jimweirich authored
3 # Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
47fb00b Added comments.
jimweirich authored
4 # All rights reserved.
5
ac681d3 modified rakefile to Bil Klebs suggestions
jimweirich authored
6 # This file may be distributed under an MIT style license. See
47fb00b Added comments.
jimweirich authored
7 # MIT-LICENSE for details.
8
922da4c Eric Hodel Re-exec with the local copy of rake to ensure the we're testing our code
drbrain authored
9 require 'rbconfig'
eecdaf4 Eric Hodel Replace Rake::RDocTask with RDoc::Task
drbrain authored
10 require 'rubygems'
922da4c Eric Hodel Re-exec with the local copy of rake to ensure the we're testing our code
drbrain authored
11
12 system_rake = File.join RbConfig::CONFIG['rubylibdir'], 'rake.rb'
13
14 # Use our rake, not the installed rake from system
15 if $".include? system_rake then
16 exec Gem.ruby, '-Ilib', 'bin/rake', *ARGV
17 end
18
eecdaf4 Eric Hodel Replace Rake::RDocTask with RDoc::Task
drbrain authored
19 require 'rubygems/package_task'
922da4c Eric Hodel Re-exec with the local copy of rake to ensure the we're testing our code
drbrain authored
20
2337d2a require clean was missing in the main Rakefile ... how could that be?
jimweirich authored
21 require 'rake/clean'
1bd831f Started the splitup of rubyapp into smaller, reusable components (e.g. t...
jimweirich authored
22 require 'rake/testtask'
eecdaf4 Eric Hodel Replace Rake::RDocTask with RDoc::Task
drbrain authored
23
24 begin
25 gem 'rdoc'
26 require 'rdoc/task'
27 rescue Gem::LoadError
28 end
8bd21da Broke rubyapp into smaller pieces.
jimweirich authored
29
f8d1b8b Jim Weirich Updated RBC clean extensions.
authored
30 CLEAN.include('**/*.o', '*.dot', '**/*.rbc')
e5a65e1 Added testdata to clobber.
jimweirich authored
31 CLOBBER.include('doc/example/main', 'testdata')
b819a17 Added temp files from dry run test to clobber.
jimweirich authored
32 CLOBBER.include('test/data/**/temp_*')
6f834d6 Added chains temp files to clobber list.
jimweirich authored
33 CLOBBER.include('test/data/chains/play.*')
ceb84f1 version 0.5.4.3 -- fowler directory fixes
jimweirich authored
34 CLOBBER.include('test/data/file_creation_task/build')
35 CLOBBER.include('test/data/file_creation_task/src')
df6dea6 Clobber TAGS.
jimweirich authored
36 CLOBBER.include('TAGS')
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
37 CLOBBER.include('coverage', 'rcov_aggregate')
0482ac8 The Jamis rdoc template is only used if it is present.
jimweirich authored
38
0c3268a fixed FistList order test bug. Mac extended attrs in tar. Missing subdi...
jimweirich authored
39 # Prevent OS X from including extended attribute junk in the tar output
40 ENV['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
41
da7cb40 Added release management to Rakefile
jimweirich authored
42 def announce(msg='')
43 STDERR.puts msg
44 end
0482ac8 The Jamis rdoc template is only used if it is present.
jimweirich authored
45
47fb00b Added comments.
jimweirich authored
46 # Determine the current version of the software
47
84da101 Jim Weirich Bumped to 0.9.0.beta.0
authored
48 if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9a-z.]+)$/
5e23db9 Make version detection more robust.
jimweirich authored
49 CURRENT_VERSION = $1
da7cb40 Added release management to Rakefile
jimweirich authored
50 else
51 CURRENT_VERSION = "0.0.0"
52 end
53
b2d9457 updating release procedure
jimweirich authored
54 $package_version = CURRENT_VERSION
1bd831f Started the splitup of rubyapp into smaller, reusable components (e.g. t...
jimweirich authored
55
b461240 Lines task now counts all source files.
jimweirich authored
56 SRC_RB = FileList['lib/**/*.rb']
57
47fb00b Added comments.
jimweirich authored
58 # The default task is run if rake is given no explicit arguments.
59
8bd21da Broke rubyapp into smaller pieces.
jimweirich authored
60 desc "Default Task"
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
61 task :default => :test
de564de Initial revision
jimweirich authored
62
9b9204a Changed test tasks back to using the rake provided task macros.
jimweirich authored
63 # Test Tasks ---------------------------------------------------------
1bd831f Started the splitup of rubyapp into smaller, reusable components (e.g. t...
jimweirich authored
64
538b7b7 renamed test targets
jimweirich authored
65 # Common Abbreviations ...
43d4081 Added Test abbreviations to Rakefile.
jimweirich authored
66
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
67 task :tu => "test:all"
eb6702a Jim Weirich Fixed testing shortcuts.
authored
68 task :tc => "test:contribs"
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
69 task :test => "test:all"
538b7b7 renamed test targets
jimweirich authored
70
26ce90c Jim Weirich Moved test files into file lists.
authored
71 module TestFiles
375f8e5 Eric Hodel Flatten test hierarchy by one level, change test namespace to include 'R...
drbrain authored
72 UNIT = FileList['test/test_*.rb']
26ce90c Jim Weirich Moved test files into file lists.
authored
73 CONTRIB = FileList['test/contrib/test*.rb']
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
74 ALL = UNIT + CONTRIB
26ce90c Jim Weirich Moved test files into file lists.
authored
75 end
76
a66153a Jim Weirich Fixed up test location for r19 and rbx.
authored
77 namespace :test do
78 Rake::TestTask.new(:all) do |t|
26ce90c Jim Weirich Moved test files into file lists.
authored
79 t.test_files = TestFiles::ALL
99137a8 Jim Weirich Added "." as library (for Ruby 1.9.2)
authored
80 t.libs << "."
87e39db Jim Weirich Updated quoted paths in test task code to use double quotes.
authored
81 t.warning = true
82 end
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
83
87e39db Jim Weirich Updated quoted paths in test task code to use double quotes.
authored
84 Rake::TestTask.new(:contribs) do |t|
26ce90c Jim Weirich Moved test files into file lists.
authored
85 t.test_files = TestFiles::CONTRIB
99137a8 Jim Weirich Added "." as library (for Ruby 1.9.2)
authored
86 t.libs << "."
87e39db Jim Weirich Updated quoted paths in test task code to use double quotes.
authored
87 t.warning = true
88 end
a66153a Jim Weirich Fixed up test location for r19 and rbx.
authored
89 end
f521baa Added comments to test task.
jimweirich authored
90
0c5500a Added existing and existing! methods to FileList.
jimweirich authored
91 begin
92 require 'rcov/rcovtask'
b476e3d Jim Weirich Removed XXXtask libraries from coverage consideration.
authored
93 IGNORE_COVERAGE_IN = FileList[
94 'lib/rake/rdoctask.rb',
95 'lib/rake/testtask.rb',
96 'lib/rake/packagetask.rb',
97 'lib/rake/clean.rb',
98 ]
99
100 unless File::ALT_SEPARATOR
101 IGNORE_COVERAGE_IN.include(
102 'lib/rake/alt_system.rb',
103 'lib/rake/win32.rb')
104 end
0c5500a Added existing and existing! methods to FileList.
jimweirich authored
105
106 Rcov::RcovTask.new do |t|
107 t.libs << "test"
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
108 t.rcov_opts = [
fcf0bb1 Jim Weirich some refactoring and code cleanup. Better coverage
authored
109 '-xRakefile', '-xrakefile', '-xpublish.rf',
7c9fc5b Jim Weirich Exclude rvm directories from rcov.
authored
110 '-xlib/rake/contrib', '-x/Library', '-x.rvm',
8519372 Jim Weirich improved coverage
authored
111 '--text-report',
fcf0bb1 Jim Weirich some refactoring and code cleanup. Better coverage
authored
112 '--sort coverage'
b476e3d Jim Weirich Removed XXXtask libraries from coverage consideration.
authored
113 ] + FileList['rakelib/*.rake'].pathmap("-x%p") +
114 IGNORE_COVERAGE_IN.map { |fn| "-x#{fn}" }
0c5500a Added existing and existing! methods to FileList.
jimweirich authored
115 t.test_files = FileList[
4dda757 Jim Weirich Fixed race condition in tests.
authored
116 'test/lib/*_test.rb',
117 'test/contrib/*_test.rb',
118 'test/functional/*_test.rb'
0c5500a Added existing and existing! methods to FileList.
jimweirich authored
119 ]
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
120 t.output_dir = 'coverage'
0c5500a Added existing and existing! methods to FileList.
jimweirich authored
121 t.verbose = true
122 end
123 rescue LoadError
8049c7e Jim Weirich Only complain about missing RCOV is it is actually requested.
authored
124 task :rcov do
125 puts "RCov is not available"
126 end
c8197eb added rcov and unit tests
jimweirich authored
127 end
128
de564de Initial revision
jimweirich authored
129 directory 'testdata'
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
130 ["test:all", "test:contrib"].each do |t|
a4b6d36 updated comments in est file.
jimweirich authored
131 task t => ['testdata']
132 end
47fb00b Added comments.
jimweirich authored
133
9b9204a Changed test tasks back to using the rake provided task macros.
jimweirich authored
134 # CVS Tasks ----------------------------------------------------------
47fb00b Added comments.
jimweirich authored
135
136 # Install rake using the standard install.rb script.
8bd21da Broke rubyapp into smaller pieces.
jimweirich authored
137
138 desc "Install the application"
139 task :install do
140 ruby "install.rb"
141 end
1bd831f Started the splitup of rubyapp into smaller, reusable components (e.g. t...
jimweirich authored
142
47fb00b Added comments.
jimweirich authored
143 # Create a task to build the RDOC documentation tree.
144
05ffed8 Jim Weirich Modifed Rakefile to not require darkfish for the GemSpec
authored
145 BASE_RDOC_OPTIONS = [
3bff3a1 Eric Hodel Join the future and use RDoc::Task!
drbrain authored
146 '--line-numbers', '--show-hash',
147 '--main', 'README.rdoc',
f6d26a5 Jim Weirich Updated rakefile to not generate darkfish in the gemspec.
authored
148 '--title', 'Rake -- Ruby Make'
05ffed8 Jim Weirich Modifed Rakefile to not require darkfish for the GemSpec
authored
149 ]
150
3bff3a1 Eric Hodel Join the future and use RDoc::Task!
drbrain authored
151 if defined?(RDoc::Task) then
152 RDoc::Task.new do |rdoc|
153 rdoc.rdoc_dir = 'html'
154 rdoc.title = "Rake -- Ruby Make"
155 rdoc.options = BASE_RDOC_OPTIONS.dup
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
156
3bff3a1 Eric Hodel Join the future and use RDoc::Task!
drbrain authored
157 rdoc.rdoc_files.include('README.rdoc', 'MIT-LICENSE', 'TODO', 'CHANGES')
158 rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
159 rdoc.rdoc_files.exclude(/\bcontrib\b/)
160 end
161 else
162 warn "RDoc 2.4.2+ is required to build documentation"
9c4d005 Jim Weirich added ability to use darkfish-rdoc if installed.
authored
163 end
47fb00b Added comments.
jimweirich authored
164
686d615 Added RubyGem support.
jimweirich authored
165 # ====================================================================
47fb00b Added comments.
jimweirich authored
166 # Create a task that will package the Rake software into distributable
686d615 Added RubyGem support.
jimweirich authored
167 # tar, zip and gem files.
168
169 PKG_FILES = FileList[
cb95956 Eric Hodel Be sure to package the .gemtest file too
drbrain authored
170 '.gemtest',
686d615 Added RubyGem support.
jimweirich authored
171 'install.rb',
172 '[A-Z]*',
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
173 'bin/**/*',
174 'lib/**/*.rb',
686d615 Added RubyGem support.
jimweirich authored
175 'test/**/*.rb',
ea538b2 Added explicit test task.
jimweirich authored
176 'test/**/*.rf',
177 'test/**/*.mf',
178 'test/**/Rakefile',
0c3268a fixed FistList order test bug. Mac extended attrs in tar. Missing subdi...
jimweirich authored
179 'test/**/subdir',
686d615 Added RubyGem support.
jimweirich authored
180 'doc/**/*'
181 ]
4649238 removed temporary examples files from package spec
jimweirich authored
182 PKG_FILES.exclude('doc/example/*.o')
7ed9580 Jim Weirich Fixed gemspec to exclude TAGS file.
authored
183 PKG_FILES.exclude('TAGS')
4649238 removed temporary examples files from package spec
jimweirich authored
184 PKG_FILES.exclude(%r{doc/example/main$})
686d615 Added RubyGem support.
jimweirich authored
185
40ccfa2 Make RubyGems optional, but wont build packages without it.
jimweirich authored
186 if ! defined?(Gem)
187 puts "Package Target requires RubyGEMs"
188 else
4aaefed Added an explicit gemspec to the repo (for github gems)
jimweirich authored
189 SPEC = Gem::Specification.new do |s|
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
190
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
191 #### Basic information.
192
40ccfa2 Make RubyGems optional, but wont build packages without it.
jimweirich authored
193 s.name = 'rake'
b2d9457 updating release procedure
jimweirich authored
194 s.version = $package_version
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
195 s.summary = "Ruby based make-like utility."
196 s.description = <<-EOF
197 Rake is a Make-like program implemented in Ruby. Tasks
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
198 and dependencies are specified in standard Ruby syntax.
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
199 EOF
200
201 #### Dependencies and requirements.
202
e13d857 Eric Hodel Update Rakefile to use Gem::PackageTask
drbrain authored
203 s.required_rubygems_version = '>= 1.3.2'
4ec139d Eric Hodel Add development dependencies for rake
drbrain authored
204 s.add_development_dependency 'session', '~> 2.4'
205 s.add_development_dependency 'flexmock', '~> 0.8.11'
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
206
207 #### Which files are to be included in this gem? Everything! (Except CVS directories.)
208
0c88263 fixed gem building
jimweirich authored
209 s.files = PKG_FILES.to_a
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
210
211 #### C code extensions.
212
213 #s.extensions << "ext/rmagic/extconf.rb"
214
215 #### Load-time details: library and application (you will need one or both).
216
217 s.require_path = 'lib' # Use these for libraries.
218
219 s.bindir = "bin" # Use these for applications.
220 s.executables = ["rake"]
221
222 #### Documentation and testing.
223
3bff3a1 Eric Hodel Join the future and use RDoc::Task!
drbrain authored
224 s.extra_rdoc_files = FileList[
225 'README.rdoc',
226 'MIT-LICENSE',
227 'TODO',
228 'CHANGES',
229 'doc/**/*.rdoc'
230 ]
231
05ffed8 Jim Weirich Modifed Rakefile to not require darkfish for the GemSpec
authored
232 s.rdoc_options = BASE_RDOC_OPTIONS
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
233
234 #### Author and project details.
235
236 s.author = "Jim Weirich"
237 s.email = "jim@weirichhouse.org"
50e3ca7 pointed gem web page reference to the rake rubyforge page.
jimweirich authored
238 s.homepage = "http://rake.rubyforge.org"
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
239 s.rubyforge_project = "rake"
618a61c Commented out the cert file stuff until rubygems fixes signing problem.
jimweirich authored
240 # if ENV['CERT_DIR']
241 # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
242 # s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
243 # end
40ccfa2 Make RubyGems optional, but wont build packages without it.
jimweirich authored
244 end
44fa75b Updated the gem spec to use almost all the options.
jimweirich authored
245
7849e27 Jim Weirich Removed unused variables from Rakefile
authored
246 Gem::PackageTask.new(SPEC) do |pkg|
40ccfa2 Make RubyGems optional, but wont build packages without it.
jimweirich authored
247 pkg.need_zip = true
248 pkg.need_tar = true
249 end
4aaefed Added an explicit gemspec to the repo (for github gems)
jimweirich authored
250
eecc1ee Jim Weirich bumped to version 0.8.1.7
authored
251 file "rake.gemspec" => ["Rakefile", "lib/rake.rb"] do |t|
4aaefed Added an explicit gemspec to the repo (for github gems)
jimweirich authored
252 require 'yaml'
253 open(t.name, "w") { |f| f.puts SPEC.to_yaml }
254 end
255
ad2a721 bumped to version 0.8.1.6
jimweirich authored
256 desc "Create a stand-alone gemspec"
4aaefed Added an explicit gemspec to the repo (for github gems)
jimweirich authored
257 task :gemspec => "rake.gemspec"
0a5d4ac updated docs and comments. getting ready for 0.3.0
jimweirich authored
258 end
91ac08e Minor change.
jimweirich authored
259
686d615 Added RubyGem support.
jimweirich authored
260 # Misc tasks =========================================================
261
b461240 Lines task now counts all source files.
jimweirich authored
262 def count_lines(filename)
686d615 Added RubyGem support.
jimweirich authored
263 lines = 0
264 codelines = 0
b461240 Lines task now counts all source files.
jimweirich authored
265 open(filename) { |f|
266 f.each do |line|
686d615 Added RubyGem support.
jimweirich authored
267 lines += 1
268 next if line =~ /^\s*$/
269 next if line =~ /^\s*#/
270 codelines += 1
271 end
272 }
b461240 Lines task now counts all source files.
jimweirich authored
273 [lines, codelines]
274 end
275
276 def show_line(msg, lines, loc)
277 printf "%6s %6s %s\n", lines.to_s, loc.to_s, msg
278 end
279
280 desc "Count lines in the main rake file"
281 task :lines do
282 total_lines = 0
283 total_code = 0
284 show_line("File Name", "LINES", "LOC")
285 SRC_RB.each do |fn|
286 lines, codelines = count_lines(fn)
287 show_line(fn, lines, codelines)
288 total_lines += lines
289 total_code += codelines
290 end
291 show_line("TOTAL", total_lines, total_code)
686d615 Added RubyGem support.
jimweirich authored
292 end
293
47fb00b Added comments.
jimweirich authored
294 # Define an optional publish target in an external file. If the
295 # publish.rf file is not found, the publish targets won't be defined.
8934145 make contrib_test of sys work
jimweirich authored
296
297 load "publish.rf" if File.exist? "publish.rf"
b412f1a Added support tasks to Rakefile: dbg, todo, and rubyfiles
jimweirich authored
298
299 # Support Tasks ------------------------------------------------------
300
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
301 RUBY_FILES = FileList['**/*.rb'].exclude('pkg')
302
b412f1a Added support tasks to Rakefile: dbg, todo, and rubyfiles
jimweirich authored
303 desc "Look for TODO and FIXME tags in the code"
304 task :todo do
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
305 RUBY_FILES.egrep(/#.*(FIXME|TODO|TBD)/)
b412f1a Added support tasks to Rakefile: dbg, todo, and rubyfiles
jimweirich authored
306 end
307
308 desc "List all ruby files"
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
309 task :rubyfiles do
e462afc Changes to get 100% code coverage in main rake.rb file.
jimweirich authored
310 puts RUBY_FILES
311 puts FileList['bin/*'].exclude('bin/*.rb')
b412f1a Added support tasks to Rakefile: dbg, todo, and rubyfiles
jimweirich authored
312 end
dd80335 Added rf abbreviation.
jimweirich authored
313 task :rf => :rubyfiles
da7cb40 Added release management to Rakefile
jimweirich authored
314
315 # --------------------------------------------------------------------
316 # Creating a release
317
d800e9b added dependency cycle detection
jimweirich authored
318 def plugin(plugin_name)
319 require "rake/plugins/#{plugin_name}"
320 end
321
322 task :noop
323 #plugin "release_manager"
324
32fef52 Changed argument specification to use task command rather than desc comm...
jimweirich authored
325 desc "Make a new release"
4ab3c72 Jim Weirich Removed deprecated argument usage from Rakefile.
authored
326 task :release, [:rel, :reuse, :reltest] => [
32fef52 Changed argument specification to use task command rather than desc comm...
jimweirich authored
327 :prerelease,
328 :clobber,
a4cceae Eric Hodel Move functional tests up to test/ and always run them
drbrain authored
329 :test,
32fef52 Changed argument specification to use task command rather than desc comm...
jimweirich authored
330 :update_version,
331 :package,
332 :tag
333 ] do
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
334 announce
da7cb40 Added release management to Rakefile
jimweirich authored
335 announce "**************************************************************"
b2d9457 updating release procedure
jimweirich authored
336 announce "* Release #{$package_version} Complete."
da7cb40 Added release management to Rakefile
jimweirich authored
337 announce "* Packages ready to upload."
338 announce "**************************************************************"
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
339 announce
da7cb40 Added release management to Rakefile
jimweirich authored
340 end
341
342 # Validate that everything is ready to go for a release.
d34cb91 Ready for release
jimweirich authored
343 task :prerelease, :rel, :reuse, :reltest do |t, args|
344 $package_version = args.rel
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
345 announce
da7cb40 Added release management to Rakefile
jimweirich authored
346 announce "**************************************************************"
b2d9457 updating release procedure
jimweirich authored
347 announce "* Making RubyGem Release #{$package_version}"
da7cb40 Added release management to Rakefile
jimweirich authored
348 announce "* (current version #{CURRENT_VERSION})"
349 announce "**************************************************************"
2365bd2 Eric Hodel Remove trailing whitespace from rake
drbrain authored
350 announce
da7cb40 Added release management to Rakefile
jimweirich authored
351
352 # Is a release number supplied?
d34cb91 Ready for release
jimweirich authored
353 unless args.rel
b2d9457 updating release procedure
jimweirich authored
354 fail "Usage: rake release[X.Y.Z] [REUSE=tag_suffix]"
da7cb40 Added release management to Rakefile
jimweirich authored
355 end
356
357 # Is the release different than the current release.
358 # (or is REUSE set?)
d34cb91 Ready for release
jimweirich authored
359 if $package_version == CURRENT_VERSION && ! args.reuse
b2d9457 updating release procedure
jimweirich authored
360 fail "Current version is #{$package_version}, must specify REUSE=tag_suffix to reuse version"
da7cb40 Added release management to Rakefile
jimweirich authored
361 end
362
363 # Are all source files checked in?
d34cb91 Ready for release
jimweirich authored
364 if args.reltest
da7cb40 Added release management to Rakefile
jimweirich authored
365 announce "Release Task Testing, skipping checked-in file test"
366 else
367 announce "Checking for unchecked-in files..."
b2d9457 updating release procedure
jimweirich authored
368 data = `svn st`
da7cb40 Added release management to Rakefile
jimweirich authored
369 unless data =~ /^$/
b2d9457 updating release procedure
jimweirich authored
370 abort "svn status is not clean ... do you have unchecked-in files?"
da7cb40 Added release management to Rakefile
jimweirich authored
371 end
372 announce "No outstanding checkins found ... OK"
373 end
374 end
375
4ab3c72 Jim Weirich Removed deprecated argument usage from Rakefile.
authored
376 task :update_version, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
d34cb91 Ready for release
jimweirich authored
377 if args.rel == CURRENT_VERSION
da7cb40 Added release management to Rakefile
jimweirich authored
378 announce "No version change ... skipping version update"
379 else
d34cb91 Ready for release
jimweirich authored
380 announce "Updating Rake version to #{args.rel}"
4c1c728 pre-tag commit
jimweirich authored
381 open("lib/rake.rb") do |rakein|
382 open("lib/rake.rb.new", "w") do |rakeout|
68c7a8c Eric Hodel Fix indentation
drbrain authored
383 rakein.each do |line|
384 if line =~ /^RAKEVERSION\s*=\s*/
385 rakeout.puts "RAKEVERSION = '#{args.rel}'"
386 else
387 rakeout.puts line
388 end
389 end
4c1c728 pre-tag commit
jimweirich authored
390 end
da7cb40 Added release management to Rakefile
jimweirich authored
391 end
4c1c728 pre-tag commit
jimweirich authored
392 mv "lib/rake.rb.new", "lib/rake.rb"
d34cb91 Ready for release
jimweirich authored
393 if args.reltest
da7cb40 Added release management to Rakefile
jimweirich authored
394 announce "Release Task Testing, skipping commiting of new version"
395 else
d34cb91 Ready for release
jimweirich authored
396 sh %{svn commit -m "Updated to version #{args.rel}" lib/rake.rb} # "
da7cb40 Added release management to Rakefile
jimweirich authored
397 end
398 end
399 end
400
32fef52 Changed argument specification to use task command rather than desc comm...
jimweirich authored
401 desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
4ab3c72 Jim Weirich Removed deprecated argument usage from Rakefile.
authored
402 task :tag, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
d34cb91 Ready for release
jimweirich authored
403 reltag = "REL_#{args.rel.gsub(/\./, '_')}"
404 reltag << args.reuse.gsub(/\./, '_') if args.reuse
178f8db working on release task
jimweirich authored
405 announce "Tagging Repository with [#{reltag}]"
d34cb91 Ready for release
jimweirich authored
406 if args.reltest
da7cb40 Added release management to Rakefile
jimweirich authored
407 announce "Release Task Testing, skipping CVS tagging"
408 else
32fef52 Changed argument specification to use task command rather than desc comm...
jimweirich authored
409 sh %{svn copy svn+ssh://rubyforge.org/var/svn/rake/trunk svn+ssh://rubyforge.org/var/svn/rake/tags/#{reltag} -m 'Commiting release #{reltag}'} ###'
da7cb40 Added release management to Rakefile
jimweirich authored
410 end
411 end
df6dea6 Clobber TAGS.
jimweirich authored
412
413 # Require experimental XForge/Metaproject support.
414
415 load 'xforge.rf' if File.exist?('xforge.rf')
3210a02 Added require rubygems to a test, cleaning dot files, parameterized tar
jimweirich authored
416
d1f89d7 added task parameters, named parameter via desc, column limited output
jimweirich authored
417 desc "Where is the current directory. This task displays\nthe current rake directory"
3210a02 Added require rubygems to a test, cleaning dot files, parameterized tar
jimweirich authored
418 task :where_am_i do
419 puts Rake.original_dir
420 end
de46c07 Jim Weirich Task invocation chain now printed on errors.
authored
421
422 task :failure => :really_fail
423 task :really_fail do
424 fail "oops"
425 end
Something went wrong with that request. Please try again.