#-- # $Id: Rakefile 18 2006-09-17 23:33:58Z prelude $ # # This file is part of the Prelude library that provides tools to # enable Haskell style functional programming in Ruby. # # http://prelude.rubyforge.org # # Copyright (C) 2006 APP Design, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #++ #-- # To run: # c:/tools/trunk/ruby-1.8.4_20/bin/rake.bat # #++ require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' require 'fileutils' require 'pp' require File.join(File.dirname(__FILE__), 'lib', 'prelude') PKG_NAME = 'prelude' PKG_VERSION = Prelude::VERSION PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" PKG_DESTINATION = "../#{PKG_NAME}" RELEASE_NAME = "REL #{PKG_VERSION}" RUBY_FORGE_PROJECT = "prelude" RUBY_FORGE_USER = "prelude" desc "Default Task" task :default => [ :test ] task :test do |x| Rake::TestTask.new { |t| t.libs << "test" t.test_files = Dir['test/ts_*.rb'] t.verbose = true } end # :test file 'doc/index.html' => ['misc/rdoc_template.rb' ] task :rdoc => ['doc/index.html'] # Generate the RDoc documentation Rake::RDocTask.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Prelude -- a Haskell-like library for functional programming" rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README' rdoc.template = 'misc/rdoc_template.rb' rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('CHANGELOG') rdoc.rdoc_files.include('TODO') rdoc.rdoc_files.include('lib/**/*.rb') } # Create compressed packages by running 'rake gem' desc "gem task" task :gem => [ :clobber, :rdoc ] # # Here's how to look inside the gem package: # ~..>tar xvf prelude-0.0.1.gem; gunzip data.tar.gz metadata.gz; tar xvf data.tar; cat metadata spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = PKG_NAME s.version = PKG_VERSION s.summary = 'Haskell-like functional library' s.description = 'Enables Ruby programmers to use higher-order functions, monads, and other Haskell features.' s.author = 'Ivan K. and APP Design, Inc.' s.email = 'prelude@rubyforge.org' s.rubyforge_project = 'prelude' s.homepage = 'http://prelude.rubyforge.org' s.has_rdoc = true s.requirements << 'none' s.require_path = 'lib' s.autorequire = 'prelude' [ "Rakefile", "README", "TODO", "CHANGELOG", "COPYING", "doc/**/*", "examples/**/*", "lib/**/*", "test/**/*" ].each do |i| s.files += Dir.glob(i).delete_if do |x| x =~ /.*~/ end end puts "Files included into the GEM:" pp s.files s.test_files = Dir.glob( "test/**/ts_*rb" ) end Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec p.need_tar = true p.need_zip = true end