Rakefile in rake-0.6.2 vs Rakefile in rake-0.7.0
- old
+ new
@@ -1,8 +1,8 @@
# Rakefile for rake -*- ruby -*-
-# Copyright 2003, 2004 by Jim Weirich (jim@weirichhouse.org)
+# Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
# All rights reserved.
# This file is may be distributed under an MIT style license. See
# MIT-LICENSE for details.
@@ -28,68 +28,69 @@
STDERR.puts msg
end
# Determine the current version of the software
-if `ruby -Ilib ./bin/rake --version` =~ /\S+$/
- CURRENT_VERSION = $&
+if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9.]+)$/
+ CURRENT_VERSION = $1
else
CURRENT_VERSION = "0.0.0"
end
if ENV['REL']
PKG_VERSION = ENV['REL']
else
PKG_VERSION = CURRENT_VERSION
end
-
SRC_RB = FileList['lib/**/*.rb']
# The default task is run if rake is given no explicit arguments.
desc "Default Task"
-task :default => :alltests
+task :default => :test_all
# Test Tasks ---------------------------------------------------------
-task :ta => :alltests
-task :tf => :funtests
-task :tu => :unittests
-task :tc => :contribtests
-task :test => :unittests
+# Common Abbreviations ...
-Rake::TestTask.new(:alltests) do |t|
+task :ta => :test_all
+task :tf => :test_functional
+task :tu => :test_units
+task :tc => :test_contribs
+task :test => :test_units
+
+Rake::TestTask.new(:test_all) do |t|
t.test_files = FileList[
'test/test*.rb',
'test/contrib/test*.rb',
'test/fun*.rb'
]
t.warning = true
t.verbose = true
end
-Rake::TestTask.new(:unittests) do |t|
+Rake::TestTask.new(:test_units) do |t|
t.test_files = FileList['test/test*.rb']
t.warning = true
t.verbose = false
end
-Rake::TestTask.new(:funtests) do |t|
+Rake::TestTask.new(:test_functional) do |t|
t.test_files = FileList['test/fun*.rb']
t.warning = true
t.warning = true
end
-Rake::TestTask.new(:contribtests) do |t|
+Rake::TestTask.new(:test_contribs) do |t|
t.test_files = FileList['test/contrib/test*.rb']
t.verbose = false
t.warning = true
end
directory 'testdata'
-[:alltests, :unittests, :contribtests, :funtests].each do |t|
+[:test_all, :test_units, :test_contribs, :test_functional].each do |t|
task t => ['testdata']
end
# CVS Tasks ----------------------------------------------------------
@@ -104,11 +105,11 @@
rd = Rake::RDocTask.new("rdoc") { |rdoc|
rdoc.rdoc_dir = 'html'
# rdoc.template = 'kilmer'
# rdoc.template = 'css2'
- rdoc.template = 'doc/jamis.rb'
+ rdoc.template = '/home/jim/working/rubyforge/rake/doc/jamis.rb'
rdoc.title = "Rake -- Ruby Make"
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
rdoc.rdoc_files.exclude(/\bcontrib\b/)
@@ -255,19 +256,20 @@
desc "List all ruby files"
task :rubyfiles do
puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
puts Dir['bin/*'].reject { |fn| fn =~ /CVS|(~$)|(\.rb$)/ }
end
+task :rf => :rubyfiles
# --------------------------------------------------------------------
# Creating a release
desc "Make a new release"
task :release => [
:prerelease,
:clobber,
- :alltests,
+ :test_all,
:update_version,
:package,
:tag] do
announce
@@ -344,9 +346,17 @@
if ENV['RELTEST']
announce "Release Task Testing, skipping CVS tagging"
else
sh %{cvs tag #{reltag}}
end
+end
+
+desc "Install the jamis RDoc template"
+task :install_jamis_template do
+ require 'rbconfig'
+ dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
+ fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
+ install "doc/jamis.rb", dest_dir, :verbose => true
end
# Require experimental XForge/Metaproject support.
load 'xforge.rf' if File.exist?('xforge.rf')