Thrift-1354: Add rake task to build just the gem file

Client: rb
Patch: jfarrell

Updates ruby build to now build the gem by default and adds a rake task to create the gem.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1174393 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jake Farrell 2011-09-22 21:15:02 +00:00
parent dec8c54f8e
commit 4bd4f0ec25
2 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,7 @@ EXTRA_DIST = \
DESTDIR ?= / DESTDIR ?= /
all-local: all-local:
$(RAKE) build_ext $(RAKE)
install-exec-hook: install-exec-hook:
$(RAKE) install $(RAKE) install

View File

@ -24,7 +24,7 @@ require 'spec/rake/spectask'
THRIFT = '../../compiler/cpp/thrift' THRIFT = '../../compiler/cpp/thrift'
task :default => [:spec] task :default => [:gem]
task :spec => [:'gen-rb', :realspec] task :spec => [:'gen-rb', :realspec]
Spec::Rake::SpecTask.new(:realspec) do |t| Spec::Rake::SpecTask.new(:realspec) do |t|
@ -85,12 +85,16 @@ task :benchmark do
ruby 'benchmark/benchmark.rb' ruby 'benchmark/benchmark.rb'
end end
desc 'Generate and install the thrift gem' desc 'Builds the thrift gem'
task :install => [:spec, :build_ext] do task :gem => [:spec, :build_ext] do
unless sh 'gem', 'build', 'thrift.gemspec' unless sh 'gem', 'build', 'thrift.gemspec'
$stderr.puts "Failed to build thrift gem" $stderr.puts "Failed to build thrift gem"
break break
end end
end
desc 'Install the thrift gem'
task :install => [:gem] do
unless sh 'gem', 'install', 'thrift-*.gem' unless sh 'gem', 'install', 'thrift-*.gem'
$stderr.puts "Failed to install thrift gem" $stderr.puts "Failed to install thrift gem"
break break