source: ruby/trunk/adl_parser/Rakefile@ 4

Last change on this file since 4 was 4, checked in by KOBAYASHI, Shinji, 16 years ago

restructuring repository tree

File size: 2.2 KB
Line 
1require 'rubygems'
2Gem::manage_gems
3require 'rake'
4require 'rake/testtask'
5require 'rake/rdoctask'
6require 'rake/clean'
7require 'rake/gempackagetask'
8require 'yaml'
9
10$DEBUG = false
11
12RACC_SRC = FileList["lib/*.y"]
13RACC_PARSER = FileList['lib/parser.rb', 'lib/adl_parser.rb', 'lib/cparser.rb', 'lib/dparser.rb']
14
15task :default => [:racc]
16
17desc "Generate parser by racc."
18task :racc => RACC_PARSER
19rule '.rb' => '.y' do |target|
20 if $DEBUG == true
21 sh "racc -v -g #{target.source} -o #{target.name}"
22 else
23 sh "racc #{target.source} -o #{target.name}"
24 end
25end
26
27
28RB_SRC = FileList["lib/*.rb"]
29TAGS = FileList['TAGS']
30desc "Generate TAGS by rtags."
31task :tags => TAGS
32rule 'TAGS' => RB_SRC do |target|
33 sh "rtags #{target.prerequisites.join(' ')}"
34end
35
36
37desc "Whole Unit tests"
38task 'test' => ['test:shell', 'test:validator', 'test:parser']
39
40
41Rake::TestTask.new('test:shell') do |t|
42 t.libs = ["lib"]
43 t.pattern = ['tests/shell_test.rb']
44 t.warning = true
45 t.verbose = true
46end
47
48Rake::TestTask.new('test:validator') do |t|
49 t.libs = ["lib"]
50 t.pattern = ['tests/validator_test.rb']
51 t.warning = true
52 t.verbose = true
53end
54
55Rake::TestTask.new('test:parser') do |t|
56 t.libs = ["lib"]
57 t.pattern = ['tests/parser_test.rb']
58 t.warning = true
59 t.verbose = true
60end
61
62
63Rake::RDocTask.new('rdoc') do |t|
64 t.rdoc_dir = 'rdoc'
65 t.rdoc_files.include('README', 'lib/*.rb', 'bin/*.rb')
66 t.main = 'README'
67 t.title = "ADL parser API documentation"
68end
69
70gem_spec = Gem::Specification.new do |s|
71 s.name = 'adl_parser'
72 s.author = 'Akimichi Tatsukawa'
73 s.version = '0.0.1'
74 s.summary = 'ADL parser'
75 s.email = 'akimichi_tatsukawa@nifty.com'
76 s.test_files = FileList['tests/*_test.rb', '*.adl']
77 candidates = Dir.glob("{bin, docs, lib, tests, ext}/**/*")
78 s.files = candidates.delete_if do |item|
79 item.include?(".svn") || item.include?("rdoc")
80 end
81 FileList['README', 'COPYING', 'Rakefile']
82 s.require_path = "lib"
83 s.has_rdoc = true
84 s.extra_rdoc_files = ["README"]
85end
86
87Rake::GemPackageTask.new(gem_spec) do |pkg|
88 pkg.need_zip = false
89 pkg.need_tar = false
90end
91
92
93CLOBBER.include('rdoc')
94CLEAN.include('lib/*.output', 'log/*.log')
95
96
97
98
99### Local Variables:
100### mode:ruby
101### mode:font-lock
102### comment-column:0
103### comment-start: "### "
104### comment-end:""
105### End:
106
107
Note: See TracBrowser for help on using the repository browser.