platinum-deployer 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6965447723e076da1ca02acdb1eb08c182d3b3e4
4
- data.tar.gz: 4d74616d606db76561aac45528b067a84b143e3a
3
+ metadata.gz: 3d5cec55da399cafaff4b6f2ca64dddb6c411798
4
+ data.tar.gz: 6f692c291c9f67703cc7debc5c6c49e319a75093
5
5
  SHA512:
6
- metadata.gz: 930cc1e85ea013e44367639cfac803e50fcca54b2976e3bfdf6cf51cd47b79d062d76b4f77d14b161eb72213eb5d15bb0ef8dab10e945286c9eb79053039b662
7
- data.tar.gz: b29706aa50a4443db203c8fc6ed7b13cbdf1bfcb99af7ea838950fa4255bbb975419ae81fdf4f3a801bc701f71e6879b024dcc3cac38593c14c726ef71d048c8
6
+ metadata.gz: 02507e63c23b4f4c63784ef2e26c944ce270934dbfcfaeedd2c42e1638269d8fd72eec95e1bed2a2dcaaa06270845a668ef026468b4cddf9ea53935948108b4b
7
+ data.tar.gz: b1957765a08a581edc0f12618232b163530bbf5270d9fc8555e4d48cb461595d3091bded552e327f36ef41ef2ea44cb42ad07bcd542a39008d3770e0e79d6ec7
data/Session.vim CHANGED
@@ -15,7 +15,7 @@ badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum\'
15
15
  badd +358 exe/platinum
16
16
  badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum-ios-simulate.js\'
17
17
  badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum-ios-simulate\'
18
- badd +19 exe/platinum-ios-simulate.js
18
+ badd +38 exe/platinum-ios-simulate.js
19
19
  badd +68 exe/platinum-appicon
20
20
  badd +18 README.md
21
21
  argglobal
@@ -24,25 +24,21 @@ edit lib/platinum/deployer/version.rb
24
24
  set splitbelow splitright
25
25
  wincmd _ | wincmd |
26
26
  split
27
- wincmd _ | wincmd |
28
- split
29
- 2wincmd k
27
+ 1wincmd k
30
28
  wincmd _ | wincmd |
31
29
  vsplit
32
30
  1wincmd h
33
31
  wincmd w
34
32
  wincmd w
35
- wincmd w
36
33
  set nosplitbelow
37
34
  set nosplitright
38
35
  wincmd t
39
36
  set winheight=1 winwidth=1
40
- exe '1resize ' . ((&lines * 19 + 30) / 60)
37
+ exe '1resize ' . ((&lines * 28 + 30) / 60)
41
38
  exe 'vert 1resize ' . ((&columns * 52 + 92) / 185)
42
- exe '2resize ' . ((&lines * 19 + 30) / 60)
39
+ exe '2resize ' . ((&lines * 28 + 30) / 60)
43
40
  exe 'vert 2resize ' . ((&columns * 132 + 92) / 185)
44
- exe '3resize ' . ((&lines * 18 + 30) / 60)
45
- exe '4resize ' . ((&lines * 19 + 30) / 60)
41
+ exe '3resize ' . ((&lines * 29 + 30) / 60)
46
42
  argglobal
47
43
  setlocal fdm=manual
48
44
  setlocal fde=0
@@ -53,12 +49,12 @@ setlocal fml=1
53
49
  setlocal fdn=20
54
50
  setlocal fen
55
51
  silent! normal! zE
56
- let s:l = 3 - ((2 * winheight(0) + 9) / 19)
52
+ let s:l = 3 - ((2 * winheight(0) + 14) / 28)
57
53
  if s:l < 1 | let s:l = 1 | endif
58
54
  exe s:l
59
55
  normal! zt
60
56
  3
61
- normal! 018|
57
+ normal! 020|
62
58
  wincmd w
63
59
  argglobal
64
60
  edit bin/setup
@@ -71,7 +67,7 @@ setlocal fml=1
71
67
  setlocal fdn=20
72
68
  setlocal fen
73
69
  silent! normal! zE
74
- let s:l = 12 - ((6 * winheight(0) + 9) / 19)
70
+ let s:l = 12 - ((9 * winheight(0) + 14) / 28)
75
71
  if s:l < 1 | let s:l = 1 | endif
76
72
  exe s:l
77
73
  normal! zt
@@ -79,24 +75,6 @@ normal! zt
79
75
  normal! 03|
80
76
  wincmd w
81
77
  argglobal
82
- edit exe/platinum-ios-simulate.js
83
- setlocal fdm=manual
84
- setlocal fde=0
85
- setlocal fmr={{{,}}}
86
- setlocal fdi=#
87
- setlocal fdl=0
88
- setlocal fml=1
89
- setlocal fdn=20
90
- setlocal fen
91
- silent! normal! zE
92
- let s:l = 35 - ((10 * winheight(0) + 9) / 18)
93
- if s:l < 1 | let s:l = 1 | endif
94
- exe s:l
95
- normal! zt
96
- 35
97
- normal! 011|
98
- wincmd w
99
- argglobal
100
78
  edit exe/platinum
101
79
  setlocal fdm=manual
102
80
  setlocal fde=0
@@ -107,19 +85,19 @@ setlocal fml=1
107
85
  setlocal fdn=20
108
86
  setlocal fen
109
87
  silent! normal! zE
110
- let s:l = 410 - ((13 * winheight(0) + 9) / 19)
88
+ let s:l = 257 - ((6 * winheight(0) + 14) / 29)
111
89
  if s:l < 1 | let s:l = 1 | endif
112
90
  exe s:l
113
91
  normal! zt
114
- 410
115
- normal! 068|
92
+ 257
93
+ normal! 0
116
94
  wincmd w
117
- exe '1resize ' . ((&lines * 19 + 30) / 60)
95
+ 3wincmd w
96
+ exe '1resize ' . ((&lines * 28 + 30) / 60)
118
97
  exe 'vert 1resize ' . ((&columns * 52 + 92) / 185)
119
- exe '2resize ' . ((&lines * 19 + 30) / 60)
98
+ exe '2resize ' . ((&lines * 28 + 30) / 60)
120
99
  exe 'vert 2resize ' . ((&columns * 132 + 92) / 185)
121
- exe '3resize ' . ((&lines * 18 + 30) / 60)
122
- exe '4resize ' . ((&lines * 19 + 30) / 60)
100
+ exe '3resize ' . ((&lines * 29 + 30) / 60)
123
101
  tabnext 1
124
102
  if exists('s:wipebuf')
125
103
  silent exe 'bwipe ' . s:wipebuf
data/exe/platinum CHANGED
@@ -64,7 +64,9 @@ DEFAULT_OPTIONS = {
64
64
  }
65
65
  },
66
66
  :ios_simulator => {
67
- :udid => nil
67
+ :devicetypeid => nil,
68
+ :udid => nil,
69
+ :autofocus => true
68
70
  },
69
71
  :testfairy => {
70
72
  :api_key => nil,
@@ -138,6 +140,7 @@ def bundle_path
138
140
  when 'device' then 'Debug-iphoneos'
139
141
  end
140
142
  path = File.join path, debug_dir, "#{@options[:app_name]}.app"
143
+ # TODO: android support
141
144
  end
142
145
  File.expand_path path
143
146
  end
@@ -210,34 +213,32 @@ OptionParser.new do |opts|
210
213
  else fatal "Target \"#{v}\" not recognized." end
211
214
  end
212
215
 
213
- opts.on('-O', '--output-dir=dir', 'Titanium Output Directory') do |v|
214
- parsed_options[:titanium_command][:output_dir] = v
215
- end
216
+ opts.on('-O', '--output-dir=dir', 'Titanium Output Directory') {|v|
217
+ parsed_options[:titanium_command][:output_dir] = v }
216
218
 
217
- opts.on('-L', '--log-level=level', 'Titanium Log Level') do |v|
218
- parsed_options[:titanium_command][:log_level] = v
219
- end
219
+ opts.on('-L', '--log-level=level', 'Titanium Log Level') {|v|
220
+ parsed_options[:titanium_command][:log_level] = v }
220
221
 
221
222
  opts.on('-V', '--developer-certificate=certificate',
222
- 'iOS Developer Certificate') do |v|
223
+ 'iOS Developer Certificate') {|v|
223
224
  parsed_options[:ios_credentials][:development][:developer_certificate] = v
224
- parsed_options[:ios_credentials][:production][:developer_certificate] = v
225
- end
226
-
225
+ parsed_options[:ios_credentials][:production][:developer_certificate] = v }
227
226
  opts.on('-P', '--provisioning-profile=profile',
228
- 'iOS Provisioning Profile') do |v|
227
+ 'iOS Provisioning Profile') {|v|
229
228
  parsed_options[:ios_credentials][:development][:provisioning_profile] = v
230
- parsed_options[:ios_credentials][:production][:provisioning_profile] = v
231
- end
229
+ parsed_options[:ios_credentials][:production][:provisioning_profile] = v }
232
230
 
233
- opts.on('-U', '--simulator-udid=udid', 'iOS Simulator UDID') do |v|
234
- parsed_options[:ios_simulator][:udid] = v
235
- end
231
+ opts.on('-U', '--simulator-udid=udid', 'iOS Simulator UDID') {|v|
232
+ parsed_options[:ios_simulator][:udid] = v }
233
+ opts.on('-D', '--devicetypeid=dtid', 'iOS Simulator DeviceTypeID') {|v|
234
+ parsed_options[:ios_simulator][:devicetypeid] = v }
236
235
 
237
- opts.on('--skip-compile', 'Skip Source Compilation') do
238
- parsed_options[:skip_compile] = true end
239
- opts.on('--skip-build', 'Skip Titanium Build') do
240
- parsed_options[:skip_build] = true end
236
+ opts.on('--no-autofocus', 'Disable iOS Simulator Autofocus') {
237
+ parsed_options[:ios_simulator][:autofocus] = false }
238
+ opts.on('--skip-compile', 'Skip Source Compilation') {
239
+ parsed_options[:skip_compile] = true }
240
+ opts.on('--skip-build', 'Skip Titanium Build') {
241
+ parsed_options[:skip_build] = true }
241
242
 
242
243
  opts.on('--help', 'Prints this help') do
243
244
  puts opts.banner
@@ -305,7 +306,7 @@ end
305
306
  #
306
307
 
307
308
  def build!
308
- if @options[:skip_compile]; log_info 'Skipping build.'; return true end
309
+ if @options[:skip_build]; log_info 'Skipping build.'; return true end
309
310
  log_info 'Building Titanium project...'; puts
310
311
  build_success = case build_cmd_opts[:target]
311
312
  when 'device' then build_for_device!
@@ -368,55 +369,38 @@ def deploy!
368
369
  log_success 'Application deployed successfully!'; puts; true
369
370
  end
370
371
  def deploy_to_emulator!
371
- # TODO: Android support
372
372
  sim_opts = @options[:ios_simulator]
373
- # base_cmd = base_cmd_for_simjs
374
- # if sim_opts[:udid].nil?
375
- # sim_list = get_simjs_sims
376
- # # ap sim_list; puts
377
- # sim_choices = {}
378
- # sim_list.each {|ios_version, simulators|
379
- # simulators.each {|s|
380
- # sim_choices[s['udid']] = "#{s['name']} running iOS #{ios_version}" } }
381
- # if sim_choices.keys.any?
382
- # choose do |menu|
383
- # menu.header = 'Installed iOS Simulators'
384
- # menu.prompt = 'Please choose a simulator to deploy to: '
385
- #
386
- # sim_choices.each {|udid, name|
387
- # menu.choice(name) {|choice| sim_opts[:udid] = udid } }
388
- # end
389
- # else
390
- # fatal 'You have no iOS simulators installed.'
391
- # end
392
- # end
393
- # cmd = "#{base_cmd} command=launch appPath=#{bundle_path}"
394
- # cmd << " simUDID=#{sim_opts[:udid]}"
395
-
396
- if sim_opts[:devicetypeid].nil?
397
- devicetypes = `ios-sim showdevicetypes`.strip
398
- if devicetypes.length
399
- sim_choices = {}
400
- devicetypes.lines.each do |line|
401
- dtid, ios_version = line.strip.split ', '
402
- title = dtid.gsub '-', ' '
403
- sim_choices[dtid] = "#{title} running iOS #{ios_version} (#{dtid})"
404
- end
405
- choose do |menu|
406
- menu.header = 'Installed iOS Simulators'
407
- menu.prompt = 'Please choose a simulator to deploy to: '
408
373
 
409
- sim_choices.each {|dtid, name|
410
- menu.choice(name) {|choice| sim_opts[:devicetypeid] = dtid } }
374
+ case build_cmd_opts[:platform]
375
+ when 'ios'
376
+ if sim_opts[:devicetypeid].nil?
377
+ devicetypes = `ios-sim showdevicetypes`.strip
378
+ if devicetypes.length
379
+ sim_choices = {}
380
+ devicetypes.lines.each do |line|
381
+ dtid, ios_version = line.strip.split ', '
382
+ title = dtid.gsub '-', ' '
383
+ sim_choices[dtid] = "#{title} running iOS #{ios_version} (#{dtid})"
384
+ end
385
+ choose do |menu|
386
+ menu.header = 'Installed iOS Simulators'
387
+ menu.prompt = 'Please choose a simulator to deploy to: '
388
+
389
+ sim_choices.each {|dtid, name|
390
+ menu.choice(name) {|choice| sim_opts[:devicetypeid] = dtid } }
391
+ end
392
+ else
393
+ fatal 'You have no iOS simulators installed.'
411
394
  end
412
- else
413
- fatal 'You have no iOS simulators installed.'
414
395
  end
396
+ cmd = "ios-sim launch #{bundle_path} --exit"
397
+ cmd << " --devicetypeid #{sim_opts[:devicetypeid]}" if sim_opts[:devicetypeid]
398
+ system cmd
399
+ focus_simulator! if sim_opts[:autofocus]
400
+ # TODO: hook up lldb somehow
401
+ # TODO: Android support
415
402
  end
416
- cmd = "ios-sim launch #{bundle_path} --exit"
417
- cmd << " --devicetypeid #{sim_opts[:devicetypeid]}" if sim_opts[:devicetypeid]
418
- system cmd
419
- # TODO: hook up lldb somehow
403
+ true
420
404
  rescue Errno::ENOENT => e
421
405
  if e.message == 'No such file or directory - ios-sim'
422
406
  warn 'Looks like you haven\'t installed the ios-sim package yet.'
@@ -426,6 +410,12 @@ rescue Errno::ENOENT => e
426
410
  else raise e end
427
411
  end
428
412
  alias deploy_to_simulator! deploy_to_emulator!
413
+ def focus_terminal!
414
+ # TODO: support for platforms besides OS X and iTerm
415
+ system 'osascript -e \'tell application "iTerm2" to activate\'' end
416
+ def focus_simulator!
417
+ # TODO: support for platforms besides OS X
418
+ system 'osascript -e \'tell application "iOS Simulator" to activate\'' end
429
419
  @path_to_sim_script = File.expand_path(
430
420
  File.join(__dir__, 'platinum-ios-simulate.js'))
431
421
  def base_cmd_for_simjs; "node #{@path_to_sim_script}" end
@@ -434,6 +424,7 @@ def get_simjs_sims
434
424
  begin return JSON.parse json_sim_list
435
425
  rescue => e; fatal e.message; end
436
426
  end
427
+
437
428
  def deploy_to_device!
438
429
  cmd = "ios-deploy --debug --bundle #{bundle_path}"
439
430
  # system cmd
@@ -551,6 +542,7 @@ if @command
551
542
  when 'compile' then compile_source!
552
543
  when 'build' then build! if compile_source! # Compile and build.
553
544
  when 'deploy'
545
+ focus_terminal!
554
546
  # Force a git commit upfront.
555
547
  force_git_commit! if build_cmd_opts[:target] =~ /^dist/
556
548
  deploy! if compile_source! && build! # Compile, build and deploy.
@@ -1,5 +1,5 @@
1
1
  module Platinum
2
2
  module Deployer
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platinum-deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith