Class: XcodeBuild::Tasks::BuildTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/xcode_build/tasks/build_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace = :xcode) {|_self| ... } ⇒ BuildTask

Returns a new instance of BuildTask.

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
24
25
26
# File 'lib/xcode_build/tasks/build_task.rb', line 19

def initialize(namespace = :xcode, &block)
  @namespace = namespace
  @output_to = STDOUT
  @invoke_from_within = "."
  
  yield self if block_given?
  define
end

Instance Attribute Details

#archObject

Returns the value of attribute arch.



11
12
13
# File 'lib/xcode_build/tasks/build_task.rb', line 11

def arch
  @arch
end

#configurationObject

Returns the value of attribute configuration.



10
11
12
# File 'lib/xcode_build/tasks/build_task.rb', line 10

def configuration
  @configuration
end

#formatterObject

Returns the value of attribute formatter.



15
16
17
# File 'lib/xcode_build/tasks/build_task.rb', line 15

def formatter
  @formatter
end

#invoke_from_withinObject

Returns the value of attribute invoke_from_within.



16
17
18
# File 'lib/xcode_build/tasks/build_task.rb', line 16

def invoke_from_within
  @invoke_from_within
end

#output_toObject

Returns the value of attribute output_to.



14
15
16
# File 'lib/xcode_build/tasks/build_task.rb', line 14

def output_to
  @output_to
end

#project_nameObject

Returns the value of attribute project_name.



6
7
8
# File 'lib/xcode_build/tasks/build_task.rb', line 6

def project_name
  @project_name
end

#reporterObject

Returns the value of attribute reporter.



17
18
19
# File 'lib/xcode_build/tasks/build_task.rb', line 17

def reporter
  @reporter
end

#schemeObject

Returns the value of attribute scheme.



9
10
11
# File 'lib/xcode_build/tasks/build_task.rb', line 9

def scheme
  @scheme
end

#sdkObject

Returns the value of attribute sdk.



12
13
14
# File 'lib/xcode_build/tasks/build_task.rb', line 12

def sdk
  @sdk
end

#targetObject

Returns the value of attribute target.



7
8
9
# File 'lib/xcode_build/tasks/build_task.rb', line 7

def target
  @target
end

#workspaceObject

Returns the value of attribute workspace.



8
9
10
# File 'lib/xcode_build/tasks/build_task.rb', line 8

def workspace
  @workspace
end

#xcconfigObject

Returns the value of attribute xcconfig.



13
14
15
# File 'lib/xcode_build/tasks/build_task.rb', line 13

def xcconfig
  @xcconfig
end

Instance Method Details

#build_optsObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/xcode_build/tasks/build_task.rb', line 32

def build_opts
  [].tap do |opts|
    opts << "-project #{project_name}" if project_name
    opts << "-target #{target}" if target
    opts << "-workspace #{workspace}" if workspace
    opts << "-scheme #{scheme}" if scheme
    opts << "-configuration #{configuration}" if configuration
    opts << "-arch #{arch}" if arch
    opts << "-sdk #{sdk}" if sdk
    opts << "-xcconfig #{xcconfig}" if xcconfig
  end
end

#run(task) ⇒ Object



28
29
30
# File 'lib/xcode_build/tasks/build_task.rb', line 28

def run(task)
  Rake::Task["#{@namespace}:#{task}"].invoke
end