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,14 +76,35 @@ namespace :spec do ...@@ -76,14 +76,35 @@ namespace :spec do
end end
end end
desc "Build all examples" namespace :examples do
task :build_examples do def examples
require 'pathname' require 'pathname'
result = []
examples = Pathname.new(File.expand_path('../examples', __FILE__)) examples = Pathname.new(File.expand_path('../examples', __FILE__))
examples.entries.each do |example| examples.entries.each do |example|
next if %w{ . .. }.include?(example.basename.to_s) next if %w{ . .. }.include?(example.basename.to_s)
example = examples + example example = examples + example
next unless example.directory? 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 "Building example: #{example}"
puts puts
Dir.chdir(example.to_s) do Dir.chdir(example.to_s) do
...@@ -98,8 +119,12 @@ task :build_examples do ...@@ -98,8 +119,12 @@ task :build_examples do
end end
puts puts
end end
end
end end
desc "Build all examples"
task :build_examples => 'examples:build'
desc "Dumps a Xcode project as YAML, meant for diffing" desc "Dumps a Xcode project as YAML, meant for diffing"
task :dump_xcodeproj do task :dump_xcodeproj do
require 'yaml' require 'yaml'
......
...@@ -373,7 +373,7 @@ ...@@ -373,7 +373,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch"; GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch";
INFOPLIST_FILE = "Resources/SSCatalog-Info.plist"; INFOPLIST_FILE = "Resources/SSCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = SSCatalog; PRODUCT_NAME = SSCatalog;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch"; GCC_PREFIX_HEADER = "Other Sources/SSCatalog_Prefix.pch";
INFOPLIST_FILE = "Resources/SSCatalog-Info.plist"; INFOPLIST_FILE = "Resources/SSCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = SSCatalog; PRODUCT_NAME = SSCatalog;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; 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