Permalink
Browse files

Quieter rakefile.

  • Loading branch information...
1 parent c7f6126 commit 0cfc9d4a68a9d12c22b165bedde87057f8c2189a Adam Milligan committed Nov 28, 2010
Showing with 12 additions and 8 deletions.
  1. +12 −8 Rakefile
View
@@ -14,6 +14,13 @@ def system_or_exit(cmd, stdout = nil)
system(cmd) or raise "******** Build failed ********"
end
+def output_file(target)
+ output_dir = ENV['IS_CI_BOX'] ? ENV['CC_BUILD_ARTIFACTS'] : File.join(File.dirname(__FILE__), "build")
+ output_file = File.join(output_dir, "#{target}.output")
+ puts "Output: #{output_file}"
+ output_file
+end
+
task :default => [:specs, :uispecs]
task :cruise do
Rake::Task[:clean].invoke
@@ -23,23 +30,20 @@ task :cruise do
end
task :clean do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "clean.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} clean], stdout)
+ system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} clean], output_file("clean"))
end
task :build_specs do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_specs.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -target #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], stdout)
+ system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -target #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], output_file("specs"))
end
task :build_uispecs do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_uispecs.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -target #{UI_SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], stdout)
+ `osascript -e 'tell application "iPhone Simulator" to quit'`
+ system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -target #{UI_SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], output_file("uispecs"))
end
task :build_all do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_all.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} build], stdout)
+ system_or_exit(%Q[xcodebuild -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} build], output_file("build_all"))
end
task :specs => :build_specs do

0 comments on commit 0cfc9d4

Please sign in to comment.