-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (58 loc) · 3.01 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
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
@@Windows = RUBY_PLATFORM.include? "mswin32"
flex_compile = "mxmlc"
if @@Windows
require 'win32/sound'
include Win32
flex_compile = flex_compile+".exe"
end
def normalize_paths(source)
if @@Windows
source
else
source.gsub("\\", "/")
end
end
namespace :build do
desc "Build the Flex components in test mode"
task(:test) do
puts %x[#{flex_compile} -target-player=10 -compiler.debug --services=src/services-config.xml -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -link-report=report.xml #{normalize_paths(" --include-libraries libs\\automation_monkey3.x.swc libs\\automation_agent.swc libs\\automation.swc libs\\automation_agent_rb.swc -output=public\\Main.swf src\\Main.mxml")}]
puts %x[#{flex_compile} -target-player=10 -compiler.debug --services=src/services-config.xml -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -load-externs=report.xml #{normalize_paths("-output=public\\modules\\Core.swf src\\modules\\Core.mxml")}]
File.delete('report.xml')
if @@Windows
Sound.play('tada.wav')
end
end
desc "Build the Flex components in debug mode"
task(:debug) do
puts %x[#{flex_compile} -target-player=10 -compiler.debug --services=src/services-config.xml -compiler.incremental -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -link-report=report.xml #{normalize_paths("-output=public\\Main.swf src\\Main.mxml")}]
puts %x[#{flex_compile} -target-player=10 -compiler.debug --services=src/services-config.xml -compiler.incremental -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -load-externs=report.xml #{normalize_paths("-output=public\\modules\\Core.swf src\\modules\\Core.mxml")}]
File.delete('report.xml')
if @@Windows
Sound.play('tada.wav')
end
end
desc "Build the Flex components in production mode"
task(:production) do
puts %x[#{flex_compile} -target-player=10 -show-unused-type-selector-warnings=false --services=src/services-config.xml -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -link-report=report.xml #{normalize_paths("-output=public\\Main.swf src\\Main.mxml")}]
puts %x[#{flex_compile} -target-player=10 --services=src/services-config.xml -compiler.source-path=src -compiler.source-path+=public -library-path+=libs -load-externs=report.xml #{normalize_paths("-output=public\\modules\\Core.swf src\\modules\\Core.mxml")}]
File.delete('report.xml')
if @@Windows
Sound.play('tada.wav')
end
end
end
namespace :test do
desc "Run the Flex tests in test/flex"
Rake::TestTask.new(:flex => "db:test:prepare") do |t|
t.libs << "test"
t.pattern = 'test/flex/**/*_test.rb'
t.verbose = true
end
end