# -* coding: utf-8 -*-
require 'rake/testtask'
require 'rake/extensiontask'
require 'rake/packagetask'
begin
  require 'bundler/gem_tasks'
rescue LoadError
  puts 'If you want to create gem, You must install Bundler'
end

require './lib/numru/fftw3/version.rb'
def version
  NumRu::FFTW3::VERSION
end

task :default => :test
task :test => :compile
Rake::TestTask.new do |t|
  t.libs << 'lib' << 'test'
  t.test_files = FileList['test/*.rb']
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'fftw3'
  ext.ext_dir = 'ext/numru/fftw3'
  ext.lib_dir = 'lib/numru/fftw3'
end

Rake::PackageTask.new('ruby-fftw3', "#{version}") do |t|
  t.need_tar_gz = true
  t.package_files.include `git ls-files`.split("\n")
end
