forked from inukshuk/bibtex-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
98 lines (76 loc) · 2.5 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
92
93
94
95
96
97
98
# -*- ruby -*-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require 'rubygems'
require 'bundler/setup'
require 'rake/clean'
require 'rake/testtask'
require 'rdoc/task'
require 'bibtex/version'
RDoc::Task.new(:rdoc_task) do |rd|
rd.main = 'README.md'
rd.title = "BibTeX-Ruby Documentation"
rd.rdoc_files.include('README.md',"lib/**/*.rb")
rd.rdoc_dir = "doc/html"
rd.options << '--webcvs=http://github.com/inukshuk/bibtex-ruby/tree/master/'
end
Rake::TestTask.new(:test_task) do |t|
t.libs << 'lib' << 'test'
t.test_files = FileList['test/**/test_*.rb']
t.verbose = true
end
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "--format progress"
end
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
task :default => ['racc']
desc 'Generates the BibTeX parser'
task :racc => ['lib/bibtex/parser.rb','lib/bibtex/name_parser.rb']
desc 'Generates RDoc documentation for BibTeX-Ruby'
task :rdoc => ['clean','racc','rdoc_task']
task :test => ['racc','test_task']
file 'lib/bibtex/parser.output' => ['lib/bibtex/parser.rb']
file 'lib/bibtex/parser.rb' => ['lib/bibtex/bibtex.y'] do
# sh 'racc -v -g -o lib/bibtex/parser.rb lib/bibtex/bibtex.y'
sh 'racc -v -o lib/bibtex/parser.rb lib/bibtex/bibtex.y'
end
file 'lib/bibtex/name_parser.rb' => ['lib/bibtex/names.y'] do
# sh 'racc -v -g -o lib/bibtex/name_parser.rb lib/bibtex/names.y'
sh 'racc -v -o lib/bibtex/name_parser.rb lib/bibtex/names.y'
end
desc 'Runs the benchmarks (and plots the results)'
task :benchmark => ['racc'] do
require File.expand_path('../test/benchmark.rb', __FILE__)
end
task :bm => ['benchmark']
desc 'Runs the profiler'
task :profile => ['racc'] do
require File.expand_path('../test/profile.rb', __FILE__)
end
desc 'Updates the Manifest file'
task :manifest => ['clean', 'racc'] do
m = File.open('Manifest', 'w')
m.print FileList['**/*'].join("\n")
m.close
end
desc 'Builds the gem file'
task :build => ['manifest'] do
system 'gem build bibtex-ruby.gemspec'
end
desc 'Pushes the gem file to rubygems.org'
task :release => ['build'] do
system "gem push bibtex-ruby-#{BibTeX::Version::STRING}.gem"
end
CLEAN.include('lib/bibtex/parser.rb')
CLEAN.include('lib/bibtex/parser.output')
CLEAN.include('lib/bibtex/name_parser.rb')
CLEAN.include('lib/bibtex/name_parser.output')
CLEAN.include('doc/html')
CLEAN.include('*.gem')
# vim: syntax=ruby