1 # $Id: Rakefile 42 2005-06-08 17:16:09Z tilman $
4 require "rake/testtask"
5 require "rake/rdoctask"
6 require "rake/packagetask"
7 require "rake/contrib/compositepublisher.rb"
8 require "rake/contrib/sshpublisher"
10 # make sure we run at least Rake 0.5.0
11 if (RAKEVERSION.split(".").map { |p| p.to_i } <=> [0, 5, 0]) < 0
12 raise("Rake 0.5.0 or greater required")
16 PKG_VERSION = File.read("lib/redact/redact.rb").
17 match(/^\s*VERSION = \"(.*)\"\s*$/).captures.first
19 CLOBBER.include("test/*.edj")
22 sitelibdir = Config::CONFIG["sitelibdir"]
23 destdir = "#{ENV["DESTDIR"]}"
24 prefix = ENV["PREFIX"] || "/usr/local"
26 ddir = destdir + prefix + "/bin"
27 FileUtils::Verbose.install("bin/redact", ddir, :mode => 0755)
29 ddir = destdir + sitelibdir + "/redact"
31 FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
32 FileUtils::Verbose.install(Dir["lib/redact/*.rb"], ddir,
38 Rake::TestTask.new do |t|
40 t.test_files = FileList["test/test*.rb"]
44 Rake::RDocTask.new do |t|
46 t.title = "Redact - An Edje Compiler written in Ruby"
47 t.options = ["--line-numbers", "--inline-source", "--main", "README"]
48 t.rdoc_files.include("README", "COPYING", "AUTHORS", "ChangeLog",
49 "TODO", "NEWS", "lib/redact/redact.rb",
50 "lib/redact/part.rb", "lib/redact/program.rb")
53 Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |t|
55 t.package_files.include("[A-Z]*", "bin/redact", "lib/redact/*.rb",
59 task :publish => [:rdoc, :package] do
60 p = Rake::CompositePublisher.new
61 p.add(Rake::SshFreshDirPublisher.new("code-monkey.de",
64 p.add(Rake::SshFilePublisher.new("code-monkey.de",
66 "#{PKG_NAME}-#{PKG_VERSION}.tar.gz"))