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] Copy Asset Pack into output directory #16117

Merged
merged 2 commits into from Mar 23, 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
4 changes: 4 additions & 0 deletions gym/lib/gym/generators/package_command_generator.rb
Expand Up @@ -49,6 +49,10 @@ def apps_path
generator.apps_path
end

def asset_packs_path
generator.asset_packs_path
end

# The generator we need to use for the currently used Xcode version
# Since we dropped Xcode 6 support, it's just this class, but maybe we'll have
# new classes in the future
Expand Down
5 changes: 5 additions & 0 deletions gym/lib/gym/generators/package_command_generator_xcode7.rb
Expand Up @@ -136,6 +136,11 @@ def apps_path
Gym.cache[:apps_path] ||= File.join(temporary_output_path, "Apps")
end

# The path to the Apps folder
def asset_packs_path
Gym.cache[:asset_packs_path] ||= File.join(temporary_output_path, "OnDemandResources")
end

private

def normalize_export_options(hash)
Expand Down
14 changes: 14 additions & 0 deletions gym/lib/gym/runner.rb
Expand Up @@ -39,6 +39,7 @@ def run
move_app_thinning
move_app_thinning_size_report
move_apps_folder
move_asset_packs
elsif is_mac
path = File.expand_path(Gym.config[:output_directory])
compress_and_move_dsym
Expand Down Expand Up @@ -325,6 +326,19 @@ def move_apps_folder
end
end

# Move Asset Packs folder to the output directory
# @return (String) The path to the resulting Asset Packs (aka OnDemandResources) folder
def move_asset_packs
if Dir.exist?(PackageCommandGenerator.asset_packs_path)
FileUtils.mv(PackageCommandGenerator.asset_packs_path, File.expand_path(Gym.config[:output_directory]), force: true)
asset_packs_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.asset_packs_path))

UI.success("Successfully exported Asset Pack folder:")
UI.message(asset_packs_path)
asset_packs_path
end
end

def find_archive_path
Dir.glob(File.join(BuildCommandGenerator.build_path, "*.ipa")).last
end
Expand Down