Rakefile
author Michael Granger <ged@FaerieMUD.org>
Thu, 16 Oct 2008 02:43:08 +0000
changeset 2 0c24586f579a
parent 0 92d00ff32c56
child 3 7f6da371e2ce
permissions -rw-r--r--
Checkpoint commit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     1
#!rake
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     2
#
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     3
# jparallel rakefile
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     4
#
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     5
# Based on various other Rakefiles, especially one by Ben Bleything
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     6
#
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     7
# Copyright (c) 2008 The FaerieMUD Consortium
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     8
#
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     9
# Authors:
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    10
#  * Michael Granger and Mahlon Smith <ged@FaerieMUD.org, mahlon@martini.nu>
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    11
#
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    12
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    13
BEGIN {
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    14
	require 'pathname'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    15
	basedir = Pathname.new( __FILE__ ).dirname
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    16
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    17
	libdir = basedir + "lib"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    18
	extdir = basedir + "ext"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    19
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    20
	$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    21
	$LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    22
}
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    23
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    24
require 'rubygems'
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    25
gem 'rake', '>= 0.8.3'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    26
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    27
require 'rbconfig'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    28
require 'rake'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    29
require 'rake/rdoctask'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    30
require 'rake/testtask'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    31
require 'rake/packagetask'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    32
require 'rake/clean'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    33
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    34
$dryrun = false
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    35
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    36
### Config constants
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    37
BASEDIR       = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    38
BINDIR        = BASEDIR + 'bin'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    39
LIBDIR        = BASEDIR + 'lib'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    40
EXTDIR        = BASEDIR + 'ext'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    41
DOCSDIR       = BASEDIR + 'docs'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    42
PKGDIR        = BASEDIR + 'pkg'
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    43
DATADIR       = BASEDIR + 'data'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    44
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    45
PROJECT_NAME  = 'jparallel'
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    46
PKG_NAME      = PROJECT_NAME.downcase
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    47
PKG_SUMMARY   = 'A "parallel jail shell" written in Ruby'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    48
VERSION_FILE  = LIBDIR + 'jparallel.rb'
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    49
PKG_VERSION   = VERSION_FILE.read[ /VERSION\s*=\s*'(\d+\.\d+\.\d+)'/, 1 ]
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    50
PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    51
GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    52
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    53
ARTIFACTS_DIR = Pathname.new( ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    54
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    55
TEXT_FILES    = %w( Rakefile ChangeLog README LICENSE ).collect {|filename| BASEDIR + filename }
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    56
BIN_FILES     = Pathname.glob( BINDIR + '*' ).delete_if {|item| item =~ /\.svn/ }
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    57
LIB_FILES     = Pathname.glob( LIBDIR + '**/*.rb' ).delete_if {|item| item =~ /\.svn/ }
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    58
EXT_FILES     = Pathname.glob( EXTDIR + '**/*.{c,h,rb}' ).delete_if {|item| item =~ /\.svn/ }
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    59
DATA_FILES    = Pathname.glob( DATADIR + '**/*' ).delete_if {|item| item =~ /\.svn/ }
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    60
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    61
SPECDIR       = BASEDIR + 'spec'
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    62
SPECLIBDIR    = SPECDIR + 'lib'
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    63
SPEC_FILES    = Pathname.glob( SPECDIR + '**/*_spec.rb' ).delete_if {|item| item =~ /\.svn/ } +
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    64
                Pathname.glob( SPECLIBDIR + '**/*.rb' ).delete_if {|item| item =~ /\.svn/ }
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    65
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    66
TESTDIR       = BASEDIR + 'tests'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    67
TEST_FILES    = Pathname.glob( TESTDIR + '**/*.tests.rb' ).delete_if {|item| item =~ /\.svn/ }
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    68
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    69
RAKE_TASKDIR  = BASEDIR + 'rake'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    70
RAKE_TASKLIBS = Pathname.glob( RAKE_TASKDIR + '*.rb' )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    71
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    72
LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    73
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    74
EXTRA_PKGFILES = []
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    75
EXTRA_PKGFILES.concat Pathname.glob( BASEDIR + 'examples/*.{c,rb}' ).delete_if {|item| item =~ /\.svn/ } 
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    76
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    77
RELEASE_FILES = TEXT_FILES + 
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    78
	SPEC_FILES + 
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    79
	TEST_FILES + 
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    80
	BIN_FILES +
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    81
	LIB_FILES + 
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    82
	EXT_FILES + 
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    83
	DATA_FILES + 
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    84
	RAKE_TASKLIBS +
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    85
	EXTRA_PKGFILES
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    86
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    87
RELEASE_FILES << LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    88
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    89
COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    90
RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    91
RCOV_OPTS = [
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    92
	'--exclude', RCOV_EXCLUDES,
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    93
	'--xrefs',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    94
	'--save',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    95
	'--callsites',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    96
	#'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    97
  ]
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    98
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    99
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   100
# Subversion constants -- directory names for releases and tags
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   101
SVN_TRUNK_DIR    = 'trunk'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   102
SVN_RELEASES_DIR = 'releases'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   103
SVN_BRANCHES_DIR = 'branches'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   104
SVN_TAGS_DIR     = 'tags'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   105
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   106
SVN_DOTDIR       = BASEDIR + '.svn'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   107
SVN_ENTRIES      = SVN_DOTDIR + 'entries'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   108
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   109
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   110
### Load some task libraries that need to be loaded early
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   111
require RAKE_TASKDIR + 'helpers.rb'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   112
require RAKE_TASKDIR + 'svn.rb'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   113
require RAKE_TASKDIR + 'verifytask.rb'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   114
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   115
# Define some constants that depend on the 'svn' tasklib
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   116
PKG_BUILD = get_svn_rev( BASEDIR ) || 0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   117
SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   118
SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   119
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   120
# Documentation constants
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   121
RDOCDIR = DOCSDIR + 'api'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   122
RDOC_OPTIONS = [
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   123
	'-w', '4',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   124
	'-SHN',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   125
	'-i', '.',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   126
	'-m', 'README',
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   127
	'-W', 'http://deveiate.org/projects/Jparallel//browser/trunk/'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   128
  ]
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   129
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   130
# Release constants
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   131
SMTP_HOST = 'mail.faeriemud.org'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   132
SMTP_PORT = 465 # SMTP + SSL
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   133
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   134
# Project constants
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   135
PROJECT_HOST = 'deveiate.org'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   136
PROJECT_PUBDIR = "/usr/local/www/public/code"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   137
PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   138
PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   139
PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   140
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   141
# Rubyforge stuff
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   142
RUBYFORGE_GROUP = 'deveiate'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   143
RUBYFORGE_PROJECT = 'jparallel'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   144
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   145
# Gem dependencies: gemname => version
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   146
DEPENDENCIES = {
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   147
}
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   148
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   149
# Developer Gem dependencies: gemname => version
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   150
DEVELOPMENT_DEPENDENCIES = {
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   151
	'amatch'      => '>= 0.2.3',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   152
	'rake'        => '>= 0.8.1',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   153
	'rcodetools'  => '>= 0.7.0.0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   154
	'rcov'        => '>= 0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   155
	'RedCloth'    => '>= 4.0.3',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   156
	'rspec'       => '>= 0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   157
	'rubyforge'   => '>= 0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   158
	'termios'     => '>= 0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   159
	'text-format' => '>= 1.0.0',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   160
	'tmail'       => '>= 1.2.3.1',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   161
	'ultraviolet' => '>= 0.10.2',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   162
	'libxml-ruby' => '>= 0.8.3',
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   163
}
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   164
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   165
# Non-gem requirements: packagename => version
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   166
REQUIREMENTS = {
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   167
	'FreeBSD' => '>= 5.0',
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   168
}
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   169
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   170
# RubyGem specification
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   171
GEMSPEC   = Gem::Specification.new do |gem|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   172
	gem.name              = PKG_NAME.downcase
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   173
	gem.version           = PKG_VERSION
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   174
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   175
	gem.summary           = PKG_SUMMARY
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   176
	gem.description       = <<-EOD
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   177
	This is shell that can be used to interact with multiple FreeBSD jail instances
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   178
	simultaneously. It includes a Ruby binding to the FreeBSD jail(2) functions.
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   179
	EOD
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   180
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   181
	gem.authors           = 'Michael Granger and Mahlon Smith'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   182
	gem.email             = 'ged@FaerieMUD.org, mahlon@martini.nu'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   183
	gem.homepage          = 'http://deveiate.org/projects/Jparallel/'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   184
	gem.rubyforge_project = RUBYFORGE_PROJECT
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   185
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   186
	gem.has_rdoc          = true
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   187
	gem.rdoc_options      = RDOC_OPTIONS
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   188
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   189
	gem.bindir            = BINDIR.relative_path_from(BASEDIR).to_s
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   190
	
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   191
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   192
	gem.files             = RELEASE_FILES.
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   193
		collect {|f| f.relative_path_from(BASEDIR).to_s }
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   194
	gem.test_files        = SPEC_FILES.
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   195
		collect {|f| f.relative_path_from(BASEDIR).to_s }
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   196
		
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   197
	DEPENDENCIES.each do |name, version|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   198
		version = '>= 0' if version.length.zero?
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   199
		gem.add_runtime_dependency( name, version )
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   200
	end
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   201
	
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   202
	# Developmental dependencies don't work as of RubyGems 1.2.0
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   203
	unless Gem::Version.new( Gem::RubyGemsVersion ) <= Gem::Version.new( "1.2.0" )
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   204
		DEVELOPMENT_DEPENDENCIES.each do |name, version|
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   205
			version = '>= 0' if version.length.zero?
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   206
			gem.add_development_dependency( name, version )
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   207
		end
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   208
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   209
	
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   210
	REQUIREMENTS.each do |name, version|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   211
		gem.requirements << [ name, version ].compact.join(' ')
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   212
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   213
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   214
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   215
# Manual-generation config
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   216
MANUALDIR = DOCSDIR + 'manual'
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   217
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   218
$trace = Rake.application.options.trace ? true : false
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   219
$dryrun = Rake.application.options.dryrun ? true : false
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   220
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   221
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   222
# Load any remaining task libraries
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   223
RAKE_TASKLIBS.each do |tasklib|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   224
	next if tasklib =~ %r{/(helpers|svn|verifytask)\.rb$}
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   225
	begin
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   226
		require tasklib
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   227
	rescue ScriptError => err
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   228
		fail "Task library '%s' failed to load: %s: %s" %
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   229
			[ tasklib, err.class.name, err.message ]
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   230
		trace "Backtrace: \n  " + err.backtrace.join( "\n  " )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   231
	rescue => err
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   232
		log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   233
			[ tasklib, err.class.name, err.message ]
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   234
		trace "Backtrace: \n  " + err.backtrace.join( "\n  " )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   235
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   236
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   237
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   238
# Load any project-specific rules defined in 'Rakefile.local' if it exists
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   239
import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   240
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   241
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   242
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   243
###	T A S K S 	
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   244
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   245
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   246
### Default task
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   247
task :default  => [:clean, :local, :spec, :rdoc, :package]
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   248
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   249
### Task the local Rakefile can append to -- no-op by default
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   250
task :local
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   251
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   252
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   253
### Task: clean
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   254
CLEAN.include 'coverage'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   255
CLOBBER.include 'artifacts', 'coverage.info', PKGDIR
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   256
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   257
# Target to hinge on ChangeLog updates
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   258
file SVN_ENTRIES
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   259
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   260
### Task: changelog
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   261
file 'ChangeLog' => SVN_ENTRIES.to_s do |task|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   262
	log "Updating #{task.name}"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   263
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   264
	changelog = make_svn_changelog()
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   265
	File.open( task.name, 'w' ) do |fh|
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   266
		fh.print( changelog )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   267
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   268
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   269
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   270
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   271
### Task: cruise (Cruisecontrol task)
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   272
desc "Cruisecontrol build"
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   273
task :cruise => [:clean, 'spec:quiet', :package] do |task|
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   274
	raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   275
	artifact_dir = ARTIFACTS_DIR.cleanpath
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   276
	artifact_dir.mkpath
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   277
	
2
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   278
	coverage = BASEDIR + 'coverage'
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   279
	if coverage.exist? && coverage.directory?
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   280
		$stderr.puts "Copying coverage stats..."
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   281
		FileUtils.cp_r( 'coverage', artifact_dir )
0c24586f579a Checkpoint commit.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
   282
	end
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   283
	
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   284
	$stderr.puts "Copying packages..."
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   285
	FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   286
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   287
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   288
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   289
desc "Update the build system to the latest version"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   290
task :update_build do
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   291
	log "Updating the build system"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   292
	sh 'svn', 'up', RAKE_TASKDIR
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   293
	log "Updating the Rakefile"
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   294
	sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   295
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
   296