/
Rakefile
42 lines (39 loc) · 1.58 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
MANIFEST = FileList["Manifest.txt", "Rakefile", "README.txt", "LICENSE.txt", "lib/**/*"]
file "Manifest.txt" => :manifest
task :manifest do
File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f << "#{n}\n"} }
end
Rake::Task['manifest'].invoke
require File.dirname(__FILE__) + "/../../lib/arjdbc/version"
$LOAD_PATH << File.dirname(__FILE__) + "/../../drivers/h2/lib"
require "jdbc/h2"
begin
require 'hoe'
Hoe.plugin :gemcutter
hoe = Hoe.spec("activerecord-jdbch2-adapter") do |p|
p.version = ArJdbc::Version::VERSION
p.spec_extras[:platform] = Gem::Platform.new("java")
p.rubyforge_name = "jruby-extras"
p.url = "http://jruby-extras.rubyforge.org/ActiveRecord-JDBC"
p.author = "Nick Sieger, Ola Bini and JRuby contributors"
p.email = "nick@nicksieger.com, ola.bini@gmail.com"
p.summary = "H2 JDBC adapter for JRuby on Rails."
p.changes = "Updated to H2 version #{Jdbc::H2::VERSION}."
p.description = "Install this gem to use H2 with JRuby on Rails."
driver = 'jdbc-h2'
version = Jdbc::H2::VERSION
compat_version = "~> #{version.split(/\./)[0..1].join('.')}.0"
puts "#{p.name}: current #{driver} version #{version}, compat #{compat_version}"
p.extra_deps += [
['activerecord-jdbc-adapter', "= #{ArJdbc::Version::VERSION}"],
[driver, compat_version]]
end
task :gemspec do
File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
end
task :package => :gemspec
rescue LoadError
puts "You really need Hoe installed to be able to package this gem"
rescue => e
puts "ignoring error while loading hoe: #{e.to_s}"
end