-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.rb
More file actions
77 lines (65 loc) · 2.23 KB
/
build.rb
File metadata and controls
77 lines (65 loc) · 2.23 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module DeployGate
module Commands
module Deploy
class Build
COMMAND = 'build'
class << self
# @param [Array] args
# @param [Hash] options
# @return [void]
def run(args, options)
# android/ios build
work_dir = args.empty? ? Dir.pwd : args.first
# override options command
options.command = options.command || COMMAND
if DeployGate::Project.ios?(work_dir)
ios(work_dir, options)
elsif DeployGate::Project.android?(work_dir)
DeployGate::Android::GradleDeploy.new(work_dir, options).deploy
else
print_no_target
end
end
# @param [String] work_dir
# @param [Hash] options
# @return [void]
def ios(work_dir, options)
DeployGate::Xcode::Export.check_local_certificates
# Change the current working directory for fastlane else.
root_path = DeployGate::Xcode::Ios.project_root_path(work_dir)
Dir.chdir(root_path)
analyze = DeployGate::Xcode::Analyze.new(
build_configuration: options.configuration,
target_scheme: options.scheme,
xcodeproj_path: options.xcodeproj,
workspace_path: options.workspace
)
ipa_path = DeployGate::Xcode::Ios.build(
ios_analyze: analyze,
allow_provisioning_updates: true
)
Push.upload([ipa_path], options)
end
def print_no_target
puts ''
puts HighLine.color(I18n.t('commands.deploy.build.print_no_target'), HighLine::YELLOW)
puts ''
end
def over_xcode?(version_number)
version = Gym::Xcode.xcode_version
if version == nil
print_no_install_xcode
exit 1
end
version.split('.')[0].to_i >= version_number
end
def print_no_install_xcode
puts ''
puts HighLine.color(I18n.t('commands.deploy.build.print_no_install_xcode'), HighLine::YELLOW)
puts ''
end
end
end
end
end
end