Rakefile in facter-1.0.1 vs Rakefile in facter-1.1.1
- old
+ new
@@ -1,12 +1,12 @@
# Rakefile for facter
begin
- require 'rubygems'
- require 'rake/gempackagetask'
+ require 'rubygems'
+ require 'rake/gempackagetask'
rescue Exception
- nil
+ nil
end
require 'rake/clean'
require 'rake/testtask'
@@ -30,67 +30,69 @@
PKG_VERSION = ENV['REL']
else
PKG_VERSION = CURRENT_VERSION
end
+DOWNDIR = "/export/docroots/reductivelabs.com/htdocs/downloads"
# The default task is run if rake is given no explicit arguments.
desc "Default Task"
task :default => :unittests
# Test Tasks ---------------------------------------------------------
-task :u => :unittests
-task :a => :alltests
+#task :u => :unittests
+#task :a => :alltests
-task :alltests => :unittests
+#task :alltests => :unittests
-Rake::TestTask.new(:unittests) do |t|
- t.test_files = FileList['tests/tc*.rb']
- t.warning = true
- t.verbose = false
-end
+#Rake::TestTask.new(:unittests) do |t|
+# t.test_files = FileList['tests/*.rb']
+# t.warning = true
+# t.verbose = false
+#end
# SVN Tasks ----------------------------------------------------------
# ... none.
# Install rake using the standard install.rb script.
desc "Install the application"
task :install do
- ruby "install.rb"
+ ruby "install.rb"
end
# Create a task to build the RDOC documentation tree.
-rd = Rake::RDocTask.new("rdoc") { |rdoc|
- rdoc.rdoc_dir = 'html'
- rdoc.template = 'css2'
- rdoc.title = "Facter"
- rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
- rdoc.rdoc_files.include('README', 'LICENSE', 'TODO', 'CHANGES')
- rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
+rd = Rake::RDocTask.new(:html) { |rdoc|
+ rdoc.rdoc_dir = 'html'
+ rdoc.template = 'html'
+ rdoc.title = "Facter"
+ rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
+ rdoc.rdoc_files.include('README', 'LICENSE', 'TODO', 'CHANGES')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ CLEAN.include("html")
}
# ====================================================================
# Create a task that will package the Rake software into distributable
# tar, zip and gem files.
PKG_FILES = FileList[
- 'install.rb',
- '[A-Z]*',
- 'bin/**/*',
- 'lib/**/*.rb',
- 'test/**/*.rb',
- 'doc/**/*',
- 'etc/*'
+ 'install.rb',
+ '[A-Z]*',
+ 'bin/**/*',
+ 'lib/**/*.rb',
+ 'test/**/*.rb',
+ 'doc/**/*',
+ 'etc/*'
]
PKG_FILES.delete_if {|item| item.include?(".svn")}
if ! defined?(Gem)
- puts "Package Target requires RubyGEMs"
+ puts "Package Target requires RubyGEMs"
else
spec = Gem::Specification.new do |s|
#### Basic information.
@@ -136,10 +138,12 @@
Rake::GemPackageTask.new(spec) do |pkg|
#pkg.need_zip = true
pkg.need_tar = true
end
+
+ CLEAN.include("pkg")
end
# Misc tasks =========================================================
#ARCHIVEDIR = '/...'
@@ -190,14 +194,15 @@
desc "Make a new release"
task :release => [
:prerelease,
:clobber,
- :alltests,
:update_version,
+ :tag,
:package,
- :tag] do
+ :copy] do
+ #:alltests,
announce
announce "**************************************************************"
announce "* Release #{PKG_VERSION} Complete."
announce "* Packages ready to upload."
@@ -244,11 +249,11 @@
else
announce "Updating Facter version to #{PKG_VERSION}"
open("lib/facter.rb") do |rakein|
open("lib/facter.rb.new", "w") do |rakeout|
rakein.each do |line|
- if line =~ /^FACTERVERSION\s*=\s*/
+ if line =~ /^\s*FACTERVERSION\s*=\s*/
rakeout.puts "FACTERVERSION = '#{PKG_VERSION}'"
else
rakeout.puts line
end
end
@@ -269,9 +274,20 @@
reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
announce "Tagging SVN copy with [#{reltag}]"
if ENV['RELTEST']
announce "Release Task Testing, skipping SVN tagging"
else
- #sh %{svn copy trunk/ tags/#{reltag}}
+ sh %{svn copy ../trunk/ ../tags/#{reltag}}
+ sh %{cd ../tags; svn ci -m 'Adding Release tag #{reltag}'}
end
end
+desc "Copy the newly created package into the downloads directory"
+task :copy => [:package, :html] do
+ sh %{cp pkg/facter-#{PKG_VERSION}.gem #{DOWNDIR}/gems}
+ sh %{generate_yaml_index.rb -d #{DOWNDIR}}
+ sh %{cp pkg/facter-#{PKG_VERSION}.tgz #{DOWNDIR}/facter}
+ sh %{ln -sf facter-#{PKG_VERSION}.tgz #{DOWNDIR}/facter/facter-latest.tgz}
+ sh %{cp -r html #{DOWNDIR}/facter/apidocs}
+end
+
+# $Id$