Sha256: e4b5c9242f7f7df0c1b343497b428a6baf6a3f0b3f8d70473e49c454db067804

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

# coding: utf-8

module Cuesmash

  #
  # iOS Specific compiler
  # 
  class IosCompiler < Compiler

    attr_accessor :scheme
    attr_accessor :tmp_dir
    attr_accessor :build_configuration

    def initialize(scheme:, tmp_dir:, build_configuration:)
      @scheme = scheme
      @tmp_dir = tmp_dir
      @build_configuration = build_configuration
    end

    #
    # Generate the string to be used as the xcode build command
    # using the scheme ivar
    #
    # @return [String] The full xcode build command with args
    def command
      xcode_command = "set -o pipefail && xcodebuild #{workspace} -scheme #{@scheme} -derivedDataPath #{@tmp_dir} -configuration #{@build_configuration} OBJROOT=#{@tmp_dir} SYMROOT=#{@tmp_dir} -sdk iphonesimulator build | bundle exec xcpretty -c"

      Logger.info "xcode_command == #{xcode_command}"
      xcode_command
    end # command

    #
    # Looks in the current directory for the workspace file and
    # gets it's name if there is one
    #
    # @return [String] The name of the workspace file that was found along with the -workspace flag
    def workspace
      wp = Dir["*.xcworkspace"].first
      if wp
        flag = "-workspace #{wp}"
        Logger.debug "workspace == #{wp}"
        return flag
      else
        Logger.debug "no workspace found"
        return wp
      end
    end # workspace
  end # class IosCompiler
end # module Cuesmash

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cuesmash-0.1.9.3 lib/cuesmash/ios_compiler.rb
cuesmash-0.1.9.2 lib/cuesmash/ios_compiler.rb