Sha256: 7e5210562d89ef04427f5b18ff8f2c113556d9d0ae271d92ddc83fc2b3ff7ebd

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 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_path = ENV['FRAMEWORK_PATH']

    unless framework_path
      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
        framework_path = File.expand_path(FRAMEWORK)
      end
    end

    puts "Zipping down framework #{framework_path}"

    FileUtils.mkdir_p('staticlib')
    output_path = File.join('staticlib', ZIP_FILE)

    zip_cmd = "zip -q -r #{output_path} #{framework_path}"
    puts zip_cmd
    puts `#{zip_cmd}`

    unless File.exist?(output_path)
      raise 'Unable to zip down framework...'
    end

    puts "Server built to path #{output_path}"

  end

  build_server

end

task :build => [:build_server]
task :install => [:build_server]
task :release => [:build_server]

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
calabash-cucumber-0.9.140.pre1 Rakefile
calabash-cucumber-0.9.139 Rakefile
calabash-cucumber-0.9.138 Rakefile
calabash-cucumber-0.9.136 Rakefile