class XCJobs::Archive

Attributes

archive_path[RW]

Public Class Methods

new(name = :archive) { |self| ... } click to toggle source
Calls superclass method XCJobs::Xcodebuild::new
# File lib/xcjobs/xcodebuild.rb, line 277
def initialize(name = :archive)
  super
  @description ||= 'make xcarchive'
  yield self if block_given?
  define
end

Private Instance Methods

define() click to toggle source
# File lib/xcjobs/xcodebuild.rb, line 286
def define
  raise 'archive action requires specifying a scheme' unless scheme
  raise 'cannot specify both a scheme and targets' if scheme && target

  if build_dir
    CLEAN.include(build_dir)
    CLOBBER.include(build_dir)
  end

  desc @description
  namespace :build do
    task @name do
      add_build_setting('CONFIGURATION_TEMP_DIR', File.join(build_dir, 'temp')) if build_dir
      add_build_setting('CODE_SIGN_IDENTITY', signing_identity) if signing_identity
      add_build_setting('PROVISIONING_PROFILE', provisioning_profile_uuid) if provisioning_profile_uuid

      run(['xcodebuild', 'archive'] + options)

      if build_dir && scheme
        bd = build_dir.shellescape
        s = scheme.shellescape
        sh %[(cd #{bd}; zip -ryq dSYMs.zip #{File.join("#{s}.xcarchive", "dSYMs")})]
        sh %[(cd #{bd}; zip -ryq #{s}.xcarchive.zip #{s}.xcarchive)]
      end
    end
  end
end
options() click to toggle source
Calls superclass method XCJobs::Xcodebuild#options
# File lib/xcjobs/xcodebuild.rb, line 318
def options
  super.tap do |opts|
    opts.concat(['-archivePath', archive_path]) if archive_path
  end
end