forked from maxlapshin/intersys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
127 lines (110 loc) · 3.37 KB
/
Rakefile
File metadata and controls
127 lines (110 loc) · 3.37 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/contrib/rubyforgepublisher'
#require 'lib/intersys'
PKG_NAME = "intersys"
PKG_VERSION = "0.2.1"
PKG_AUTHOR = "Max Lapshin"
PKG_EMAIL = "max@maxidoors.ru"
PKG_HOMEPAGE = "http://maxidoors.ru/"
PKG_SUMMARY = "Intersystems Cache ruby driver"
PKG_SVN = "http://svn.maxidoors.ru/cache-ruby"
PKG_RDOC_OPTS = ['--main=README',
'--line-numbers',
'--webcvs='+PKG_SVN,
'--charset=utf-8',
'--promiscuous']
spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.author = PKG_AUTHOR
s.email = PKG_EMAIL
s.homepage = PKG_HOMEPAGE
s.platform = Gem::Platform::RUBY
s.summary = PKG_SUMMARY
s.require_path = "lib"
s.rubyforge_project = PKG_NAME
s.files = FileList["{bin,test,lib,ext}/**/*"].exclude("rdoc").exclude(".svn").exclude(".DS_Store").exclude("**/*.o").exclude("**/*.bundle").exclude("**/*.log").to_a
s.files << ["Rakefile", "README", "init.rb"]
s.test_files = FileList["{test}/**/*test.rb"].to_a
s.autorequire = "intersys"
s.has_rdoc = true
s.extra_rdoc_files = ["README"]
s.rdoc_options = PKG_RDOC_OPTS
s.extensions << 'ext/extconf.rb'
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end
task :default => [ :test ]
desc "Run all tests"
Rake::TestTask.new("test") { |t|
t.libs << "test"
t.pattern = 'test/*.rb'
t.verbose = true
}
desc "Report KLOCs"
task :stats do
require 'code_statistics'
CodeStatistics.new(
["Libraries", "lib"],
["Units", "test"]
).to_s
end
desc "Generate RDoc documentation"
Rake::RDocTask.new("doc") do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = PKG_SUMMARY
rdoc.rdoc_files.include('README')
# rdoc.rdoc_files.include('CHANGELOG')
# rdoc.rdoc_files.include('TODO')
rdoc.options = PKG_RDOC_OPTS
rdoc.rdoc_files.include "lib/intersys.rb"
end
#Rake::GemPackageTask.new(spec) do |p|
# p.gem_spec = spec
# p.need_tar = true
# p.need_zip = true
#end
desc "Remove packaging products (doc and pkg) - they are not source-managed"
task :clobber do
`rm -rf ./doc`
`rm -rf ./pkg`
end
desc "Publish the new docs"
task :publish_docs => [:clobber, :doc] do
push_docs
end
desc "Push docs to servers"
task :push_docs do
user = "max_lapshin@intersys.rubyforge.org"
project = '/var/www/gforge-projects/intersys/doc'
local_dir = 'doc'
[
Rake::SshDirPublisher.new( user, project, local_dir),
].each { |p| p.upload }
end
desc "Build binary driver"
task :build do |build|
unless ENV['cache_install_path']
puts "Use cache_install_path parameter to provide path to Intersystems Cache install directory"
exit 1
end
puts `cd lib; [ -e Makefile ] || ruby ../ext/extconf.rb --with-cache-install-path=#{ENV['cache_install_path']}; make`
end
desc "Rebuild binary driver"
task :rebuild do
unless ENV['cache_install_path']
puts "Use cache_install_path parameter to provide path to Intersystems Cache install directory"
exit 1
end
puts `cd lib; ruby ../ext/extconf.rb --with-cache-install-path=#{ENV['cache_install_path']}; make clean all`
end
desc "Mark files in SVN"
task :release => [:clobber, :package] do
svn_aware_revision = 'r_' + PKG_VERSION.gsub(/-|\./, '_')
puts `svn copy #{PKG_SVN}/trunk #{PKG_SVN}/tags/#{svn_aware_revision} -m "release #{svn_aware_revision}"`
end