Sha256: 025371bb8f5961312ebaff34a8a687d35c92178616204db9f046d9b07de5c549

Contents?: true

Size: 1.76 KB

Versions: 13

Compression:

Stored size: 1.76 KB

Contents

# encoding: utf-8
# from http://stackoverflow.com/a/9857493/445598
# because of
# `incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError)`

module Gym
  # 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 PackageCommandGeneratorLegacy
    class << self
      def generate
        parts = ["/usr/bin/xcrun #{XcodebuildFixes.patch_package_application} -v"]
        parts += options
        parts += pipe

        parts
      end

      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

      def pipe
        [""]
      end

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

        return path
      end

      # We export it to the temporary folder and move it over to the actual output once it's finished and valid
      def ipa_path
        File.join(BuildCommandGenerator.build_path, "#{Gym.config[:output_name]}.ipa")
      end

      # The path the the dsym file for this app. Might be nil
      def dsym_path
        Dir[BuildCommandGenerator.archive_path + "/**/*.app.dSYM"].last
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gym-1.5.0 lib/gym/generators/package_command_generator_legacy.rb
gym-1.4.0 lib/gym/generators/package_command_generator_legacy.rb
gym-1.3.0 lib/gym/generators/package_command_generator_legacy.rb
gym-1.2.0 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.6 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.5 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.4 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.3 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.2 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.1 lib/gym/generators/package_command_generator_legacy.rb
gym-1.1.0 lib/gym/generators/package_command_generator_legacy.rb
gym-1.0.0 lib/gym/generators/package_command_generator_legacy.rb
gym-0.9.1 lib/gym/generators/package_command_generator_legacy.rb