Sha256: 6bd066e305c226a6c04c28b13792734bdc7a58aaee617273eecd38bbe6131a09

Contents?: true

Size: 1.51 KB

Versions: 3

Compression:

Stored size: 1.51 KB

Contents

require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rbconfig'
include RbConfig

CLEAN.include(
  '**/*.gem',               # Gem files
  '**/*.rbc',               # Rubinius
  '**/*.o',                 # C object file
  '**/*.log',               # Ruby extension build log
  '**/Makefile',            # C Makefile
  '**/*.def',               # Definition files
  '**/*.exp',
  '**/*.lib',
  '**/*.pdb',
  '**/*.obj',
  '**/*.stackdump',         # Junk that can happen on Windows
  "**/*.#{CONFIG['DLEXT']}" # C shared object
)

make = CONFIG['host_os'] =~ /mingw|cygwin/i ? 'make' : 'nmake'

desc "Build the win32-xpath library"
task :build => [:clean] do
  require 'devkit' if CONFIG['host_os'] =~ /mingw|cygwin/i
  Dir.chdir('ext') do
    ruby "extconf.rb"
    sh make
    cp 'xpath.so', 'win32' # For testing
  end
end

namespace :gem do
  desc "Build the win32-xpath gem"
  task :create => [:clean] do
    require 'rubygems/package'
    spec = eval(IO.read('win32-xpath.gemspec'))
    spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
    Gem::Package.build(spec, true)
  end

  task "Install the win32-xpath gem"
  task :install => [:create] do
    file = Dir["*.gem"].first
    sh "gem install -l #{file}"
  end
end

Rake::TestTask.new do |t|
  task :test => [:build]
  t.test_files = FileList['test/*']
  t.libs << 'ext'
end

desc "Run benchmarks"
task :bench => [:build] do
  ruby "-Iext bench/bench_win32_xpath.rb"
end

task :default => :test

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
win32-xpath-1.1.1 Rakefile
win32-xpath-1.1.0 Rakefile
win32-xpath-1.0.4 Rakefile