Class: XcodeBuild::Tasks::BuildTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- XcodeBuild::Tasks::BuildTask
- Includes:
- Rake::DSL
- Defined in:
- lib/xcode_build/tasks/build_task.rb
Instance Attribute Summary collapse
-
#arch ⇒ Object
Returns the value of attribute arch.
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#invoke_from_within ⇒ Object
Returns the value of attribute invoke_from_within.
-
#output_to ⇒ Object
Returns the value of attribute output_to.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#reporter_klass ⇒ Object
Returns the value of attribute reporter_klass.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#sdk ⇒ Object
Returns the value of attribute sdk.
-
#target ⇒ Object
Returns the value of attribute target.
-
#workspace ⇒ Object
Returns the value of attribute workspace.
-
#xcconfig ⇒ Object
Returns the value of attribute xcconfig.
-
#xcodebuild_log_path ⇒ Object
Returns the value of attribute xcodebuild_log_path.
Instance Method Summary collapse
- #after_archive(&block) ⇒ Object
- #after_build(&block) ⇒ Object
- #after_clean(&block) ⇒ Object
- #build_opts ⇒ Object
- #execute_hook(name, *args) ⇒ Object
-
#initialize(namespace = :xcode) {|_self| ... } ⇒ BuildTask
constructor
A new instance of BuildTask.
- #reporter ⇒ Object
- #run(task) ⇒ Object
Constructor Details
#initialize(namespace = :xcode) {|_self| ... } ⇒ BuildTask
Returns a new instance of BuildTask.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/xcode_build/tasks/build_task.rb', line 22 def initialize(namespace = :xcode, &block) @namespace = namespace @output_to = STDOUT @invoke_from_within = "." @reporter_klass = XcodeBuild::Reporter @hooks = {} yield self if block_given? define end |
Instance Attribute Details
#arch ⇒ Object
Returns the value of attribute arch.
13 14 15 |
# File 'lib/xcode_build/tasks/build_task.rb', line 13 def arch @arch end |
#configuration ⇒ Object
Returns the value of attribute configuration.
12 13 14 |
# File 'lib/xcode_build/tasks/build_task.rb', line 12 def configuration @configuration end |
#formatter ⇒ Object
Returns the value of attribute formatter.
17 18 19 |
# File 'lib/xcode_build/tasks/build_task.rb', line 17 def formatter @formatter end |
#invoke_from_within ⇒ Object
Returns the value of attribute invoke_from_within.
18 19 20 |
# File 'lib/xcode_build/tasks/build_task.rb', line 18 def invoke_from_within @invoke_from_within end |
#output_to ⇒ Object
Returns the value of attribute output_to.
16 17 18 |
# File 'lib/xcode_build/tasks/build_task.rb', line 16 def output_to @output_to end |
#project_name ⇒ Object
Returns the value of attribute project_name.
8 9 10 |
# File 'lib/xcode_build/tasks/build_task.rb', line 8 def project_name @project_name end |
#reporter_klass ⇒ Object
Returns the value of attribute reporter_klass.
19 20 21 |
# File 'lib/xcode_build/tasks/build_task.rb', line 19 def reporter_klass @reporter_klass end |
#scheme ⇒ Object
Returns the value of attribute scheme.
11 12 13 |
# File 'lib/xcode_build/tasks/build_task.rb', line 11 def scheme @scheme end |
#sdk ⇒ Object
Returns the value of attribute sdk.
14 15 16 |
# File 'lib/xcode_build/tasks/build_task.rb', line 14 def sdk @sdk end |
#target ⇒ Object
Returns the value of attribute target.
9 10 11 |
# File 'lib/xcode_build/tasks/build_task.rb', line 9 def target @target end |
#workspace ⇒ Object
Returns the value of attribute workspace.
10 11 12 |
# File 'lib/xcode_build/tasks/build_task.rb', line 10 def workspace @workspace end |
#xcconfig ⇒ Object
Returns the value of attribute xcconfig.
15 16 17 |
# File 'lib/xcode_build/tasks/build_task.rb', line 15 def xcconfig @xcconfig end |
#xcodebuild_log_path ⇒ Object
Returns the value of attribute xcodebuild_log_path.
20 21 22 |
# File 'lib/xcode_build/tasks/build_task.rb', line 20 def xcodebuild_log_path @xcodebuild_log_path end |
Instance Method Details
#after_archive(&block) ⇒ Object
41 42 43 |
# File 'lib/xcode_build/tasks/build_task.rb', line 41 def after_archive(&block) @hooks[:after_archive] = block end |
#after_build(&block) ⇒ Object
33 34 35 |
# File 'lib/xcode_build/tasks/build_task.rb', line 33 def after_build(&block) @hooks[:after_build] = block end |
#after_clean(&block) ⇒ Object
37 38 39 |
# File 'lib/xcode_build/tasks/build_task.rb', line 37 def after_clean(&block) @hooks[:after_clean] = block end |
#build_opts ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/xcode_build/tasks/build_task.rb', line 55 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 |
#execute_hook(name, *args) ⇒ Object
45 46 47 48 49 |
# File 'lib/xcode_build/tasks/build_task.rb', line 45 def execute_hook(name, *args) if hook = @hooks[name.to_sym] hook.call(*args) end end |
#reporter ⇒ Object
68 69 70 |
# File 'lib/xcode_build/tasks/build_task.rb', line 68 def reporter @reporter ||= @reporter_klass.new(formatter) end |
#run(task) ⇒ Object
51 52 53 |
# File 'lib/xcode_build/tasks/build_task.rb', line 51 def run(task) Rake::Task["#{@namespace}:#{task}"].invoke end |