-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
36 lines (28 loc) · 1004 Bytes
/
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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
TOOLBAR_ROOT = File.expand_path(File.dirname(__FILE__))
TOOLBAR_SRC_DIR = File.join(TOOLBAR_ROOT, 'src')
TOOLBAR_DIST_DIR = File.join(TOOLBAR_ROOT, 'dist')
task :default => :dist
desc "Builds the distribution."
task :dist => ["sprocketize:toolbar"]
desc "Update git submodules"
task :update_submodules do
system("git submodule init")
system("git submodule update")
end
namespace :sprocketize do
task :dist_dir do
FileUtils.mkdir_p(TOOLBAR_DIST_DIR)
end
task :toolbar => [:update_submodules, :dist_dir] do
require File.join(TOOLBAR_ROOT, "vendor", "sprockets", "lib", "sprockets")
secretary = Sprockets::Secretary.new(
:root => File.join(TOOLBAR_ROOT, "src"),
:load_path => [TOOLBAR_SRC_DIR],
:source_files => ["wysihat/advanced_toolbar.js"]
)
secretary.concatenation.save_to(File.join(TOOLBAR_DIST_DIR, "wysihat.advanced_toolbar.js"))
end
end