forked from jimm/midilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
89 lines (75 loc) · 2.14 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
require 'rubygems'
require 'rake'
if RUBY_VERSION >= '1.9'
require 'rdoc/task'
require 'rubygems/package_task'
require 'rake/testtask'
else
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/runtest'
end
PROJECT_NAME = 'midilib'
RDOC_DIR = 'html'
PKG_FILES = FileList[ 'ChangeLog', 'Credits', 'Rakefile',
'README.rdoc', 'TODO.rdoc',
'examples/**/*',
'html/**/*',
'install.rb',
'lib/**/*.rb',
'test/**/*']
task :default => [:package]
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = PROJECT_NAME
s.version = `ruby -Ilib -e 'require "midilib/info"; puts MIDI::Version'`.strip
s.requirements << 'none'
s.require_path = 'lib'
s.files = PKG_FILES.to_a
s.has_rdoc = true
s.rdoc_options << '--main' << 'README.rdoc'
s.extra_rdoc_files = ['README.rdoc', 'TODO.rdoc']
s.author = 'Jim Menard'
s.email = '[email protected]'
s.homepage = 'http://github.com/jimm/midilib'
s.rubyforge_project = PROJECT_NAME
s.summary = "MIDI file and event manipulation library"
s.description = <<EOF
midilib is a pure Ruby MIDI library useful for reading and
writing standard MIDI files and manipulating MIDI event data.
EOF
end
if RUBY_VERSION >= '1.9'
# Creates a :package task (also named :gem). Also useful are
# :clobber_package and :repackage.
Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
else
# Creates a :package task (also named :gem). Also useful are
# :clobber_package and :repackage.
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
end
# creates an "rdoc" task
Rake::RDocTask.new do | rd |
rd.main = 'README.rdoc'
rd.title = PROJECT_NAME
rd.rdoc_files.include('README.rdoc', 'TODO.rdoc', 'lib/**/*.rb')
end
desc "Publish gem"
task :publish => [:rdoc, :package] do
version = `ruby -Ilib -e 'require "midilib/info"; puts MIDI::Version'`.strip
system "gem push pkg/midilib-#{version}.gem"
end
if RUBY_VERSION >= '1.9'
Rake::TestTask.new
else
task :test do
Rake::run_tests
end
end
task :clean => [:clobber_rdoc, :clobber_package]