-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrakefile
More file actions
57 lines (46 loc) · 1.36 KB
/
rakefile
File metadata and controls
57 lines (46 loc) · 1.36 KB
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
# See README for basic usage.
desc "alias to test:aurora"
task :test => "test:aurora"
namespace :test do
desc "run the tests on aurora"
task :aurora do
sh "cd test && ruby test.rb schemas/aurora.xsd"
end
desc "run the tests on sirius"
task :sirius do
sh "cd test && ruby test.rb schemas/sirius.xsd"
end
desc "copy most recent output dirs into expected dirs"
task :update_expected do
sh "cd test && ruby test.rb --update-expected"
end
end
##obsolete, but reusable
desc "validate sample files"
task :valid => :bin do
# Dir["test/input/**/*.xml"].each do |filename|
# sh "ruby bin/validate -v #{filename} test/input/aurora.xsd || true"
# end
end
lib_files = FileList["lib/**/*.rb"]
bin_files = FileList["bin/xsd2bb", "bin/validate"]
desc "run bin, test, valid tasks"
task :default => [:bin, :test, :valid]
desc "make the programs in bin/"
task :bin => bin_files
file "bin/xsd2bb" => ["bin/xsd2bb.rb", *lib_files] do |t|
deps = lib_files.map do |file|
feature = file[/^lib\/(.*).rb$/,1]
"#{feature}=#{file}"
end
sh "bin/darb bin/xsd2bb.rb #{deps.join(" ")} >#{t.name} &&
chmod +x #{t.name}"
end
file "bin/validate" => ["bin/validate.rb", "lib/validate.rb"] do |t|
sh "bin/darb bin/validate.rb validate=lib/validate.rb > #{t.name} &&
chmod +x #{t.name}"
end
desc "remove generated files"
task :clean do
rm_f bin_files
end