Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 132 lines (100 sloc) 3.588 kb
f7078b4 Fixed eol-style for files
anatol authored
1 require 'rubygems'
2 require 'rake'
3 require 'rake/testtask'
4 require 'rake/packagetask'
5 require 'rake/gempackagetask'
6 require 'rake/contrib/rubyforgepublisher'
7
8 require "./lib/cerberus/version"
9
10 PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
11 PKG_NAME = 'cerberus'
12 PKG_VERSION = Cerberus::VERSION::STRING + PKG_BUILD
13 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
15 RELEASE_NAME = "REL #{PKG_VERSION}"
16
17 RUBY_FORGE_PROJECT = "cerberus"
18 RUBY_FORGE_USER = "anatol"
19
20 task :default => [:test, :clean]
21
22 desc "Run the unit tests in test/unit"
23 Rake::TestTask.new(:test) do |t|
24 t.libs << "test"
25 t.pattern = 'test/*_test.rb'
26 t.verbose = true
27 end
28
29 desc "Clean all generated files"
30 task :clean => :clobber_package do
31 rm_rf './test/__workdir'
32 end
33
34
35 GEM_SPEC = Gem::Specification.new do |s|
36 s.name = PKG_NAME
37 s.version = PKG_VERSION
38 s.platform = Gem::Platform::RUBY
39 s.required_ruby_version = ">=1.8.2"
40
41 s.summary = "Cerberus is a Continuous Integration tool that could be easily run from Cron."
42 s.description = <<-DESC.strip.gsub(/\n\s+/, " ")
43 Cerberus is a Continuous Integration software for Ruby projects. CI helps you keep your project
44 in a good shape.
45
46 For now Cerberus only work with projects that use Subversion but in the future it would be provided
47 support for other VCS.
48
49 Cerberus could be easily invoked from Cron (for Unix) or nnCron (for Windows) utilities.
50 DESC
51
52 s.add_dependency 'actionmailer', '>= 1.2.1'
53 s.add_dependency 'rake', '>= 0.7.1'
54
55 s.files = Dir.glob("{bin,doc,lib,test}/**/*").delete_if { |item| item.include?('__workdir') }
56 s.files += %w(LICENSE README CHANGES Rakefile)
57
58 s.bindir = "bin"
59 s.executables = ["cerberus"]
60 s.default_executable = "cerberus"
61
62 s.require_path = 'lib'
63
64 s.has_rdoc = true
65 s.extra_rdoc_files = [ "README" ]
66 s.rdoc_options = [ "--main", "README" ]
67
68 s.test_suite_file = "test/integration_test.rb"
69
70 s.author = "Anatol Pomozov"
71 s.email = "anatol.pomozov@gmail.com"
72 s.homepage = "http://rubyforge.org/projects/cerberus"
73 s.rubyforge_project = RUBY_FORGE_PROJECT
74 end
75
76
77 Rake::GemPackageTask.new(GEM_SPEC) do |p|
78 p.gem_spec = GEM_SPEC
79 p.need_tar = true
80 p.need_zip = true
81 end
82
83 task :install => [:clean, :test, :package] do
84 system "gem install pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
85 end
86
87 task :uninstall => [:clean] do
88 system "gem uninstall #{PKG_NAME}"
89 end
90
91 desc "Look for TODO and FIXME tags in the code"
92 task :todo do
93 Pathname.new(File.dirname(__FILE__)).egrep(/#.*(FIXME|TODO|TBD|DEPRECATED)/) do |match|
94 puts match
95 end
96 end
97
98 task :reinstall => [:uninstall, :install] do
99 end
100
101 task :release_files => [:clean, :package] do
102 require 'meta_project'
103 project = MetaProject::Project::XForge::RubyForge.new(RUBY_FORGE_PROJECT)
104
105 release_files = FileList[
106 "pkg/#{PKG_FILE_NAME}.gem",
107 "pkg/#{PKG_FILE_NAME}.zip",
108 "pkg/#{PKG_FILE_NAME}.tgz"
109 ]
110
111 Rake::XForge::Release.new(project) do |release|
112 release.user_name = RUBY_FORGE_USER
113 release.password = ENV['RUBYFORGE_PASSWORD']
114 release.files = release_files.to_a
115 release.package_name = PKG_NAME
116 release.release_name = "Cerberus #{PKG_VERSION}"
117 end
118
119 end
120
121 task :publish_news do
122 require 'meta_project'
123
124 project = MetaProject::Project::XForge::RubyForge.new(RUBY_FORGE_PROJECT)
125 Rake::XForge::NewsPublisher.new(project) do |publisher|
126 publisher.user_name = RUBY_FORGE_USER
127 publisher.password = ENV['RUBYFORGE_PASSWORD']
a463c05 Improved news publishing mechanism
anatol authored
128 publisher.subject = "[ANN] Cerberus #{PKG_VERSION} Released"
129 publisher.details = IO.read(File.dirname(__FILE__) + '/README')
f7078b4 Fixed eol-style for files
anatol authored
130 end
131 end
Something went wrong with that request. Please try again.