forked from reidmorrison/rubywmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
91 lines (84 loc) · 3.38 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
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'rubygems'
require 'rubygems/package'
require 'rake/clean'
require 'rake/testtask'
require 'date'
require 'wmq/version'
desc "Build Ruby Source gem"
task :gem do |t|
excludes = [
/lib.wmq.constants\.rb/,
/lib.wmq.constants_admin\.rb/,
/ext.wmq_structs\.c/,
/ext.wmq_reason\.c/,
/ext.Makefile/,
/ext.*\.o/,
/ext.wmq\.so/,
/\.gem$/,
/\.log$/,
/nbproject/
]
gemspec = Gem::Specification.new do |spec|
spec.name = 'rubywmq'
spec.version = WMQ::VERSION
spec.platform = Gem::Platform::RUBY
spec.authors = ['Reid Morrison', 'Edwin Fine']
spec.email = ['reidmo@gmail.com']
spec.homepage = 'https://github.com/reidmorrison/rubywmq'
spec.date = Date.today.to_s
spec.summary = "Native Ruby interface into WebSphere MQ"
spec.description = "RubyWMQ is a high performance native Ruby interface into WebSphere MQ."
spec.files = FileList["./**/*"].exclude(*excludes).map{|f| f.sub(/^\.\//, '')} + ['.document']
spec.license = "Apache License V2.0"
spec.extensions << 'ext/extconf.rb'
spec.rubyforge_project = 'rubywmq'
spec.test_file = 'tests/test.rb'
spec.has_rdoc = true
spec.required_ruby_version = '>= 1.8.4'
spec.add_development_dependency 'shoulda'
spec.requirements << 'WebSphere MQ v5.3, v6 or v7 Client or Server with Development Kit'
end
p gemspec.files
Gem::Builder.new(gemspec).build
end
desc "Build a binary gem including pre-compiled binary files for re-distribution"
task :binary do |t|
# Move compiled files into locations for repackaging as a binary gem
FileUtils.mkdir_p('lib/wmq')
Dir['ext/lib/*.rb'].each{|file| FileUtils.copy(file, File.join('lib/wmq', File.basename(file)))}
FileUtils.copy('ext/wmq.so', 'lib/wmq/wmq.so')
gemspec = Gem::Specification.new do |spec|
spec.name = 'rubywmq'
spec.version = WMQ::VERSION
spec.platform = Gem::Platform::CURRENT
spec.authors = ['Reid Morrison', 'Edwin Fine']
spec.email = ['reidmo@gmail.com']
spec.homepage = 'https://github.com/reidmorrison/rubywmq'
spec.date = Date.today.to_s
spec.summary = "Native Ruby interface into WebSphere MQ"
spec.description = "RubyWMQ is a high performance native Ruby interface into WebSphere MQ."
spec.files = Dir['examples/**/*.rb'] +
Dir['examples/**/*.cfg'] +
Dir['doc/**/*.*'] +
Dir['lib/**/*.rb'] +
['lib/wmq/wmq.so', 'tests/test.rb', 'README', 'LICENSE']
spec.license = "Apache License V2.0"
spec.rubyforge_project = 'rubywmq'
spec.test_file = 'tests/test.rb'
spec.has_rdoc = false
spec.required_ruby_version = '>= 1.8.4'
spec.add_development_dependency 'shoulda'
spec.requirements << 'WebSphere MQ v5.3, v6 or v7 Client or Server with Development Kit'
end
Gem::Builder.new(gemspec).build
end
desc "Run Test Suite"
task :test do
Rake::TestTask.new(:functional) do |t|
t.test_files = FileList['test/*_test.rb']
t.verbose = true
end
Rake::Task['functional'].invoke
end