-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
50 lines (39 loc) · 971 Bytes
/
Rakefile
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
require "rubygems"
require "rake"
require "shipit"
require "pathname"
makefilepl = Pathname.new("Makefile.PL").read
mainmodule = Pathname.new("lib/DBIx/RewriteDSN.pm").read
NAME = makefilepl[/name '([^']+)';/, 1]
VERS = mainmodule[/our \$VERSION = '([^']+)';/, 1]
DESCRIPTION = mainmodule[/=head1 NAME\s+\S+ - (.*)/, 1]
task :default => :test
desc "make test"
task :test => ["Makefile"] do
sh %{make test}
sh %{prove -Ilib xt}
end
desc "make clean"
task :clean => ["Makefile"] do
sh %{make clean}
end
desc "make install"
task :install => ["Makefile"] do
sh %{sudo make install}
end
desc "release"
task :release => :shipit
desc "shipit"
task :shipit => ["MANIFEST"] do
sh %{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