incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r991367 - in /incubator/deltacloud/trunk/server: Rakefile deltacloud-core.gemspec
Date Tue, 31 Aug 2010 22:27:36 GMT
Author: lutter
Date: Tue Aug 31 22:27:35 2010
New Revision: 991367

URL: http://svn.apache.org/viewvc?rev=991367&view=rev
Log:
Build java and ruby versions of core gem

The Rakefile was modified so that 'rake gem' or 'rake package'
builds both the java and ruby versions. If you manually run
'gem build deltacloud-core.gemspec' then the version built
will depend on which interpreter you're using.

The java gem doesn't include eventmachine, thin, or rerun. The
deltacloudd script will need to be modified to run under jruby.

Modified:
    incubator/deltacloud/trunk/server/Rakefile
    incubator/deltacloud/trunk/server/deltacloud-core.gemspec

Modified: incubator/deltacloud/trunk/server/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/Rakefile?rev=991367&r1=991366&r2=991367&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/Rakefile (original)
+++ incubator/deltacloud/trunk/server/Rakefile Tue Aug 31 22:27:35 2010
@@ -43,10 +43,16 @@ Rake::TestTask.new("test") { |t|
   t.warning = false
 }
 
-load 'deltacloud-core.gemspec'
 
-Rake::GemPackageTask.new(@spec) do |pkg|
-  pkg.need_tar = true
+@specs = ['ruby', 'java'].inject({}) do |hash, spec_platform|
+  $platform = spec_platform
+  hash.update(spec_platform => Gem::Specification.load('deltacloud-core.gemspec'))
+end
+
+@specs.values.each do |spec|
+  Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.need_tar = true
+  end
 end
 
 desc "Install API"

Modified: incubator/deltacloud/trunk/server/deltacloud-core.gemspec
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/deltacloud-core.gemspec?rev=991367&r1=991366&r2=991367&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/deltacloud-core.gemspec (original)
+++ incubator/deltacloud/trunk/server/deltacloud-core.gemspec Tue Aug 31 22:27:35 2010
@@ -18,7 +18,7 @@
 
 require 'rake'
 
-@spec=Gem::Specification.new do |s|
+Gem::Specification.new do |s|
   s.author = 'Red Hat, Inc.'
   s.homepage = "http://www.deltacloud.org"
   s.email = 'deltacloud-users@lists.fedorahosted.org'
@@ -57,13 +57,19 @@ require 'rake'
   s.test_files= Dir.glob("tests/*_test.rb")
   s.extra_rdoc_files = Dir["COPYING"]
   s.required_ruby_version = '>= 1.8.1'
+
+  # Rakefile needs to create spec for both platforms (ruby and java), using the
+  # $platform global variable. In all other cases, we figure it out from
+  # RUBY_PLATFORM.
+  s.platform = $platform || RUBY_PLATFORM[/java/] || 'ruby'
+
   s.add_dependency('rake', '>= 0.8.7')
-  s.add_dependency('eventmachine', '>= 0.12.10')
+  s.add_dependency('eventmachine', '>= 0.12.10') if s.platform.to_s == 'ruby'
   s.add_dependency('haml', '>= 2.2.17')
   s.add_dependency('sinatra', '>= 0.9.4')
   s.add_dependency('rack', '>= 1.0.0')
-  s.add_dependency('thin', '>= 1.2.5')
-  s.add_dependency('rerun', '>= 0.5.2')
+  s.add_dependency('thin', '>= 1.2.5') if s.platform.to_s == 'ruby'
+  s.add_dependency('rerun', '>= 0.5.2') if s.platform.to_s == 'ruby'
   s.add_dependency('json', '>= 1.4.3')
   s.add_development_dependency('compass', '>= 0.8.17')
   s.add_development_dependency('nokogiri', '>= 1.4.1')



Mime
View raw message