Skip to content
Browse files

Support adding custom build settings.

  • Loading branch information...
1 parent ebb874e commit eadcfbb4924b99f9f65775368e2ba5fc43a499fa @lukeredpath committed Jul 12, 2012
Showing with 15 additions and 0 deletions.
  1. +9 −0 lib/xcode_build/tasks/build_task.rb
  2. +6 −0 spec/build_task_spec.rb
View
9 lib/xcode_build/tasks/build_task.rb
@@ -25,6 +25,7 @@ def initialize(namespace = :xcode, &block)
@invoke_from_within = "."
@reporter_klass = XcodeBuild::Reporter
@hooks = {}
+ @build_settings = {}
yield self if block_given?
define
@@ -62,9 +63,17 @@ def build_opts
opts << "-arch #{arch}" if arch
opts << "-sdk #{sdk}" if sdk
opts << "-xcconfig #{xcconfig}" if xcconfig
+
+ @build_settings.each do |setting, value|
+ opts << "#{setting}=#{value}"
+ end
end
end
+ def add_build_setting(setting, value)
+ @build_settings[setting] = value
+ end
+
def reporter
@reporter ||= @reporter_klass.new(formatter)
end
View
6 spec/build_task_spec.rb
@@ -71,6 +71,12 @@
task.xcconfig = "path/to/config.xcconfig"
task.build_opts.should include("-xcconfig path/to/config.xcconfig")
end
+
+ it 'includes custom build settings' do
+ task.add_build_setting("DSTROOT", "/tmp/dstroot")
+ task.add_build_setting("SRCROOT", "/tmp/srcroot")
+ task.build_opts.should include("DSTROOT=/tmp/dstroot", "SRCROOT=/tmp/srcroot")
+ end
end
shared_examples_for "any task" do

0 comments on commit eadcfbb

Please sign in to comment.
Something went wrong with that request. Please try again.