class RXCode::XCode::CommandLine

Attributes

action[RW]
ACTION =================================================================================================
sdk[RW]
SDK ====================================================================================================
target[W]

Public Class Methods

new(options = nil) { |self| ... } click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 8
def initialize(options = nil)
  if options
    options.each { |attr_name, attr_value| self.send("#{attr_name}=", attr_value) }
  end
  
  yield self if block_given?
end

Public Instance Methods

action_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 20
def action_arguments
  if action
    [ action ]
  else
    []
  end
end
command() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 119
def command
  command_args = command_line_arguments.join(' ')
  command_variables = command_environment.collect { |var_name, value| "#{var_name}='#{value}'" }.join(' ')
  
  "#{xcodebuild_binary} #{command_args} #{command_variables}"
end
command_environment() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 101
def command_environment
  default_environment.merge(environment)
end
command_line_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 115
def command_line_arguments
  project_arguments + target_arguments + configuration_arguments + sdk_arguments + action_arguments
end
command_variables() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 105
def command_variables
  environment.collect { |var_name, value| "#{var_name}='#{value}'" }.join(' ')
end
configuration() click to toggle source
CONFIGURATION ==========================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 63
def configuration
  ENV['CONFIGURATION']
end
configuration_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 67
def configuration_arguments
  [ '-configuration', configuration]
end
default_environment() click to toggle source
ENVIRONMENT VARIABLES ==================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 91
def default_environment
  default_env = {}
  default_env['SYMROOT'] = symroot if symroot
  default_env
end
dry_run?() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 126
def dry_run?
  ENV['DRY_RUN'] =~ /^(1|yes|true)$/i
end
environment() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 97
def environment
  @environment ||= {}
end
project_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 38
def project_arguments
  [ '-project', project_file_path ]
end
project_file_path() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 34
def project_file_path
  ENV['PROJECT_FILE_PATH'] || "#{project_name}.xcodeproj"
end
project_name() click to toggle source
PROJECT ================================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 30
def project_name
  ENV['PROJECT_NAME']
end
run(print_command = false) click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 130
def run(print_command = false)
  puts(command) if print_command
  system(command) unless dry_run?
end
sdk_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 75
def sdk_arguments
  if sdk.nil?
    []
  else
    [ '-sdk', sdk ]
  end
end
symroot() click to toggle source
BUILD LOCATION =========================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 85
def symroot
  ENV['SYMROOT']
end
target() click to toggle source
TARGET =================================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 44
def target
  @target || target_name
end
target_arguments() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 53
def target_arguments
  if target
    [ "-target", "'#{target}'" ]
  else
    []
  end
end
target_name() click to toggle source
# File lib/rxcode/tasks/ios_framework.rb, line 49
def target_name
  ENV['TARGET_NAME']
end
xcodebuild_binary() click to toggle source
COMMAND ================================================================================================
# File lib/rxcode/tasks/ios_framework.rb, line 111
def xcodebuild_binary
  "xcodebuild"
end