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
|
require "rubygems"
require "rake"
require "shipit"
require "pathname"
makefilepl = Pathname.new("Makefile.PL")
NAME = makefilepl.read[/name '([^']+)';/, 1]
#VERS =
#DESCRIPTION =
task :default => :test
desc "make test"
task :test => ["Makefile"] do
sh %{make test}
end
desc "make clean"
task :clean => ["Makefile"] do
sh %{make clean}
rm "MANIFEST"
end
desc "make install"
task :install => ["Makefile"] do
sh %{sudo make install}
end
desc "release"
task :release => :shipit
task :shipit => [:test, "MANIFEST"]
Rake::ShipitTask.new do |s|
ENV["LANG"] = "C"
s.Step.new {
# check
system("svn", "up")
raise "Any chages remain?\n#{`svn st`}" unless `svn st`.empty?
}.and {}
s.Step.new {
system "shipit", "-n"
print "Check dry-run result and press Any Key to continue (or cancel by Ctrl-C)."
$stdin.gets
}.and {
system "shipit"
}
end
file "Makefile" => ["Makefile.PL"] do
sh %{perl Makefile.PL}
end
file "Makefile.PL"
file "MANIFEST" => Dir["**/*"].delete_if {|i| i == "MANIFEST" } do
rm "MANIFEST" if File.exist?("MANIFEST")
sh %{perl Makefile.PL}
sh %{make}
sh %{make manifest}
end
|