Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: gem update --system
- run: bundle exec rake

instrument-ruby2:
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ en:
scheme: 'Set Xcode build scheme (iOS app only)'
open: 'Open a browser after the build uploaded (OS X only)'
disable_notify: 'Disable email notification (iOS app only)'
xcodeproj: 'The path to the target Xcode project file (iOS app only)'
xcodeproj: 'The path to the target .xcodeproj file (iOS app only)'
workspace: 'The path to the target .xcworkspace file (iOS app only)'
add_devices:
description: 'Register devices to your Apple Developer account and refresh your provisioning profile. (iOS only) By default, it automatically finds new devices added to your application on DeployGate and ask you which device to register. You can also specify which device to register via command line options.'
udid: 'UDID to be registered'
Expand Down
1 change: 1 addition & 0 deletions deploygate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ POST_INSTALL_MESSAGE
spec.add_development_dependency 'rspec', '~> 3.5'
spec.add_development_dependency 'webmock', '~> 2.3'
spec.add_development_dependency 'i18n-tasks', '~> 1.0'
spec.add_development_dependency 'debug', '>= 1.0.0'

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Expand Down
2 changes: 2 additions & 0 deletions lib/deploygate/command_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def run
c.option '--open', I18n.t('command_builder.deploy.open')
c.option '--disable_notify', I18n.t('command_builder.deploy.disable_notify')
c.option '--xcodeproj STRING', I18n.t('command_builder.deploy.xcodeproj')
c.option '--workspace STRING', I18n.t('command_builder.deploy.workspace')
c.action do |args, options|
options.default :message => '', :user => nil, :open => false, 'disable_notify' => false, :command => nil
begin
Expand All @@ -95,6 +96,7 @@ def run
c.option '--server', I18n.t('command_builder.add_devices.server.description')
c.option '--disable_notify', I18n.t('command_builder.deploy.disable_notify')
c.option '--xcodeproj STRING', I18n.t('command_builder.deploy.xcodeproj')
c.option '--workspace STRING', I18n.t('command_builder.deploy.workspace')
c.action do |args, options|
options.default :user => nil, :server => false, :command => 'add_devices'
begin
Expand Down
20 changes: 12 additions & 8 deletions lib/deploygate/commands/add_devices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def run(args, options)
work_dir = args.empty? ? Dir.pwd : args.first
ios_only_command unless DeployGate::Project.ios?(work_dir)

# Change the current working directory for fastlane else.
root_path = DeployGate::Xcode::Ios.project_root_path(work_dir)
Dir.chdir(root_path)

session = DeployGate::Session.new
unless session.login?
Login.start_login()
Expand All @@ -21,15 +25,15 @@ def run(args, options)
distribution_key = options.distribution_key
server = options.server

build_configuration = options.configuration
xcodeproj_path = options.xcodeproj
analyze = DeployGate::Xcode::Analyze.new(
build_configuration: options.configuration,
xcodeproj_path: options.xcodeproj,
workspace_path: options.workspace
)

root_path = DeployGate::Xcode::Ios.project_root_path(work_dir)
workspaces = DeployGate::Xcode::Ios.find_workspaces(root_path)
analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, nil, xcodeproj_path)
bundle_id = analyze.target_bundle_identifier
developer_team = analyze.developer_team
member_center = DeployGate::Xcode::MemberCenter.new(developer_team)
bundle_id = analyze.bundle_identifier
export_team_id = analyze.export_team_id
member_center = DeployGate::Xcode::MemberCenter.new(export_team_id)

if server
run_server(session, owner, bundle_id, distribution_key, member_center, args, options)
Expand Down
56 changes: 14 additions & 42 deletions lib/deploygate/commands/deploy/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,34 @@ def run(args, options)
options.command = options.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, options)
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 [Array] workspaces
# @param [String] work_dir
# @param [Hash] options
# @return [void]
def ios(workspaces, options)
def ios(work_dir, options)
DeployGate::Xcode::Export.check_local_certificates
build_configuration = options.configuration
target_scheme = options.scheme
xcodeproj_path = options.xcodeproj

analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, target_scheme, xcodeproj_path)
target_scheme = analyze.scheme
# Change the current working directory for fastlane else.
root_path = DeployGate::Xcode::Ios.project_root_path(work_dir)
Dir.chdir(root_path)

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
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(
analyze,
target_scheme,
code_sign_identity,
project_profile_info,
build_configuration,
method,
allow_provisioning_updates
ios_analyze: analyze,
allow_provisioning_updates: true
)
Push.upload([ipa_path], options)
end
Expand All @@ -82,22 +70,6 @@ def print_no_install_xcode
puts HighLine.color(I18n.t('commands.deploy.build.print_no_install_xcode'), HighLine::YELLOW)
puts ''
end

def select_method
result = nil
cli = HighLine.new
cli.choose do |menu|
menu.prompt = I18n.t('commands.deploy.build.select_method.title')
menu.choice(DeployGate::Xcode::Export::AD_HOC) {
result = DeployGate::Xcode::Export::AD_HOC
}
menu.choice(DeployGate::Xcode::Export::ENTERPRISE) {
result = DeployGate::Xcode::Export::ENTERPRISE
}
end

result
end
end
end
end
Expand Down
Loading