forked from RoryO/JAweSomePlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (55 loc) · 1.52 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
VERSION = "1.0"
task :default => [:concat, :minify, :rel]
task :concat => :clean_js do
File.open("js/player.js", "w+") do |f|
Dir.chdir 'lib/js' do
puts Dir.pwd
f << File.read('./swfobject.js')
end
Dir.chdir 'src' do
FileList['es5-shim.js', 'utils.js',
'broker.js', 'engine.js', 'base.js'].each do |source_file|
f << File.read(source_file)
end
end
end
end
task :minify do
file 'js/player-min.js'
system "java -jar lib/yuicompressor.jar js/player.js > js/player-min.js"
end
task :clean => [:clean_js, :clean_flash, :clean_doc]
task :clean_flash do
rm_rf 'flash/*.swf'
end
task :clean_js do
rm_rf 'js/*'
end
task :clean_doc do
rm_rf "lib/yuidoc/out/*"
rm_rf "doc/*"
end
task :flash do
Dir.chdir 'flash' do
system 'mxmlc -load-config+=base.xml -load-config+=release.xml JAwesomePlayer.as -o jsplayer.swf'
end
end
task :flash_debug do
Dir.chdir 'flash' do
system 'mxmlc -load-config+=base.xml -load-config+=debug.xml JAwesomePlayer.as -o jsplayer_debug.swf'
end
end
task :doc do
doc_home = "./lib/yuidoc"
template_files = "./lib/yuidoc/template"
parser_in = "./src"
parser_out = "./lib/yuidoc/out"
generator_out = "./doc"
system "python lib/yuidoc/yuidoc.py #{parser_in} -p #{parser_out} -o #{generator_out} -t #{template_files} -v #{VERSION}"
end
task :rel do
rm_rf "rel"
mkdir "rel"
cp ["js/player.js", "js/player-min.js", "flash/jsplayer.swf"], "rel"
end
task :everything => [:concat, :clean_flash, :minify, :flash_debug, :flash, :rel]