forked from jruby/activerecord-jdbc-adapter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
66 lines (50 loc) · 1.49 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
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
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}" }
root = File.expand_path("..", __FILE__)
version = File.read("#{root}/ARJDBC_VERSION").strip
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
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
namespace :all do
desc "Build all adapters"
task :build => "build"
task :build => ADAPTERS.map { |f| "#{f}:build" }
desc "Install all adapters"
task :install => "install"
task :install => ADAPTERS.map { |f| "#{f}:install" }
desc "Release all adapters"
task :release => "release"
task :release => ADAPTERS.map { |f| "#{f}:release" }
end
task :filelist do
puts FileList['pkg/**/*'].inspect
end