OLD | NEW |
(Empty) | |
| 1 require "rubygems" |
| 2 require "rubygems/package_task" |
| 3 require "rake/extensiontask" unless RUBY_PLATFORM == "java" |
| 4 require "rake/testtask" |
| 5 |
| 6 spec = Gem::Specification.load("google-protobuf.gemspec") |
| 7 |
| 8 if RUBY_PLATFORM == "java" |
| 9 if `which mvn` == '' |
| 10 raise ArgumentError, "maven needs to be installed" |
| 11 end |
| 12 task :clean do |
| 13 system("mvn clean") |
| 14 end |
| 15 |
| 16 task :compile do |
| 17 system("mvn package") |
| 18 end |
| 19 else |
| 20 Rake::ExtensionTask.new("protobuf_c", spec) do |ext| |
| 21 ext.ext_dir = "ext/google/protobuf_c" |
| 22 ext.lib_dir = "lib/google" |
| 23 end |
| 24 end |
| 25 |
| 26 Gem::PackageTask.new(spec) do |pkg| |
| 27 end |
| 28 |
| 29 Rake::TestTask.new(:test => :build) do |t| |
| 30 t.test_files = FileList["tests/*.rb"] |
| 31 end |
| 32 |
| 33 task :build => [:clean, :compile] |
| 34 task :default => [:build] |
| 35 |
| 36 # vim:sw=2:et |
OLD | NEW |