Class: Gym::PackageCommandGeneratorXcode7
- Inherits:
-
Object
- Object
- Gym::PackageCommandGeneratorXcode7
- Defined in:
- lib/gym/generators/package_command_generator_xcode7.rb
Overview
Responsible for building the fully working xcodebuild command
Class Method Summary collapse
-
.app_thinning_path ⇒ Object
The path to the app-thinning plist file.
-
.app_thinning_size_report_path ⇒ Object
The path to the App Thinning Size Report file.
-
.apps_path ⇒ Object
The path to the Apps folder.
-
.config_path ⇒ Object
The path the config file we use to sign our app.
-
.dsym_path ⇒ Object
The path the the dsym file for this app.
- .generate ⇒ Object
- .ipa_path ⇒ Object
-
.manifest_path ⇒ Object
The path to the manifest plist file.
- .options ⇒ Object
- .pipe ⇒ Object
-
.temporary_output_path ⇒ Object
We export the ipa into this directory, as we can’t specify the ipa file directly.
Class Method Details
.app_thinning_path ⇒ Object
The path to the app-thinning plist file
86 87 88 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 86 def app_thinning_path Gym.cache[:app_thinning] ||= File.join(temporary_output_path, "app-thinning.plist") end |
.app_thinning_size_report_path ⇒ Object
The path to the App Thinning Size Report file
91 92 93 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 91 def app_thinning_size_report_path Gym.cache[:app_thinning_size_report] ||= File.join(temporary_output_path, "App Thinning Size Report.txt") end |
.apps_path ⇒ Object
The path to the Apps folder
96 97 98 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 96 def apps_path Gym.cache[:apps_path] ||= File.join(temporary_output_path, "Apps") end |
.config_path ⇒ Object
The path the config file we use to sign our app
75 76 77 78 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 75 def config_path Gym.cache[:config_path] ||= "#{Tempfile.new('gym_config').path}.plist" return Gym.cache[:config_path] end |
.dsym_path ⇒ Object
The path the the dsym file for this app. Might be nil
70 71 72 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 70 def dsym_path Dir[BuildCommandGenerator.archive_path + "/**/*.app.dSYM"].last end |
.generate ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 12 def generate print_legacy_information parts = ["/usr/bin/xcrun #{XcodebuildFixes.wrap_xcodebuild.shellescape} -exportArchive"] parts += parts += pipe File.write(config_path, config_content) # overwrite everytime. Could be optimized parts end |
.ipa_path ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 47 def ipa_path unless Gym.cache[:ipa_path] path = Dir[File.join(temporary_output_path, "*.ipa")].last # We need to process generic IPA if path # Try to find IPA file in the output directory, used when app thinning was not set Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa") FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.(path).casecmp(File.(Gym.cache[:ipa_path]).downcase).zero? elsif Dir.exist?(apps_path) # Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set files = Dir[File.join(apps_path, "*.ipa")] # Generic IPA file doesn't have suffix so its name is the shortest path = files.min_by(&:length) Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa") FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.(path).casecmp(File.(Gym.cache[:ipa_path]).downcase).zero? else ErrorHandler.handle_empty_archive unless path end end Gym.cache[:ipa_path] end |
.manifest_path ⇒ Object
The path to the manifest plist file
81 82 83 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 81 def manifest_path Gym.cache[:manifest_path] ||= File.join(temporary_output_path, "manifest.plist") end |
.options ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 24 def = [] << "-exportOptionsPlist '#{config_path}'" << "-archivePath #{BuildCommandGenerator.archive_path.shellescape}" << "-exportPath '#{temporary_output_path}'" if Gym.config[:toolchain] << "-toolchain '#{Gym.config[:toolchain]}'" end end |
.pipe ⇒ Object
38 39 40 |
# File 'lib/gym/generators/package_command_generator_xcode7.rb', line 38 def pipe [""] end |