#--
# 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