Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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