Class: Gym::PackageCommandGeneratorLegacy

Inherits:
Object
  • Object
show all
Defined in:
lib/gym/generators/package_command_generator_legacy.rb

Overview

Responsible for building the fully working xcodebuild command on Xcode < 7

Because of a known bug in PackageApplication Perl script used by Xcode the packaging process is performed with a patched version of the script.

Class Method Summary collapse

Class Method Details

.app_thinning_pathObject



71
72
73
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 71

def app_thinning_path
  ""
end

.app_thinning_size_report_pathObject



75
76
77
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 75

def app_thinning_size_report_path
  ""
end

.appfile_pathObject



50
51
52
53
54
55
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 50

def appfile_path
  path = Dir.glob("#{BuildCommandGenerator.archive_path}/Products/Applications/*.app").first
  path ||= Dir[BuildCommandGenerator.archive_path + "/**/*.app"].first

  return path
end

.apps_pathObject



79
80
81
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 79

def apps_path
  ""
end

.dsym_pathObject

The path the the dsym file for this app. Might be nil



63
64
65
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 63

def dsym_path
  Dir[BuildCommandGenerator.archive_path + "/**/*.app.dSYM"].last
end

.generateObject



13
14
15
16
17
18
19
20
21
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 13

def generate
  print_legacy_information

  parts = ["/usr/bin/xcrun #{XcodebuildFixes.patch_package_application.shellescape} -v"]
  parts += options
  parts += pipe

  parts
end

.ipa_pathObject

We export it to the temporary folder and move it over to the actual output once it’s finished and valid



58
59
60
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 58

def ipa_path
  File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
end

.manifest_pathObject



67
68
69
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 67

def manifest_path
  ""
end

.optionsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 23

def options
  options = []

  options << Shellwords.escape(appfile_path)
  options << "-o '#{ipa_path}'"
  options << "exportFormat ipa"

  if Gym.config[:provisioning_profile_path]
    options << "--embed '#{Gym.config[:provisioning_profile_path]}'"
  end

  if Gym.config[:codesigning_identity]
    options << "--sign #{Gym.config[:codesigning_identity].shellescape}"
  end

  options
end

.pipeObject



41
42
43
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 41

def pipe
  [""]
end


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 83

def print_legacy_information
  if Gym.config[:include_bitcode]
    UI.important "Legacy build api is enabled, the `include_bitcode` value will be ignored"
  end

  if Gym.config[:include_symbols]
    UI.important "Legacy build api is enabled, the `include_symbols` value will be ignored"
  end

  if Gym.config[:export_team_id].to_s.length > 0
    UI.important "Legacy build api is enabled, the `export_team_id` value will be ignored"
  end

  if Gym.config[:export_method].to_s.length > 0
    UI.important "Legacy build api is enabled, the `export_method` value will be ignored"
  end
end

.temporary_output_pathObject

Place where the IPA file will be created, so it can be safely moved to the destination folder



46
47
48
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 46

def temporary_output_path
  Gym.cache[:temporary_output_path] ||= Dir.mktmpdir('gym_output')
end