Sha256: ed2759d11b0384fa8e37772d8d8db8c7ec88185f8513f3d02f0da93cac3d1aac

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

require 'rake/extensiontask'
require 'rspec/core/rake_task'
require 'fileutils'

XHYVE_TMP = 'tmp/xhyve'

# Compile native extensions task
Rake::ExtensionTask.new 'vmnet' do |ext|
  ext.lib_dir = 'lib/xhyve/vmnet'
end

# Spec test
RSpec::Core::RakeTask.new(:spec)

desc 'Build xhyve binary'
task :vendor do
  Dir.chdir('tmp') do
    unless Dir.exist?('xhyve/.git')
      system('git clone https://github.com/mist64/xhyve.git') || fail('Could not clone xhyve')
    end
    Dir.chdir('xhyve') do
      system('git fetch') || fail('Could not fetch')
      system('git reset --hard origin/master') || fail('Could not reset head')
      system('make') || fail('Make failed')
    end
  end
  FileUtils.mkdir_p('lib/xhyve/vendor')
  FileUtils.cp('tmp/xhyve/build/xhyve', 'lib/xhyve/vendor')
end

desc 'Build the ruby gem'
task :build do
  system('gem build xhyve-ruby.gemspec') || fail('Failed to build gem')
end

desc 'Install gem'
task install: :build do
  system('gem install xhyve-ruby*.gem') || fail('Couldn not install gem')
end

# Deps and defaults
task default: :spec

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vagrant-hyperkit-0.4.3 vendor/xhyve-ruby/Rakefile
vagrant-xhyve-0.4.1 vendor/xhyve-ruby/Rakefile
vagrant-xhyve-0.4.0 vendor/xhyve-ruby/Rakefile
vagrant-xhyve-0.3.0 vendor/xhyve-ruby/Rakefile
vagrant-xhyve-0.2.0 vendor/xhyve-ruby/Rakefile