forked from jruby/warbler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
63 lines (52 loc) · 1.62 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#-*- mode: ruby -*-
#--
# Copyright (c) 2010-2012 Engine Yard, Inc.
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
# This source code is available under the MIT license.
# See the file LICENSE.txt for details.
#++
begin
require 'bundler'
rescue LoadError
warn "\nPlease `gem install bundler' and run `bundle install' to ensure you have all dependencies.\n\n"
else
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks :dir => File.dirname(__FILE__)
end
require 'rake/clean'
CLEAN << "pkg" << "doc" << Dir['integration/**/target']
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ['--color', "--format documentation"]
end
task :default => :spec
# use Mavenfile to define :jar task
require 'maven/ruby/maven'
mvn = Maven::Ruby::Maven.new
if defined?(JRUBY_VERSION) && !JRUBY_VERSION.start_with?('9.0')
mvn.inherit_jruby_version
end
desc 'compile java sources and build jar'
task :jar do
mvn.prepare_package
end
desc 'run some integration test'
task :integration do
mvn.verify
end
desc 'generate the pom.xml from the Mavenfile'
task :pom do
mvn.validate('-Dpolyglot.dump.pom=pom.xml')
end
# Make sure jar gets compiled before the gem is built
task :build => :jar
require 'rdoc/task'
RDoc::Task.new(:docs) do |rd|
gemspec = Gem::Specification.load(File.expand_path('warbler.gemspec', File.dirname(__FILE__)))
rd.rdoc_dir = "doc"
rd.rdoc_files.include("README.rdoc", "History.txt", "LICENSE.txt")
rd.rdoc_files += gemspec.require_paths
rd.options << '--title' << "#{gemspec.name}-#{gemspec.version} Documentation"
rd.options += gemspec.rdoc_options
end
task :release => :docs