source: ruby/trunk/lib/adl_parser/Rakefile@ 116

Last change on this file since 116 was 116, checked in by Tatsukawa, Akimichi, 15 years ago

refactored directory structure of adl_parser

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']
14RB_SRC = FileList["lib/*.rb"]
15TAGS = FileList['TAGS']
16
17task :default => [:racc]
18
19desc "Generate parser by racc."
20task :racc => RACC_PARSER
21rule '.rb' => '.y' do |target|
22 if $DEBUG == true
23 sh "racc -v -g #{target.source} -o #{target.name}"
24 else
25 sh "racc #{target.source} -o #{target.name}"
26 end
27end
28
29
30
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 = ['test/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 = ['test/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 = ['test/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 = ['test/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.3'
82 s.summary = 'ADL parser'
83 s.email = 'akimichi.tatsukawa@gmail.com'
84 s.test_files = FileList['test/*_test.rb', '*.adl']
85 candidates = Dir.glob("{bin,docs,lib,test,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.3")
94 s.add_dependency("openehr_models", ">= 0.0.1")
95end
96
97Rake::GemPackageTask.new(gem_spec) do |pkg|
98 pkg.need_zip = false
99 pkg.need_tar = false
100end
101
102
103CLOBBER.include('rdoc')
104CLEAN.include('lib/*.output', 'log/*.log')
105
106
107
108
109### Local Variables:
110### mode:ruby
111### mode:font-lock
112### comment-column:0
113### comment-start: "### "
114### comment-end:""
115### End:
116
117
Note: See TracBrowser for help on using the repository browser.