Rakefile in testautoi-0.9.135 vs Rakefile in testautoi-0.9.142

- old
+ new

@@ -1,2 +1,62 @@ require 'bundler' +require 'fileutils' + Bundler::GemHelper.install_tasks + + +task :build_server do + + FRAMEWORK='calabash.framework' + ZIP_FILE="#{FRAMEWORK}.zip" + + def build_server + return if ENV['SKIP_SERVER'] + framework_zip = nil + dir = ENV['CALABASH_SERVER_PATH'] || File.join('..', '..', 'calabash-ios-server') + unless File.exist?(dir) + raise <<EOF + Unable to find calabash server checked out at #{dir}. + Please checkout as #{dir} or set CALABASH_SERVER_PATH to point + to Calabash server (branch 0.9.x). +EOF + end + + FileUtils.cd(dir) do + puts 'Building Server' + cmd = 'xcodebuild build -project calabash.xcodeproj -target Framework -configuration Debug -sdk iphonesimulator6.1' + puts cmd + puts `#{cmd}` + + unless File.exist?(FRAMEWORK) + raise 'Unable to build framework' + end + + puts "Zipping down framework" + + + zip_cmd = "zip -q -r #{ZIP_FILE} #{FRAMEWORK}" + puts zip_cmd + puts `#{zip_cmd}` + framework_zip = File.expand_path(ZIP_FILE) + unless File.exist?(framework_zip) + raise 'Unable to zip down framework...' + end + end + + + + FileUtils.mkdir_p('staticlib') + output_path = File.join('staticlib', ZIP_FILE) + FileUtils.mv(framework_zip,output_path, :force => true) + puts "Server built to path #{output_path}" + + end + + build_server + +end + +task :build => [:build_server] +task :install => [:build_server] +task :release => [:build_server] +