Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gym] iOS Export Options "Destination" Handling #16609

Merged
merged 3 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions gym/lib/gym/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ def building_mac_catalyst_for_ios?
def building_mac_catalyst_for_mac?
Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "macos"
end

def export_destination_upload?
config_path = Gym.cache[:config_path]
return false if config_path.nil?

result = CFPropertyList.native_types(CFPropertyList::List.new(file: config_path).value)
return result["destination"] == "upload"
end
end

Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
Expand Down
25 changes: 16 additions & 9 deletions gym/lib/gym/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Gym
class Runner
# @return (String) The path to the resulting ipa
# rubocop:disable Metrics/PerceivedComplexity
def run
unless Gym.config[:skip_build_archive]
build_app
Expand All @@ -34,13 +35,16 @@ def run

package_app
compress_and_move_dsym
path = move_ipa
move_manifest
move_app_thinning
move_app_thinning_size_report
move_apps_folder
move_asset_packs
move_appstore_info

unless Gym.export_destination_upload?
path = move_ipa
move_manifest
move_app_thinning
move_app_thinning_size_report
move_apps_folder
move_asset_packs
move_appstore_info
end
elsif is_mac
path = File.expand_path(Gym.config[:output_directory])
compress_and_move_dsym
Expand All @@ -49,14 +53,17 @@ def run
return path if Gym.config[:skip_package_pkg]

package_app
path = move_pkg
move_appstore_info
unless Gym.export_destination_upload?
path = move_pkg
move_appstore_info
end
return path
end
copy_files_from_path(File.join(BuildCommandGenerator.archive_path, "Products/usr/local/bin/*")) if Gym.project.command_line_tool?
end
return path
end
# rubocop:enable Metrics/PerceivedComplexity

#####################################################
# @!group Printing out things
Expand Down