Sha256: dd5af5fd2970ea0acd47ebeda9f1d0bfed85025387dd93bdbf2552e98313453f

Contents?: true

Size: 1.41 KB

Versions: 7

Compression:

Stored size: 1.41 KB

Contents

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 iphonesimulator7.0'
      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 :install_server => [:build_server]
task :release_server => [:build_server]

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
calabash-cucumber-0.9.158 Rakefile
calabash-cucumber-0.9.157 Rakefile
calabash-cucumber-0.9.156 Rakefile
calabash-cucumber-0.9.155 Rakefile
calabash-cucumber-0.9.154 Rakefile
calabash-cucumber-0.9.153 Rakefile
calabash-cucumber-0.9.152 Rakefile