-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
72 lines (58 loc) · 1.58 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
require 'rake/gempackagetask'
require 'rake/contrib/sshpublisher'
require 'yaml'
require 'rubyforge'
require 'ruby/lib/version'
PROJECT_NAME = "rice"
PROJECT_WEB_PATH = "/var/www/gforge-projects/rice"
task :default => :test
desc "Build Rice locally. Delete the top level Makefile to force this to run"
task :build do
if !File.exist?("Makefile")
sh "bootstrap"
sh "configure"
sh "make"
end
end
desc "Run unit tests"
task :test => :build do
cd "test" do
ruby "test_rice.rb"
end
end
desc "Build the documentation"
task :doc do
sh "make doc"
end
desc "Upload documentation to the website. Requires rubyforge gem"
task :upload_web => [:build, :doc] do
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
host = "#{config["username"]}@rubyforge.org"
Rake::SshDirPublisher.new(host, PROJECT_WEB_PATH, "doc/html").upload
end
# Gemspec kept externally
eval(File.read("rice.gemspec"))
Rake::GemPackageTask.new($spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
desc "Create a new release to Rubyforge"
task :release => :package do
rf = RubyForge.new
puts "Logging into rubyforge"
rf.login
pkg = "pkg/#{PROJECT_NAME}-#{Rice::VERSION}"
c = rf.userconfig
files = [
"#{pkg}.tgz",
"#{pkg}.zip",
"#{pkg}.gem"
]
puts "Releasing #{PROJECT_NAME} v. #{Rice::VERSION}"
begin
rf.add_release $spec.rubyforge_project, PROJECT_NAME, RICE_VERSION, *files
rescue => ex
puts "You may not be configured with rubyforge. Please run `rubyforge config` and run this task again."
puts "Error is #{ex.inspect}"
end
end