deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [3/4] git commit: Core: Added 'generate:gemspec' rake task
Date Mon, 27 May 2013 09:03:42 GMT
Core: Added 'generate:gemspec' rake task

The 'gemspec' is not longer loaded in Gemfile.
For this we need to update deltacloud-core.gemspec
everytime we do a release (or doing `gem build`).


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/999bd127
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/999bd127
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/999bd127

Branch: refs/heads/master
Commit: 999bd127c59044b38ae2ef9cdcc68f877885f755
Parents: 3ee058a
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu Apr 11 13:15:40 2013 +0200
Committer: Michal Fojtik <mfojtik@redhat.com>
Committed: Mon May 27 11:00:54 2013 +0200

----------------------------------------------------------------------
 server/Gemfile                                   |   33 ++++++-
 server/Rakefile                                  |   37 +++++---
 server/support/tools/deltacloud-core-gemspec.erb |   83 +++++++++++++++++
 3 files changed, 135 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/999bd127/server/Gemfile
----------------------------------------------------------------------
diff --git a/server/Gemfile b/server/Gemfile
index 0b853c1..19efa59 100644
--- a/server/Gemfile
+++ b/server/Gemfile
@@ -1,21 +1,46 @@
 source "https://rubygems.org"
 
 gem 'rack-accept', :require => 'rack/accept'
-gem 'sinatra', :require => 'sinatra/base'
+gem 'sinatra', '>=1.1.6', :require => 'sinatra/base'
 gem 'sinatra-rabbit', :require => 'sinatra/rabbit'
 gem 'json_pure', :require => 'json/pure'
 
+gem 'haml'
+gem 'rack-accept', :require => 'rack/accept'
+gem 'json_pure', :require => 'json/pure'
+gem 'net-ssh'
+gem 'nokogiri'
+gem 'sequel'
+gem 'tilt'
+gem 'aws', '>=2.7.0'
+gem 'waz-storage', '>=1.1.0'
+gem 'cloudservers'
+gem 'cloudfiles'
+gem 'fog'
+gem 'rest-client'
+gem 'uuidtools'
+gem 'openstack', '>=1.0.9'
+gem 'savon'
+gem 'rbvmomi'
+gem 'rbovirt', '>=0.0.19'
+
+platform :mri do
+  gem 'sqlite3'
+  gem 'thin'
+end
+
 platform :jruby do
   gem 'jdbc-sqlite3', :require => 'jdbc/sqlite3'
+  gem 'jruby-openssl'
+  gem 'puma'
 end
 
 group :test do
-  gem "rake"
+  gem 'rake'
   gem "rack-test", :require => 'rack/test'
   gem "minitest", '< 5.0.0'
   gem "webmock", '< 1.10'  # VCR wants that version
   gem "vcr"
-  gem "aws"
   gem 'pry'
   gem 'nokogiri'
 end
@@ -32,5 +57,3 @@ group :jenkins do
   gem 'turn'
   gem 'minitest-reporters', :platform => "ruby_19"
 end
-
-gemspec

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/999bd127/server/Rakefile
----------------------------------------------------------------------
diff --git a/server/Rakefile b/server/Rakefile
index 9fb2c89..6045173 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -33,10 +33,29 @@ begin
 rescue LoadError
 end
 
-spec = Gem::Specification.load('deltacloud-core.gemspec')
+begin
+  spec = Gem::Specification.load('deltacloud-core.gemspec')
+  Gem::PackageTask.new(spec) do |pkg|
+    pkg.need_tar = true
+  end
+rescue
+end
 
-Gem::PackageTask.new(spec) do |pkg|
-  pkg.need_tar = true
+namespace :generate do
+  desc 'Generate deltacloud-core.gemspec from Bundler'
+  task :gemspec do
+    require 'bundler'
+    require 'erb'
+    deps = {}
+    deps[:runtime] = Bundler.definition.dependencies.select { |d|
+      d.groups.include?(:default) && d.platforms.empty?
+    }
+    deps[:java] = Bundler.definition.dependencies.select { |d| d.platforms.include?(:jruby)
}
+    deps[:mri] = Bundler.definition.dependencies.select { |d| d.platforms.include?(:mri)
}
+    deps[:dev] = Bundler.definition.dependencies.select { |d| d.groups.include?(:test) }
+    gemspec_tpl = ERB.new(File.read('support/tools/deltacloud-core-gemspec.erb'))
+    puts gemspec_tpl.result(binding)
+  end
 end
 
 # Not meant for enduser consumption; make sure we run our initializers
@@ -171,10 +190,6 @@ namespace :test do
 
     DRIVERS.each do |driver|
       Rake::TestTask.new(driver) do |t|
-        #t.ruby_opts << '-r./tests/test_helper.rb'   # Load SimpleCov when COVERAGE=1
is set
-        unless RUBY_VERSION < '1.9.0'
-          t.loader = :testrb
-        end
         t.test_files = FileList["tests/drivers/#{driver}/*test.rb"]
       end
     end
@@ -194,18 +209,14 @@ namespace :test do
   end
 
   Rake::TestTask.new(:ec2) do |t|
-    unless RUBY_VERSION < '1.9.0'
-      t.loader = :testrb
-    end
+    t.ruby_opts = ['-r./tests/test_helper']
     t.test_files = FileList[
       'tests/ec2/*test.rb',                     # EC2 frontend internal API tests
     ]
   end
 
   Rake::TestTask.new(:cimi) do |t|
-    unless RUBY_VERSION < '1.9.0'
-      t.loader = :testrb
-    end
+    t.ruby_opts = ['-r./tests/test_helper']
     t.test_files = FileList[
       'tests/cimi/db/*test.rb',     # CIMI frontend database tests
       'tests/cimi/model/*spec.rb',  # CIMI frontend serialization API tests

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/999bd127/server/support/tools/deltacloud-core-gemspec.erb
----------------------------------------------------------------------
diff --git a/server/support/tools/deltacloud-core-gemspec.erb b/server/support/tools/deltacloud-core-gemspec.erb
new file mode 100644
index 0000000..9266651
--- /dev/null
+++ b/server/support/tools/deltacloud-core-gemspec.erb
@@ -0,0 +1,83 @@
+#
+# 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 File::expand_path(File::join(File::dirname(__FILE__), './lib/deltacloud/version.rb'))
+
+Gem::Specification.new do |s|
+  s.author = 'The Apache Software Foundation'
+  s.homepage = "http://www.deltacloud.org"
+  s.email = 'dev@deltacloud.apache.org'
+  s.name = 'deltacloud-core'
+
+  s.description = <<-EOF
+    The Deltacloud API is built as a service-based REST API.
+    You do not directly link a Deltacloud library into your program to use it.
+    Instead, a client speaks the Deltacloud API over HTTP to a server
+    which implements the REST interface.
+  EOF
+
+  s.version = Deltacloud::API_VERSION
+  s.date = Time.now
+  s.summary = %q{Deltacloud REST API}
+  s.files = [
+    'Rakefile',
+    '*.gemspec',
+    'config.ru',
+    '*.rb',
+    'log',
+    'config/drivers/*.yaml',
+    'config/*.yaml',
+    'config/*.xml',
+    'tmp',
+    'support/fedora/**',
+    'support/condor/bash/**',
+    'support/condor/config/**',
+    'lib/**/*.rb',
+    'lib/**/*.yml',
+    'lib/**/*.haml',
+    'db/**/*.rb',
+    'tests/**/*.rb',
+    'views/**/*.haml',
+    'views/instance_states/*.erb',
+    'public/favicon.ico',
+    'public/images/*.png',
+    'public/javascripts/*.js',
+    'public/stylesheets/*.css',
+    'public/stylesheets/images/*.png',
+    'public/stylesheets/compiled/*.css',
+    'bin/deltacloudd'
+  ].map { |f| Dir[f] }.flatten
+
+  s.bindir = 'bin'
+  s.executables = ['deltacloudd', 'deltacloud-db-upgrade']
+  s.test_files= Dir.glob("tests/**/*_test.rb")
+  s.extra_rdoc_files = Dir["LICENSE", "DISCLAIMER", "NOTICE"]
+  s.required_ruby_version = '>= 1.8.6'
+  s.has_rdoc = 'false'
+
+  <% deps[:runtime].each do |d|%>s.add_dependency('<%=d.name%>', '<%=d.requirement%>')
+  <% end %>
+  if RUBY_PLATFORM == 'java'
+    <% deps[:java].each do |d|%>s.add_dependency('<%=d.name%>', '<%=d.requirement%>')
+    <% end %>
+  else
+    <% deps[:mri].each do |d|%>s.add_dependency('<%=d.name%>', '<%=d.requirement%>')
+    <% end %>
+  end
+  <% deps[:dev].each do |d|%>s.add_development_dependency('<%=d.name%>', '<%=d.requirement%>')
+  <% end %>
+
+end


Mime
View raw message