Skip to content

HTTPS clone URL

Subversion checkout URL

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