Sha256: 218d38dd8a3641ad7f853b7c97a167fb2842e934b04cede50d4fa5c6c8547bc0

Contents?: true

Size: 1.57 KB

Versions: 2

Compression:

Stored size: 1.57 KB

Contents

require 'rake'
require 'rake/testtask'
require 'bundler/gem_tasks'

task :default => [:test, :gruff_test, :gem]
task :gem => :build

jar_file = File.join(%w(lib magick4j.jar))

desc 'Clean up any generated file.'
task :clean do
  rm_rf 'pkg'
end

desc 'Run gruff unit tests.'
task :gruff_test do
  FileList['test/gruff_tests/test/test_*.rb'].each do |file|
    puts `ruby #{file}`
    puts ''
  end
end

desc 'Run a live sample using RMagick4j.'
task :sample do
  load_paths = '-Ijruby -Ilib -Ipkg'
  sh "java #{classpath(jar_file)} org.jruby.Main #{load_paths} test/RMagickTestSuite.rb addWatermark"
end

task :spec do
  require 'spec/rake/spectask'
  desc 'Runs Java Integration Specs'
  
  Spec::Rake::SpecTask.new do |t|
    t.spec_opts ||= []
    t.spec_files =  if ENV['class'].nil?
                      FileList['test/spec/**']
                    else
                      File.join('test', 'spec', ENV['class']+'_spec.rb')
                    end
  end

end

task :stories do
  if ENV['file'].nil?
    FileList['test/spec/stories/**/*_runner.rb'].each do |runner|
      require runner
    end
  else
    require File.join('test', 'spec', 'stories', ENV['file']+'_runner.rb')
  end
end

%w(package install_gem debug_gem).each { |t| task t => :compile }

# helper methods below

def classpath(extra_jars=nil)
  jruby_cpath = Java::java.lang.System.getProperty 'java.class.path'
  path = jruby_cpath ? jruby_cpath.split(File::PATH_SEPARATOR) : []
  path << FileList['lib/*.jar']
  path << extra_jars.split(File::PATH_SEPARATOR) if extra_jars
  "-cp #{path.flatten.join(File::PATH_SEPARATOR)}"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmagick4j-0.3.9-java Rakefile
rmagick4j-0.3.8 Rakefile