forked from jruby/activerecord-jdbc-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
59 lines (45 loc) · 1.4 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
require 'rake/testtask'
require 'rake/clean'
CLEAN.include 'derby*', 'test.db.*','test/reports', 'test.sqlite3','lib/**/*.jar','manifest.mf', '*.log'
require 'bundler'
Bundler::GemHelper.install_tasks
require 'bundler/setup'
task :default => [:java_compile, :test]
#ugh, bundler doesn't use tasks, so gotta hook up to both tasks.
task :build => :java_compile
task :install => :java_compile
ADAPTERS = %w[derby h2 hsqldb mssql mysql postgresql sqlite3].map {|a| "activerecord-jdbc#{a}-adapter" }
DRIVERS = %w[derby h2 hsqldb jtds mysql postgres sqlite3].map {|a| "jdbc-#{a}" }
def rake(args)
ruby "-S", "rake", *args
end
(ADAPTERS + DRIVERS).each do |adapter|
namespace adapter do
task :build do
Dir.chdir(adapter) do
rake "build"
end
cp FileList["#{adapter}/pkg/#{adapter}-*.gem"], "pkg"
end
# bundler handles install => build itself
task :install do
Dir.chdir(adapter) do
rake "install"
end
end
task :release do
Dir.chdir(adapter) do
rake "release"
end
end
end
end
desc "Build all adapters"
task "all:release" => ["release", *ADAPTERS.map { |f| "#{f}:release" }]
desc "Install all adapters"
task "all:install" => ["install", *ADAPTERS.map { |f| "#{f}:install" }]
desc "Release all adapters"
task "all:build" => ["build", *ADAPTERS.map { |f| "#{f}:build" }]
task :filelist do
puts FileList['pkg/**/*'].inspect
end