copiousfreetime / amalgalite

SQLite database engine embedded in a ruby extension.

amalgalite / Rakefile
100644 84 lines (76 sloc) 3.16 kb
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
#--
# 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'
require 'tasks/config.rb'
require 'rake/clean'
 
#-------------------------------------------------------------------------------
# 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 "jeremy@hinegardner.org"
  homepage "http://copiousfreetime.rubyforge.org/amalgalite/"
}
 
#-------------------------------------------------------------------------------
# load up all the project tasks and setup the default task to be the
# test:default task.
#-------------------------------------------------------------------------------
Configuration.for("packaging").files.tasks.each do |tasklib|
  import tasklib
end
task :default => 'test:default'
 
#-------------------------------------------------------------------------------
# make sure that the Amalgalite::Requires.requires_order has a listing of all
# files in lib
#-------------------------------------------------------------------------------
namespace :test do
  desc "Check that requires_order will package"
  task :check_requires do
    require 'amalgalite/requires'
    Dir.chdir( "lib" ) do
      all_files = FileList["**/*.rb"].uniq
      requires_order = Amalgalite::Requires.require_order.uniq
      if ( requires_order.size != all_files.size ) then
        puts "Missing files "
        (all_files - requires_order).each do |l|
          puts " #{l}"
        end
      else
        puts "All files found"
      end
    end
  end
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.
#-------------------------------------------------------------------------------
Rake.application.load_imports
Rake.application.tasks.each do |t|
  if t.name =~ /:clobber/ then
    task :clobber => [t.name]
  end
end