1 # for building and installing rubinius-specific gems.
3 require 'rakelib/configuration'
7 checkout_dir = File.dirname File.dirname(File.expand_path(__FILE__))
8 relative_path = File.join 'gems', 'rubinius', LIBVER
10 GEMS_DEVELOPMENT_PRE_INSTALLED_DIR = File.join checkout_dir, 'tmp',
12 GEMS_PRE_INSTALLED_DIR = File.join File.dirname(CODEPATH), relative_path
14 rule '.gem' => '.gemspec' do |task|
15 Dir.chdir File.dirname(task.source) do
16 sh 'gem', 'build', File.basename(task.source)
20 gemspecs = Dir['gems/*/*.gemspec']
22 installed_gemspecs = []
24 # rake complains about circular dependencies with .gemspec => .gem rule
25 gemspecs.each do |gemspec|
26 gem = gemspec.sub(/spec$/, '')
29 gem_name = gemspec.split(File::SEPARATOR).last
31 installed_gemspec = File.join GEMS_DEVELOPMENT_PRE_INSTALLED_DIR,
32 'specifications', gem_name
34 installed_gemspecs << installed_gemspec
36 file installed_gemspec => gem do
37 Dir.chdir File.dirname(gem) do
38 sh 'gem', 'install', File.basename(gem), '-i',
39 GEMS_DEVELOPMENT_PRE_INSTALLED_DIR
44 desc 'Build stub .gem files for installation'
45 task :build => %w[extensions] + gems
47 desc 'Remove built stub gems and rubinius gem directory from checkout'
49 gems.each { |gem| rm_f gem, :verbose => $verbose }
50 rm_rf GEMS_DEVELOPMENT_PRE_INSTALLED_DIR, :verbose => $verbose
53 desc 'Install stub gems into the checkout gem repository (tmp/gems/rubinius)'
54 task :install_development => [:build] + installed_gemspecs
56 desc 'Install stub gems into the installation gem repository'
57 task :install => :build do
58 Dir['gems/*/*.gem'].each do |gem|
59 Dir.chdir File.dirname(gem) do
60 sh 'gem', 'install', File.basename(gem), '-i',
61 GEMS_PRE_INSTALLED_DIR