# Rakefile for Qpid -*- ruby -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require "rubygems" require "rubygems/package_task" require "rake/clean" require "rake/extensiontask" require "rake/rdoctask" CPROTON_BUILD=ENV["CPROTON_BUILD"].nil? ? nil : "#{ENV['CPROTON_BUILD']}/bindings/ruby" if CPROTON_BUILD.nil? puts "********************************************************" puts "Please set CPROTON_BUILD to build the native extensions." puts "********************************************************" puts "" end PROTON_HOME=ENV["PROTON_HOME"] if PROTON_HOME.nil? puts "*************************************************************" puts "Please source the config.sh file to set the PROTON_HOME path." puts "*************************************************************" puts "" end require "rspec/core/rake_task" CLOBBER.include("ext/cproton/cproton.c") load "lib/qpid_proton/version.rb" task :package => :swig task :swig do system "swig -ruby -I../../include -o ext/cproton/cproton.c ruby.i" end RSpec::Core::RakeTask.new(:rspec) do |t| t.ruby_opts = [ "-I #{CPROTON_BUILD}", "-I lib" ] t.rspec_opts = [ "--color", "--format", "progress" ] end Rake::RDocTask.new do |rd| rd.main = "README.rdoc" rd.rdoc_files.include("README.rdoc", "lib/**/*.rb") end # Gem specification and packaging spec = Gem::Specification.new do |s| s.name = Qpid::Proton::NAME s.version = Qpid::Proton::VERSION s.platform = Gem::Platform::RUBY s.author = "Darryl L. Pierce" s.email = "dpierce@redhat.com" s.homepage = "http://qpid.apache.org/proton" s.license = "ASL" s.summary = "Ruby language bindings for the Qpid Proton messaging framework" s.description = <<-EOF Proton is a high performance, lightweight messaging library. It can be used in the widest range of messaging applications including brokers, client libraries, routers, bridges, proxies, and more. Proton is based on the AMQP 1.0 messaging standard. EOF s.rubyforge_project = "qpid_proton" s.requirements << "none" s.require_path = "lib" s.extensions << "ext/cproton/extconf.rb" s.files = Dir[ "TODO", "ChangeLog", "ext/cproton/*.rb", "ext/cproton/*.c", "lib/**/*.rb", "features/**/*.rb" ] end Rake::ExtensionTask.new("cproton", spec) do |t| t.config_options << "--with-qpid-proton-lib=${CPROTON_BUILD}" t.config_options << "--with-qpid-proton-include=#{PROTON_HOME}/proton-c/include" end Gem::PackageTask.new(spec) do |pkg| end