Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Monkeypatching in the cedar build command

  • Loading branch information...
commit 1a2e4d11acbf62a93571404258bd75c30f9ab9f5 1 parent 19e38ba
@burtlo authored
Showing with 41 additions and 1 deletion.
  1. +41 −1 lib/xcoder_cedar.rb
View
42 lib/xcoder_cedar.rb
@@ -1 +1,41 @@
-puts "Xcode_Cedar library file"
+require 'xcoder'
+
+module Xcode
+
+ class Builder
+
+ def cedar
+ require 'tmpdir'
+
+ cmd = BuildCommand.new
+
+ # Similar to the xcoder gem these platform values and paths are hard-coded.
+ # This is likely a poor choice and one that will get this little plugin
+ # into some trouble when the iOS library upgrades.
+
+ cmd << "DYLD_ROOT_PATH=\"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk\""
+ cmd << "IPHONE_SIMULATOR_ROOT=\"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk\""
+
+ tempHome = Dir.mktmpdir("Cedar")
+ Dir.mkdir File.join(tempHome, "Documents")
+ Dir.mkdir File.join(tempHome, "Library")
+ Dir.mkdir File.join(tempHome, "Library/Preferences")
+ Dir.mkdir File.join(tempHome, "Library/Caches")
+ Dir.mkdir File.join(tempHome, "tmp")
+
+ cmd << "CFFIXED_USER_HOME=#{tempHome}"
+ cmd << "CEDAR_HEADLESS_SPECS=1"
+ cmd << "CEDAR_REPORTER_CLASS=CDRColorizedReporter"
+ cmd << "CEDAR_REPORTER_OPTS=nested"
+
+ cmd << "\"#{@build_path}#{@config.name}-iphonesimulator/#{@target.name}.app/#{@target.name}\""
+ cmd << "-RegisterForSystemEvents"
+
+ yield cmd if block_given?
+
+ Xcode::Shell.execute(cmd.to_a)
+
+ end
+
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.