source: ruby/trunk/adl_parser/Rakefile@ 21

Last change on this file since 21 was 21, checked in by Tatsukawa, Akimichi, 16 years ago

created an experimental openehr_models gem package

File size: 2.5 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"]
13#RACC_PARSER = FileList['lib/parser.rb', 'lib/adl_parser.rb', 'lib/cparser.rb', 'lib/dparser.rb']
14RACC_PARSER = FileList['lib/parser.rb']
15
16task :default => [:racc]
17
18desc "Generate parser by racc."
19task :racc => RACC_PARSER
20rule '.rb' => '.y' do |target|
21 if $DEBUG == true
22 sh "racc -v -g #{target.source} -o #{target.name}"
23 else
24 sh "racc #{target.source} -o #{target.name}"
25 end
26end
27
28
29RB_SRC = FileList["lib/*.rb"]
30TAGS = FileList['TAGS']
31desc "Generate TAGS by rtags."
32task :tags => TAGS
33rule 'TAGS' => RB_SRC do |target|
34 sh "rtags #{target.prerequisites.join(' ')}"
35end
36
37
38desc "Whole Unit tests"
39task 'test' => ['test:shell', 'test:validator', 'test:parser', 'test:scanner']
40
41
42Rake::TestTask.new('test:shell') do |t|
43 t.libs = ["lib"]
44 t.pattern = ['tests/shell_test.rb']
45 t.warning = true
46 t.verbose = true
47end
48
49Rake::TestTask.new('test:validator') do |t|
50 t.libs = ["lib"]
51 t.pattern = ['tests/validator_test.rb']
52 t.warning = true
53 t.verbose = true
54end
55
56Rake::TestTask.new('test:parser') do |t|
57 t.libs = ["lib"]
58 t.pattern = ['tests/parser_test.rb']
59 t.warning = true
60 t.verbose = true
61end
62
63Rake::TestTask.new('test:scanner') do |t|
64 t.libs = ["lib"]
65 t.pattern = ['tests/scanner_test.rb']
66 t.warning = true
67 t.verbose = true
68end
69
70
71Rake::RDocTask.new('rdoc') do |t|
72 t.rdoc_dir = 'rdoc'
73 t.rdoc_files.include('README', 'lib/*.rb', 'bin/*.rb')
74 t.main = 'README'
75 t.title = "ADL parser API documentation"
76end
77
78gem_spec = Gem::Specification.new do |s|
79 s.name = 'adl_parser'
80 s.author = 'Akimichi Tatsukawa'
81 s.version = '0.0.2'
82 s.summary = 'ADL parser'
83 s.email = 'akimichi_tatsukawa@nifty.com'
84 s.test_files = FileList['tests/*_test.rb', '*.adl']
85 candidates = Dir.glob("{bin,docs,lib,tests,ext}/**/*")
86 s.files = candidates.delete_if do |item|
87 item.include?(".svn") || item.include?("rdoc")
88 end
89 s.files = FileList['README', 'COPYING', 'Rakefile']
90 s.require_path = "lib"
91 s.has_rdoc = true
92 s.extra_rdoc_files = ["README"]
93 s.add_dependency("yaparc", ">= 0.2.0")
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.