Class: DeployGate::Commands::Deploy::Build
- Inherits:
-
Object
- Object
- DeployGate::Commands::Deploy::Build
- Defined in:
- lib/deploygate/commands/deploy/build.rb
Constant Summary collapse
- COMMAND =
'build'
Class Method Summary collapse
- .ios(workspaces, options) ⇒ void
- .over_xcode?(version_number) ⇒ Boolean
- .print_no_install_xcode ⇒ Object
- .print_no_target ⇒ Object
- .run(args, options) ⇒ void
- .select_method ⇒ Object
Class Method Details
.ios(workspaces, options) ⇒ void
This method returns an undefined value.
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 |
# File 'lib/deploygate/commands/deploy/build.rb', line 33 def ios(workspaces, ) DeployGate::Xcode::Export.check_local_certificates build_configuration = .configuration target_scheme = .scheme xcodeproj_path = .xcodeproj analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, target_scheme, xcodeproj_path) target_scheme = analyze.scheme code_sign_identity = nil project_profile_info = nil allow_provisioning_updates = true if analyze.code_sign_style == Xcode::Analyze::PROVISIONING_STYLE_MANUAL code_sign_identity = analyze.code_sign_identity project_profile_info = analyze.project_profile_info end method = Xcode::Export.method(analyze.target_provisioning_profile) || select_method ipa_path = DeployGate::Xcode::Ios.build( analyze, target_scheme, code_sign_identity, project_profile_info, build_configuration, method, allow_provisioning_updates ) Push.upload([ipa_path], ) end |
.over_xcode?(version_number) ⇒ Boolean
70 71 72 73 74 75 76 77 78 |
# File 'lib/deploygate/commands/deploy/build.rb', line 70 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 |
.print_no_install_xcode ⇒ Object
80 81 82 83 84 |
# File 'lib/deploygate/commands/deploy/build.rb', line 80 def print_no_install_xcode puts '' puts HighLine.color(I18n.t('commands.deploy.build.print_no_install_xcode'), HighLine::YELLOW) puts '' end |
.print_no_target ⇒ Object
64 65 66 67 68 |
# File 'lib/deploygate/commands/deploy/build.rb', line 64 def print_no_target puts '' puts HighLine.color(I18n.t('commands.deploy.build.print_no_target'), HighLine::YELLOW) puts '' end |
.run(args, options) ⇒ void
This method returns an undefined value.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/deploygate/commands/deploy/build.rb', line 12 def run(args, ) # android/ios build work_dir = args.empty? ? Dir.pwd : args.first # override options command .command = .command || COMMAND if DeployGate::Project.ios?(work_dir) root_path = DeployGate::Xcode::Ios.project_root_path(work_dir) workspaces = DeployGate::Xcode::Ios.find_workspaces(root_path) ios(workspaces, ) elsif DeployGate::Project.android?(work_dir) DeployGate::Android::GradleDeploy.new(work_dir, ).deploy else print_no_target end end |
.select_method ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/deploygate/commands/deploy/build.rb', line 86 def select_method result = nil cli = HighLine.new cli.choose do || .prompt = I18n.t('commands.deploy.build.select_method.title') .choice(DeployGate::Xcode::Export::AD_HOC) { result = DeployGate::Xcode::Export::AD_HOC } .choice(DeployGate::Xcode::Export::ENTERPRISE) { result = DeployGate::Xcode::Export::ENTERPRISE } end result end |