Sha256: d17fd00f87a8fd15b8ae573ce8c58eeb325922a35d680a16459a4ceb86e4b1c6

Contents?: true

Size: 1.81 KB

Versions: 5

Compression:

Stored size: 1.81 KB

Contents

require 'rake/clean'
require 'rubygems/package_task'
require 'rubygems/tasks'


def gem_spec
  @gem_spec ||= Gem::Specification.load('walters.gemspec')
end

TEST_DEPS = []
if defined?(JRUBY_VERSION)
  require 'ant'
  jar_file = 'lib/walters/walters_ext.jar'
  CLEAN.include jar_file
  TEST_DEPS << jar_file

  gem_spec.files << jar_file

  directory 'pkg/classes'
  CLEAN.include 'pkg/classes'

  desc 'Compile the JRuby extension'
  task :compile => FileList['pkg/classes', 'jruby-ext/src/main/java/**/*.java'] do |t|
    ant.javac :srcdir => 'jruby-ext/src/main/java', :destdir => t.prerequisites.first,
              :source => '1.6', :target => '1.6', :debug => true, :includeantruntime => false,
              :classpath => '${java.class.path}:${sun.boot.class.path}'
  end

  desc 'Build the jar'
  file jar_file => :compile do |t|
    ant.jar :basedir => 'pkg/classes', :destfile => t.name, :includes => '**/*.class'
  end

  task :jar => jar_file
end

Gem::Tasks.new do |t|
  t.scm.tag.format = '%s'
end

task :specs do
  sh %{#{Gem.ruby} -w -Ilib -S rspec spec}
end

namespace 'java' do
  java_gem_spec = Gem::Specification.new do |s|
    s.name = gem_spec.name
    s.version = gem_spec.version
    s.author = gem_spec.author
    s.email = gem_spec.email
    s.homepage = gem_spec.homepage
    s.summary = gem_spec.summary
    s.description = gem_spec.description
    s.files = %w(LICENSE LICENSE-EscapeUtils.txt LICENSE-houdini.txt README.md Rakefile)
    s.files << Dir['{lib,spec,benchmark}/**/*.rb']
    s.files << 'lib/walters/walters_ext.jar'
    s.has_rdoc = false
    s.license = gem_spec.license
    s.platform = 'java'
  end

  Gem::PackageTask.new(java_gem_spec) do |pkg|
    pkg.need_zip = true
    pkg.need_tar = true
    pkg.package_dir = 'pkg'
  end
  
  task :gem => 'lib/walters/walters_ext.jar'
end

task 'gem:java' => 'java:gem'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
walters-0.3.0-java Rakefile
walters-0.3.0 Rakefile
walters-0.2.0-java Rakefile
walters-0.2.0 Rakefile
walters-0.1.1 Rakefile