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 +4 -4
- data/Session.vim +15 -37
- data/exe/platinum +58 -66
- data/lib/platinum/deployer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d5cec55da399cafaff4b6f2ca64dddb6c411798
|
4
|
+
data.tar.gz: 6f692c291c9f67703cc7debc5c6c49e319a75093
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 +
|
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
|
-
|
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 *
|
37
|
+
exe '1resize ' . ((&lines * 28 + 30) / 60)
|
41
38
|
exe 'vert 1resize ' . ((&columns * 52 + 92) / 185)
|
42
|
-
exe '2resize ' . ((&lines *
|
39
|
+
exe '2resize ' . ((&lines * 28 + 30) / 60)
|
43
40
|
exe 'vert 2resize ' . ((&columns * 132 + 92) / 185)
|
44
|
-
exe '3resize ' . ((&lines *
|
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) +
|
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!
|
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 - ((
|
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 =
|
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
|
-
|
115
|
-
normal!
|
92
|
+
257
|
93
|
+
normal! 0
|
116
94
|
wincmd w
|
117
|
-
|
95
|
+
3wincmd w
|
96
|
+
exe '1resize ' . ((&lines * 28 + 30) / 60)
|
118
97
|
exe 'vert 1resize ' . ((&columns * 52 + 92) / 185)
|
119
|
-
exe '2resize ' . ((&lines *
|
98
|
+
exe '2resize ' . ((&lines * 28 + 30) / 60)
|
120
99
|
exe 'vert 2resize ' . ((&columns * 132 + 92) / 185)
|
121
|
-
exe '3resize ' . ((&lines *
|
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
|
-
:
|
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')
|
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')
|
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')
|
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')
|
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')
|
234
|
-
parsed_options[:ios_simulator][:udid] = v
|
235
|
-
|
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('--
|
238
|
-
parsed_options[:
|
239
|
-
opts.on('--skip-
|
240
|
-
parsed_options[:
|
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[:
|
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
|
-
|
410
|
-
|
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
|
-
|
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.
|