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
|
# File 'lib/flappy/util/archive_ipa.rb', line 5
def archive_ipa(*args, options)
build_dir = Dir.pwd
ipa_dir = ''
if args.count == 2
build_dir = args.first.to_s
ipa_dir = args.last.to_s
elsif args.count == 1
build_dir = args.first.to_s
end
check_condition(build_dir, 'build dir can not be empty!')
build_dir = File.expand_path(build_dir) unless build_dir.blank?
unless ipa_dir.blank?
ipa_path = File.join(ipa_dir, Time.now.strftime('%Y%m%d%H%M%S') + '.ipa')
else
ipa_path = File.join(build_dir, Time.now.strftime('%Y%m%d%H%M%S') + '.ipa')
end
puts "build_dir: #{build_dir}\nipa_path: #{ipa_path}"
xcrun_cmd = archive_ipa_with_path(build_dir, ipa_path)
puts '>>>>>>>>>>>>>>>>>>>>>>>>>>>> Archiving......'
puts "archive cmd: #{xcrun_cmd}"
system(xcrun_cmd) unless xcrun_cmd.blank?
if $?.to_i != 0
puts '>>>>>>>>>>>>>>>>>>>>>>>>>>>> Archive failed'
exit 1
else
puts '>>>>>>>>>>>>>>>>>>>>>>>>>>>> Archive succeed'
end
end
|