Module: Pod::XBuilder::XcodeXBuilder

Included in:
Pod::XBuilder
Defined in:
lib/cocoapods-framework/xbuilder/xcode_xbuild.rb

Instance Method Summary collapse

Instance Method Details

#xcode_xbuild(defines, configuration, work_dir, build_dir = 'export') ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cocoapods-framework/xbuilder/xcode_xbuild.rb', line 4

def xcode_xbuild(defines, configuration, work_dir, build_dir = 'export')
  if defined?(Pod::DONT_CODESIGN)
    defines = "#{defines} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO"
  end
  pwd = Pathname.pwd
  Dir.chdir work_dir
  command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets 2>&1"
  output = `#{command}`.lines.to_a
  Dir.chdir pwd
  if $?.exitstatus != 0
    Pod::ErrorUtil.error_report command,output
    Process.exit -1
  end
end