Commit aba658e6 authored by Eloy Duran's avatar Eloy Duran

Add a rake task to open all example workspaces in Xcode. For some reason…

Add a rake task to open all example workspaces in Xcode. For some reason workspace schemes don’t seem to survive a SCM roundtrip.
parent bb3535af
......@@ -76,30 +76,55 @@ namespace :spec do
end
end
desc "Build all examples"
task :build_examples do
require 'pathname'
examples = Pathname.new(File.expand_path('../examples', __FILE__))
examples.entries.each do |example|
next if %w{ . .. }.include?(example.basename.to_s)
example = examples + example
next unless example.directory?
puts "Building example: #{example}"
puts
Dir.chdir(example.to_s) do
sh "rm -rf Pods DerivedData"
sh "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose"
command = "xcodebuild -workspace '#{example.basename}.xcworkspace' -scheme '#{example.basename}'"
if (example + 'Podfile').read.include?('platform :ios')
# Specifically build against the simulator SDK so we don't have to deal with code signing.
command << " -sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk"
namespace :examples do
def examples
require 'pathname'
result = []
examples = Pathname.new(File.expand_path('../examples', __FILE__))
examples.entries.each do |example|
next if %w{ . .. }.include?(example.basename.to_s)
example = examples + example
next unless example.directory?
result << example
end
result
end
desc "Open all example workspaced in Xcode, which recreates the schemes."
task :recreate_workspace_schemes do
examples.each do |example|
Dir.chdir(example.to_s) do
# TODO we need to open the workspace in Xcode at least once, otherwise it might not contain schemes.
# The schemes do not seem to survive a SCM round-trip.
sh "open '#{example.basename}.xcworkspace'"
sleep 5
end
end
end
desc "Build all examples"
task :build do
examples.entries.each do |example|
puts "Building example: #{example}"
puts
Dir.chdir(example.to_s) do
sh "rm -rf Pods DerivedData"
sh "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose"
command = "xcodebuild -workspace '#{example.basename}.xcworkspace' -scheme '#{example.basename}'"
if (example + 'Podfile').read.include?('platform :ios')
# Specifically build against the simulator SDK so we don't have to deal with code signing.
command << " -sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk"
end
sh command
end
sh command
puts
end
puts
end
end
desc "Build all examples"
task :build_examples => 'examples:build'
desc "Dumps a Xcode project as YAML, meant for diffing"
task :dump_xcodeproj do
require 'yaml'
......
......@@ -373,7 +373,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch";
INFOPLIST_FILE = "Resources/SSCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = SSCatalog;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
......@@ -388,7 +388,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch";
INFOPLIST_FILE = "Resources/SSCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = SSCatalog;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment