forked from copiousfreetime/amalgalite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
91 lines (81 loc) · 3.11 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#--
# Copyright (c) 2008 Jeremy Hinegardner
# All rights reserved. See LICENSE and/or COPYING for details.
#++
#-------------------------------------------------------------------------------
# make sure our project's top level directory and the lib directory are added to
# the ruby search path.
#-------------------------------------------------------------------------------
$: << File.expand_path(File.join(File.dirname(__FILE__),"lib"))
$: << File.expand_path(File.dirname(__FILE__))
#-------------------------------------------------------------------------------
# load the global project configuration and add in the top level clean and
# clobber tasks so that other tasks can utilize those constants if necessary
# This loads up the defaults for the whole project configuration
#-------------------------------------------------------------------------------
require 'rubygems'
begin
require 'tasks/config.rb'
require 'rake/clean'
rescue LoadError
abort "You probably want to run 'gem install configuration' then 'rake install_dependencies'"
end
desc "Install development dependencies"
task :install_dependencies => :clean do
gv = [
%w[ arrayfields 4.7.4 ],
%w[ fastercsv 1.5.4 ],
%w[ rspec 2.4.0 ],
%w[ zip 2.0.2 ],
%w[ rake-compiler 0.7.5 ],
%w[ rcov 0.9.9 ] ]
gv.each do |name, version|
puts "Installing #{name}-#{version}"
sh "gem install #{name} --version #{version} --no-rdoc --no-ri"
end
end
#-------------------------------------------------------------------------------
# Main configuration for the project, these overwrite the items that are in
# tasks/config.rb
#-------------------------------------------------------------------------------
require 'amalgalite/paths'
require 'amalgalite/version'
Configuration.for("project") {
name "amalgalite"
version Amalgalite::VERSION
author "Jeremy Hinegardner"
email "[email protected]"
homepage "http://copiousfreetime.rubyforge.org/amalgalite/"
}
#-------------------------------------------------------------------------------
# load up all the project tasks and setup the default task to be the
# test:default task.
#-------------------------------------------------------------------------------
if Rake.application.top_level_tasks.first !="install_dependencies" then
Configuration.for("packaging").files.tasks.each do |tasklib|
import tasklib
end
task :default => 'test:default'
end
#-------------------------------------------------------------------------------
# Finalize the loading of all pending imports and update the top level clobber
# task to depend on all possible sub-level tasks that have a name like
# ':clobber' in other namespaces. This allows us to say:
#
# rake clobber
#
# and it will get everything.
#-------------------------------------------------------------------------------
begin
Rake.application.load_imports
rescue LoadError
abort "run 'rake install_dependencies'"
end
Rake.application.tasks.each do |t|
if t.name =~ /:clobber/ then
task :clobber => [t.name]
end
if t.name =~ /:clean/ then
task :clean => [t.name]
end
end