Sha256: 0b0725f0f3cdf398d6a6927f57d8cfd4e571ededb564c2040b2f79654d4accb0

Contents?: true

Size: 1.96 KB

Versions: 9

Compression:

Stored size: 1.96 KB

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

require 'fileutils'

require 'rspec/core'
require 'rspec/core/rake_task'
require 'yard'

task :spec => :compile

desc 'Run RSpec code examples and measure coverage'
task :coverage do |t|
  ENV['SIMPLE_COV'] = '1'
  Rake::Task["spec"].invoke
end

desc 'Generate YARD document'
YARD::Rake::YardocTask.new(:doc) do |t|
  t.files   = ['lib/msgpack/version.rb','doclib/**/*.rb']
  t.options = []
  t.options << '--debug' << '--verbose' if $trace
end

spec = eval File.read("msgpack.gemspec")

if RUBY_PLATFORM =~ /java/
  require 'rake/javaextensiontask'

  Rake::JavaExtensionTask.new('msgpack', spec) do |ext|
    ext.ext_dir = 'ext/java'
    jruby_home = RbConfig::CONFIG['prefix']
    jars = ["#{jruby_home}/lib/jruby.jar"]
    ext.classpath = jars.map { |x| File.expand_path(x) }.join(':')
    ext.lib_dir = File.join(*['lib', 'msgpack', ENV['FAT_DIR']].compact)
    ext.source_version = '1.6'
    ext.target_version = '1.6'
  end

  RSpec::Core::RakeTask.new(:spec) do |t|
    t.rspec_opts = ["-c", "-f progress"]
    t.rspec_opts << "-Ilib"
    t.pattern = 'spec/{,jruby/}*_spec.rb'
    t.verbose = true
  end

else
  require 'rake/extensiontask'

  Rake::ExtensionTask.new('msgpack', spec) do |ext|
    ext.ext_dir = 'ext/msgpack'
    ext.cross_compile = true
    ext.lib_dir = File.join(*['lib', 'msgpack', ENV['FAT_DIR']].compact)
    # cross_platform names are of MRI's platform name
    ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
  end

  RSpec::Core::RakeTask.new(:spec) do |t|
    t.rspec_opts = ["-c", "-f progress"]
    t.rspec_opts << "-Ilib"
    t.pattern = 'spec/{,cruby/}*_spec.rb'
    t.verbose = true
  end
end

namespace :build do
  desc 'Build gems for Windows per rake-compiler-dock'
  task :windows do
    require 'rake_compiler_dock'
    RakeCompilerDock.sh 'bundle && rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2'
  end
end

CLEAN.include('lib/msgpack/msgpack.*')

task :default => [:spec, :build, :doc]

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
msgpack-0.7.1-x64-mingw32 Rakefile
msgpack-0.7.1-x86-mingw32 Rakefile
msgpack-0.7.1 Rakefile
msgpack-0.7.0-x64-mingw32 Rakefile
msgpack-0.7.0-x86-mingw32 Rakefile
msgpack-0.7.0 Rakefile
msgpack-0.7.0dev1-x64-mingw32 Rakefile
msgpack-0.7.0dev1-x86-mingw32 Rakefile
msgpack-0.7.0dev1 Rakefile