videojuicer-player-sdk 0.3.6 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/playersdk/compiler.rb +62 -6
  3. metadata +3 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 3
4
- :patch: 6
4
+ :patch: 9
@@ -1,6 +1,6 @@
1
1
  module PlayerSDK
2
2
  class Compiler
3
- attr_accessor :config, :compiler
3
+ attr_accessor :config, :compiler, :version
4
4
 
5
5
  def initialize(config)
6
6
  self.config = config.clone
@@ -13,16 +13,61 @@ module PlayerSDK
13
13
 
14
14
  puts "Found #{tasks.length} task(s) to process"
15
15
 
16
+ # find the copy tasks
16
17
  tasks.each do |key,value|
17
- self.run_task(key, value)
18
+ if value['type'] == 'copy'
19
+ self.run_task(key, value)
20
+ end
21
+ end
22
+
23
+ find_version
24
+
25
+ self.config['deployment_url'] = self.config['deployment_url'].gsub("%V", self.version)
26
+
27
+ puts "Deployment url set to: #{self.config['deployment_url']}"
28
+
29
+ tasks.each do |key,value|
30
+ if value['type'] != 'copy'
31
+ self.run_task(key, value)
32
+ end
18
33
  end
19
34
 
20
35
  puts "\n\n"
21
36
  puts "Completed #{tasks.length} tasks(s)"
22
37
  end
23
38
 
39
+ def find_version
40
+ file = File.read("#{self.config['build_dir']}/version.properties")
41
+
42
+ if (file == nil)
43
+ puts "No version file found"
44
+ return
45
+ end
46
+
47
+ version_s = ""
48
+ file.scan(/version.([a-z]+) = ('?)([\w]+)('?)/i).each { |key, q1, value, q2|
49
+ if value != ''
50
+ if key == 'text'
51
+ version_s = version_s.slice(0, version_s.length - 1)
52
+ end
53
+
54
+ version_s += "#{value}."
55
+ end
56
+ }
57
+
58
+ version_s = version_s.slice(0, version_s.length - 1)
59
+
60
+ self.version = version_s
61
+
62
+ puts "Using version #{self.version}"
63
+ end
64
+
24
65
  def run_task(key, value)
25
- puts "Running task #{key} in #{value['src']}"
66
+ if value['src'] != nil && value['src'] != ''
67
+ puts "\nRunning task #{key} in #{value['src']}"
68
+ else
69
+ puts "\nRunning task #{key}"
70
+ end
26
71
 
27
72
  case value['type']
28
73
  when "player"
@@ -38,14 +83,25 @@ module PlayerSDK
38
83
  when "addon"
39
84
  self.compiler.compile_mxmlc(value['src'], value['main'], value['sdk'], value['engine'], value['libs'], value['target'], self.config['build_dir'], self.config['deployment_url'])
40
85
  when "framework"
41
- puts "Moving Flex framework RSLs to #{config['build_dir']}"
86
+ if value['target'] == nil || value['target'] == ""
87
+ value['target'] = 'framework'
88
+ end
89
+
90
+ puts "Moving Flex framework RSLs to #{value['target']}"
91
+
92
+ self.compiler.run_command("cp #{config['flex_sdk']}/frameworks/rsls/#{value['framework_rsl']}.swz #{config['build_dir']}/#{value['target']}.swz")
42
93
 
43
- self.compiler.run_command("cp #{config['flex_sdk']}/frameworks/rsls/#{value['framework_rsl']}.swz #{config['build_dir']}/framework.swz")
44
- self.compiler.run_command("cp #{config['flex_sdk']}/frameworks/rsls/#{value['framework_rsl']}.swf #{config['build_dir']}/framework.swf")
94
+ self.compiler.run_command("cp #{config['flex_sdk']}/frameworks/rsls/#{value['framework_rsl']}.swf #{config['build_dir']}/#{value['target']}.swf")
95
+
96
+ self.compiler.run_command("chmod 644 #{config['build_dir']}/#{config['target']}.sw*")
45
97
  when "clean"
46
98
  puts "Cleaning directories ..."
47
99
 
48
100
  self.compiler.run_command("rm -rf #{config['build_dir']}/* #{config['tmp_dir']}/*")
101
+ when "copy"
102
+ puts "Copying over #{value['src']}"
103
+
104
+ self.compiler.run_command("cp #{value['src']} #{config['build_dir']}/#{value['target']}")
49
105
  when ""
50
106
  puts "Unknown task type, skipping task ..\n"
51
107
  return
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: videojuicer-player-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Livesley
@@ -51,6 +51,7 @@ files:
51
51
  - lib/playersdk/compilers/flex.rb
52
52
  has_rdoc: true
53
53
  homepage: http://developer.videojuicer.com
54
+ licenses:
54
55
  post_install_message:
55
56
  rdoc_options:
56
57
  - --charset=UTF-8
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
72
  requirements: []
72
73
 
73
74
  rubyforge_project:
74
- rubygems_version: 1.2.0
75
+ rubygems_version: 1.3.5
75
76
  signing_key:
76
77
  specification_version: 2
77
78
  summary: Videojuicer Player SDK runtime and compiler.