This repository has been archived by the owner on Feb 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 573
/
Rakefile
77 lines (63 loc) · 2.18 KB
/
Rakefile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
prefix = File.dirname( __FILE__ )
sstoolkit = File.join(prefix, '../')
output_dir = File.join(prefix, 'Output')
doxygen_config = File.join(prefix, 'Doxygen/doxygen.config')
doxyclean = File.join(prefix, 'Doxygen/doxyclean.py')
gemfile = File.join(prefix, 'Gemfile')
sass_dir = File.join(prefix, 'scss')
temp_dir = File.join(prefix, 'temp')
css_dir = File.join(temp_dir, 'css')
compass_options = "--sass-dir #{sass_dir} --css-dir #{css_dir} --output-style compressed"
task :default => :all
desc 'Clean, build, and reformat docs'
task :all => [:clean, :build, :reformat] do
puts "Done!"
end
desc 'Remove all generated documentation'
task :clean do
system "rm -rf #{temp_dir} #{output_dir}"
end
desc 'Build the documentation with Doxygen'
task :build => [temp_dir] do
system "cd #{prefix}; doxygen #{doxygen_config}"
end
desc 'Reformat documentation with Doxyclean'
task :reformat => :compass do
system "rm -rf #{output_dir}"
system "python #{doxyclean} --phone --input=#{temp_dir}/xml --output=#{temp_dir}/doxyclean --name=SSToolkit"
system "mv #{temp_dir}/doxyclean/html #{output_dir}"
end
desc 'Open the generated documentation in default browser'
task :open do
system "open #{output_dir}/index.html"
end
desc 'Rebuild, format, and open'
task :'rebuild:open' => [:clean, :build, :reformat, :open]
# Bundler
desc 'Run Bundler and install gems'
task :bundle do
# Check for Bundler
require 'rubygems'
begin
require 'bundler'
rescue LoadError
puts 'You must `gem install bundler` to run rake tasks' and return
end
# puts 'Updating gems...'
system "bundle install --gemfile=#{gemfile} --quiet"
end
desc 'Build Compass output'
task :compass => [:bundle, temp_dir, :'compass:clean'] do
system "export BUNDLE_GEMFILE=#{gemfile}; bundle exec compass compile #{compass_options} --boring --quiet"
end
namespace :compass do
desc 'Clean Compass output'
task :clean do
system "rm -rf #{css_dir}"
end
desc 'Start Compass watching the stylesheets directory'
task :watch => [:'compass:clean'] do
system "BUNDLE_GEMFILE=#{gemfile}; bundle exec compass watch #{compass_options}"
end
end
directory temp_dir