mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-29 05:05:37 +08:00
build vendored xcode projects into a .build directory (to not conflict with projects who have a 'build' directory already)
This commit is contained in:
@@ -127,6 +127,7 @@ EOS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
XcodeBuildDir = '.build'
|
||||||
def build_xcode(platform, opts)
|
def build_xcode(platform, opts)
|
||||||
Dir.chdir(@path) do
|
Dir.chdir(@path) do
|
||||||
build_dir = "build-#{platform}"
|
build_dir = "build-#{platform}"
|
||||||
@@ -152,14 +153,14 @@ EOS
|
|||||||
# to fail.
|
# to fail.
|
||||||
%w{CC CXX CFLAGS CXXFLAGS LDFLAGS}.each { |f| ENV[f] &&= nil }
|
%w{CC CXX CFLAGS CXXFLAGS LDFLAGS}.each { |f| ENV[f] &&= nil }
|
||||||
|
|
||||||
# Build project into `build' directory. We delete the build directory
|
# Build project into a build directory. We delete the build directory
|
||||||
# each time because Xcode is too stupid to be trusted to use the
|
# each time because Xcode is too stupid to be trusted to use the
|
||||||
# same build directory for different platform builds.
|
# same build directory for different platform builds.
|
||||||
rm_rf 'build'
|
rm_rf XcodeBuildDir
|
||||||
xcopts = ''
|
xcopts = ''
|
||||||
xcopts << "-target \"#{target}\" " if target
|
xcopts << "-target \"#{target}\" " if target
|
||||||
xcopts << "-scheme \"#{scheme}\" " if scheme
|
xcopts << "-scheme \"#{scheme}\" " if scheme
|
||||||
sh "/usr/bin/xcodebuild -project \"#{xcodeproj}\" #{xcopts} -configuration \"#{configuration}\" -sdk #{platform.downcase}#{@config.sdk_version} #{@config.arch_flags(platform)} CONFIGURATION_BUILD_DIR=build IPHONEOS_DEPLOYMENT_TARGET=#{@config.deployment_target} build"
|
sh "/usr/bin/xcodebuild -project \"#{xcodeproj}\" #{xcopts} -configuration \"#{configuration}\" -sdk #{platform.downcase}#{@config.sdk_version} #{@config.arch_flags(platform)} CONFIGURATION_BUILD_DIR=#{XcodeBuildDir} IPHONEOS_DEPLOYMENT_TARGET=#{@config.deployment_target} build"
|
||||||
|
|
||||||
# Copy .a files into the platform build directory.
|
# Copy .a files into the platform build directory.
|
||||||
prods = opts.delete(:products)
|
prods = opts.delete(:products)
|
||||||
@@ -186,7 +187,7 @@ EOS
|
|||||||
|
|
||||||
def clean_xcode
|
def clean_xcode
|
||||||
Dir.chdir(@path) do
|
Dir.chdir(@path) do
|
||||||
['build', 'build-iPhoneOS', 'build-iPhoneSimulator'].each { |x| rm_rf x }
|
[XcodeBuildDir, 'build-iPhoneOS', 'build-iPhoneSimulator'].each { |x| rm_rf x }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user