# -*- ruby -*-
#--
# Copyright (C) 2008-2009 David Kellum
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#++
$LOAD_PATH << './lib'
require 'rjack-slf4j/base'
require 'rubygems'
gem 'rjack-tarpit', '~> 1.2.0'
require 'rjack-tarpit'
t = RJack::TarPit.new( 'rjack-slf4j', RJack::SLF4J::VERSION, :java_platform )
t.specify do |h|
h.developer( "David Kellum", "dek-oss@gravitext.com" )
h.rubyforge_name = "rjack"
h.remote_rdoc_dir = "slf4j"
end
loaders =
begin
l = RJack::SLF4J::ADAPTERS.flatten.compact
l.delete( "jul-to-slf4j" ) # exception: maintained as source
l
end
t.generated_files = loaders.map { |adp| "lib/#{t.name}/#{adp}.rb" }
t.jars =
begin
j = [ 'slf4j-api' ]
j += RJack::SLF4J::ADAPTERS.map { |i,o| [ i, "slf4j-#{o}" ] }.flatten.compact
j.map { |n| "#{n}-#{RJack::SLF4J::SLF4J_VERSION}.jar" }
end
file 'Manifest.txt' => [ "lib/#{t.name}/base.rb" ]
t.assembly_version = 1.0
task :check_pom_deps do
t.test_line_match( 'pom.xml',
%r[#{RJack::SLF4J::SLF4J_VERSION}] )
end
task :check_history_version do
t.test_line_match( 'History.rdoc', /^==/, / #{t.version} / )
end
task :check_history_date do
t.test_line_match( 'History.rdoc', /^==/, /\([0-9\-]+\)$/ )
end
task :gem => [ :check_pom_deps, :check_history_version ]
task :tag => [ :check_pom_deps, :check_history_version, :check_history_date ]
task :push => [ :check_history_date ]
t.define_tasks
loaders.each do |adapter|
file "lib/#{t.name}/#{adapter}.rb" => [ "lib/#{t.name}/base.rb", 'Rakefile' ] do
open( "lib/#{t.name}/#{adapter}.rb", 'w' ) do |out|
out.write <