-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
61 lines (47 loc) · 1.62 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
desc "Run tests in Adobe Air..."
task :test do
puts `adl test-app.xml`
end
desc "Compiles all targets"
task :build=>[:build_dm, :build_dataset] do
puts "Finished."
end
desc "Compiles from source scripts into dist/dm.js"
task :build_dm do
puts "Building dm.js..."
require 'sprockets'
secretary = Sprockets::Secretary.new(
:asset_root => "assets",
:load_path => ["source", "etc", "."],
:source_files => ["source/dm.js"]
)
# Generate a Sprockets::Concatenation object from the source files
concatenation = secretary.concatenation
# Write the concatenation to disk
concatenation.save_to("dist/dm.js")
puts "Piping dm.js through jsmin..."
`cat dist/dm.js | jsmin > dist/dm.min.js`
puts "Piping dm.js through yuicompressor..."
`java -jar $HOME/Dev/bin/yuicompressor-2.3.5.jar -o dist/dm.ymin.js dist/dm.js`
puts 'Done.'
end
desc "Compiles from source scripts into dist/dataset.js"
task :build_dataset do
puts "Building dataset.js..."
require 'sprockets'
secretary = Sprockets::Secretary.new(
:asset_root => "assets",
:load_path => ["source", "etc", "."],
:source_files => ["source/dataset.js"]
)
# Generate a Sprockets::Concatenation object from the source files
concatenation = secretary.concatenation
# Write the concatenation to disk
concatenation.save_to("dist/dataset.js")
puts "Piping dataset.js through jsmin..."
`cat dist/dataset.js | jsmin > dist/dataset.min.js`
puts "Piping dataset.js through yuicompressor..."
`java -jar $HOME/Dev/bin/yuicompressor-2.3.5.jar -o dist/dataset.ymin.js dist/dataset.js`
puts 'Done.'
end
task :default=>:build