Skip to content
Browse files

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

…son workspace schemes don’t seem to survive a SCM roundtrip.
  • Loading branch information...
1 parent bb3535a commit aba658e64dea7a85966ca84a33088a4ecc7b5fef @alloy alloy committed Nov 14, 2011
Showing with 46 additions and 21 deletions.
  1. +44 −19 Rakefile
  2. +2 −2 examples/SSCatalog/SSCatalog.xcodeproj/project.pbxproj
View
63 Rakefile
@@ -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'
View
4 examples/SSCatalog/SSCatalog.xcodeproj/project.pbxproj
@@ -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";

0 comments on commit aba658e

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