forked from jruby/activerecord-jdbc-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
69 lines (51 loc) · 1.79 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
64
65
66
67
68
69
require 'rake/testtask'
require 'rake/clean'
CLEAN.include 'derby*', 'test.db.*','test/reports', 'test.sqlite3','lib/**/*.jar','manifest.mf', '*.log'
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks
require 'bundler/setup'
require 'appraisal'
task :default => [:jar, :test]
#ugh, bundler doesn't use tasks, so gotta hook up to both tasks.
task :build => :jar
task :install => :jar
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}" }
TARGETS = ( ADAPTERS + DRIVERS )
def rake(*args)
ruby "-S", "rake", *args
end
TARGETS.each do |target|
namespace target do
task :build do
Dir.chdir(target) { rake "build" }
cp FileList["#{target}/pkg/#{target}-*.gem"], "pkg"
end
task :install do
Dir.chdir(target) { rake "install" }
end
task :release do
Dir.chdir(target) { rake "release" }
end
end
end
# DRIVERS
desc "Build drivers"
task "drivers:build" => DRIVERS.map { |name| "#{name}:build" }
desc "Install drivers"
task "drivers:install" => DRIVERS.map { |name| "#{name}:install" }
desc "Release drivers"
task "drivers:release" => DRIVERS.map { |name| "#{name}:release" }
# ADAPTERS
desc "Build adapters"
task "adapters:build" => [ 'build' ] + ADAPTERS.map { |name| "#{name}:build" }
desc "Install adapters"
task "adapters:install" => [ 'install' ] + ADAPTERS.map { |name| "#{name}:install" }
desc "Release adapters"
task "adapters:release" => [ 'release' ] + ADAPTERS.map { |name| "#{name}:release" }
# ALL
task "all:build" => [ 'build' ] + TARGETS.map { |name| "#{name}:build" }
task "all:install" => [ 'install' ] + TARGETS.map { |name| "#{name}:install" }
task :filelist do
puts FileList['pkg/**/*'].inspect
end