source: ruby/trunk/tests/adl_parser/Rakefile@ 46

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

to do:fix codes for this hierarchy

File size: 2.4 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']
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', 'test:scanner']
39
40
41Rake::TestTask.new('test:shell') do |t|
42 t.libs = ["lib"]
43 t.pattern = ['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 = ['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 = ['parser_test.rb']
58 t.warning = true
59 t.verbose = true
60end
61
62Rake::TestTask.new('test:scanner') do |t|
63 t.libs = ["lib"]
64 t.pattern = ['scanner_test.rb']
65 t.warning = true
66 t.verbose = true
67end
68
69
70Rake::RDocTask.new('rdoc') do |t|
71 t.rdoc_dir = 'rdoc'
72 t.rdoc_files.include('README', 'lib/*.rb', 'bin/*.rb')
73 t.main = 'README'
74 t.title = "ADL parser API documentation"
75end
76
77gem_spec = Gem::Specification.new do |s|
78 s.name = 'adl_parser'
79 s.author = 'Akimichi Tatsukawa'
80 s.version = '0.0.2'
81 s.summary = 'ADL parser'
82 s.email = 'akimichi_tatsukawa@nifty.com'
83 s.test_files = FileList['tests/*_test.rb', '*.adl']
84 candidates = Dir.glob("{bin,docs,lib,tests,ext}/**/*")
85 s.files = candidates.delete_if do |item|
86 item.include?(".svn") || item.include?("rdoc")
87 end
88 s.files = FileList['README', 'COPYING', 'Rakefile']
89 s.require_path = "lib"
90 s.has_rdoc = true
91 s.extra_rdoc_files = ["README"]
92 s.add_dependency("yaparc", ">= 0.2.2")
93 s.add_dependency("openehr_models", ">= 0.0.1")
94end
95
96Rake::GemPackageTask.new(gem_spec) do |pkg|
97 pkg.need_zip = false
98 pkg.need_tar = false
99end
100
101
102CLOBBER.include('rdoc')
103CLEAN.include('lib/*.output', 'log/*.log')
104
105
106
107
108### Local Variables:
109### mode:ruby
110### mode:font-lock
111### comment-column:0
112### comment-start: "### "
113### comment-end:""
114### End:
115
116
Note: See TracBrowser for help on using the repository browser.