dima / rx-ui forked from malkomalko/rx-ui

work in progress, not intended for general use atm

This URL has Read+Write access

malkomalko (author)
Tue Feb 17 09:08:17 -0800 2009
commit  2054e0c6e86f02a09744d941c60d87eeac9e219b
tree    59808e55f25d2891420058c3131407f838d3c780
parent  0d592616dd3e829b2f05bf39590773cc4a35ea24
rx-ui / Rakefile
100644 52 lines (40 sloc) 1.591 kb
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
# this will use the latest version of restfulx gem
require 'restfulx/tasks'
 
TEST_APP_NAME = 'TestApp.mxml'
 
namespace :air do
  desc "Build and run the AIR application"
  task :run => ["rx:air:build", "rx:air:run"]
end
 
namespace :flex do
  desc "Test flex application"
  task :test => ["rx:test:build", "rx:test:run"]
  
  desc "Build flex application"
  task :build do
    libs = [] # you can add libraries that are not in lib folder here
    compile_app(get_executable('mxmlc'), 'bin-debug', "-library-path+=#{libs.join(',')}")
  end
end
 
namespace :rx do
  namespace :test do
    desc "Build flex test swf file"
    task :build do
      project_path = File.join(APP_ROOT, "app/flex", TEST_APP_NAME)
    
      libs = Dir.glob(File.join(APP_ROOT, 'lib', '*.swc'))
      #libs << 'foobar' # you can add libraries that not in lib folder here
    
      target_project_path = File.join(APP_ROOT, "bin-debug", TEST_APP_NAME.sub(/.mxml$/, '.swf'))
    
      cmd = "#{get_executable('mxmlc')} +configname=air -library-path+=#{libs.join(',')} " <<
        "-output #{target_project_path} -debug=true #{project_path}"
 
      if !system("#{cmd}")
        puts "failed to compile test application"
      end
    end
    
    desc "Run flex test application"
    task :run do
      project_path = File.join(APP_ROOT, "app/flex", TEST_APP_NAME)
      target_project_air_descriptor = project_path.sub(/.mxml$/, '-app.xml')
      
      if !system("#{get_executable('adl')} #{target_project_air_descriptor} #{APP_ROOT}")
        puts "failed to run test application"
      end
    end
  end
end