-
Notifications
You must be signed in to change notification settings - Fork 33
/
Rakefile
112 lines (97 loc) · 2.42 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# vim: fileencoding=utf-8
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rubygems/package_task'
require 'rake/contrib/sshpublisher'
require './lib/crxmake'
$version = CrxMake::VERSION
$readme = 'README.rdoc'
$rdoc_opts = %W(--main #{$readme} --charset utf-8 --line-numbers --inline-source)
$name = 'crxmake'
$summary = 'make chromium extension'
$description = 'command line tool for making chromium extension'
$author = 'Constellation'
$email = 'utatane.tea@gmail.com'
$page = 'http://github.com/Constellation/crxmake/tree/master'
$exec = %W(crxmake)
$rubyforge_project = 'crxmake'
task :default => [:test]
task :package => [:clean]
Rake::TestTask.new("test") do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = true
end
spec = Gem::Specification.new do |s|
s.name = $name
s.version = $version
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = [$readme]
s.rdoc_options += $rdoc_opts
s.summary = $summary
s.description = $description
s.author = $author
s.email = $email
s.homepage = $page
s.executables = $exec
s.rubyforge_project = $rubyforge_project
s.bindir = 'bin'
s.require_path = 'lib'
s.test_files = Dir["test/*_test.rb"]
s.license = 'MIT'
{
"rubyzip" => "~> 1.1.0",
# "openssl" => ">=1.0.0"
}.each do |dep, ver|
s.add_dependency(dep, ver)
end
s.files = %w(README.rdoc Rakefile) + Dir["{bin,test,lib}/**/*"]
end
Gem::PackageTask.new(spec) do |p|
p.need_tar = true
p.gem_spec = spec
end
#RDoc::Task.new do |rdoc|
# rdoc.rdoc_dir = 'doc'
# rdoc.options += $rdoc_opts
## rdoc.template = 'resh'
# rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb", "ext/**/*.c")
#end
desc "gem spec"
task :gemspec do
File.open("#{$name}.gemspec", "wb") do |f|
f << spec.to_ruby
end
end
desc "install"
task "install" => [:gem] do
sh "gem install pkg/#{$name}-#{$version}.gem --local"
end
namespace :install do
desc "install 1.8"
task "1.8" => [:gem] do
sh "gem1.8 install pkg/#{$name}-#{$version}.gem --local"
end
desc "install 1.9"
task "1.9" => [:gem] do
sh "gem1.9 install pkg/#{$name}-#{$version}.gem --local"
end
end
desc "uninstall"
task "uninstall" do
sh "gem uninstall #{$name}"
end
namespace :uninstall do
desc "uninstall 1.8"
task "1.8" do
sh "gem1.8 uninstall #{$name}"
end
desc "uninstall 1.9"
task "1.9" do
sh "gem1.9 uninstall #{$name}"
end
end
# vim: syntax=ruby