Sha256: cf6102a13ea66bf8f3f549f7ce55f6ae4ae4250243241da493459ff3e302d4ed

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 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 master).
EOF
    end

    FileUtils.cd(dir) do
      puts 'INFO: building server...'
      puts "INFO: $ cd #{File.expand_path(dir)} ; make"
      `make`
      unless File.exist?(FRAMEWORK)
        puts 'FAIL:  unable to build calabash.framework'
        puts "FAIL:  run 'make' in #{File.expand_path(dir)} to diagnose"
        raise
      end

      puts 'INFO:  creating a zip archive of calabash.framework'

      zip_cmd = "zip -y -q -r #{ZIP_FILE} #{FRAMEWORK}"
      puts "INFO: $ cd #{File.expand_path(dir)} ; #{zip_cmd}"
      `#{zip_cmd}`
      framework_zip = File.expand_path(ZIP_FILE)
      unless File.exist?(framework_zip)
        puts 'FAIL:  unable to create a zip archive of calabash.framework'
        puts "FAIL:  run '#{zip_cmd}' in #{File.expand_path(dir)} to diagnose"
        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 "INFO: calabash.framework.zip installed in #{output_path}"

  end

  build_server

end

task :install_server => [:build_server]
task :release_server => [:build_server]

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
calabash-cucumber-0.9.169.pre2 Rakefile
calabash-cucumber-0.9.168 Rakefile
calabash-cucumber-0.9.168.pre6 Rakefile
calabash-cucumber-0.9.168.pre5 Rakefile
calabash-cucumber-0.9.168.pre4 Rakefile