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

.appfile_pathObject



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

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

  return path
end

.dsym_pathObject

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



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

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

.generateObject



8
9
10
11
12
13
14
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 8

def generate
  parts = ["/usr/bin/xcrun #{XcodebuildFixes.patch_package_application} -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



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

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

.optionsObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 16

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]}'"
  end

  options
end

.pipeObject



34
35
36
# File 'lib/gym/generators/package_command_generator_legacy.rb', line 34

def pipe
  [""]
end