Sha256: ed378526a8d202e5d57e88aaf2d3aa342bb200889f8dc6f5039b56e730431c55

Contents?: true

Size: 1.58 KB

Versions: 21

Compression:

Stored size: 1.58 KB

Contents

require "bundler/gem_tasks"
require "rake/testtask"

## safely load all the rake tasks in the `tasks` directory
def safe_load(file)
  begin
    load file
  rescue LoadError => ex
    puts "Error loading rake tasks from '#{file}' but will continue..."
    puts ex.message
  end
end
Dir.glob('tasks/**/*.rake').each do |rakefile|
  safe_load rakefile
end

task :default => :test

if defined?(JRUBY_VERSION)
  require "ant"

  directory "pkg/classes"
  directory 'pkg/tests'

  desc "Clean up build artifacts"
  task :clean do
    rm_rf "pkg/classes"
    rm_rf "pkg/tests"
    rm_rf "lib/thread_safe/jruby_cache_backend.jar"
  end

  desc "Compile the extension"
  task :compile => "pkg/classes" do |t|
    ant.javac :srcdir => "ext", :destdir => t.prerequisites.first,
      :source => "1.5", :target => "1.5", :debug => true,
      :classpath => "${java.class.path}:${sun.boot.class.path}"
  end

  desc "Build the jar"
  task :jar => :compile do
    ant.jar :basedir => "pkg/classes", :destfile => "lib/thread_safe/jruby_cache_backend.jar", :includes => "**/*.class"
  end

  desc "Build test jar"
  task 'test-jar' => 'pkg/tests' do |t|
    ant.javac :srcdir => 'test/src', :destdir => t.prerequisites.first,
      :source => "1.5", :target => "1.5", :debug => true

    ant.jar :basedir => 'pkg/tests', :destfile => 'test/package.jar', :includes => '**/*.class'
  end

  task :package => [ :clean, :compile, :jar, 'test-jar' ]
else
  # No need to package anything for non-jruby rubies
  task :package
end

Rake::TestTask.new :test => :package do |t|
  t.libs << "lib"
  t.test_files = FileList["test/**/*.rb"]
end

Version data entries

21 entries across 20 versions & 9 rubygems

Version Path
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/thread_safe-0.3.5-java/Rakefile
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/thread_safe-0.3.5-java/Rakefile
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/Rakefile
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/Rakefile
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/thread_safe-0.3.5-java/Rakefile
logstash-codec-json-2.0.3 vendor/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/thread_safe-0.3.5-java/Rakefile