incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r1000260 - in /incubator/deltacloud/trunk/client: Rakefile deltacloud-client.gemspec
Date Wed, 22 Sep 2010 22:14:36 GMT
Author: lutter
Date: Wed Sep 22 22:14:35 2010
New Revision: 1000260

URL: http://svn.apache.org/viewvc?rev=1000260&view=rev
Log:
Build java and ruby versions of client 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-client.gemspec' then the version built
will depend on which interpreter you're using.

Modified:
    incubator/deltacloud/trunk/client/Rakefile
    incubator/deltacloud/trunk/client/deltacloud-client.gemspec

Modified: incubator/deltacloud/trunk/client/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/Rakefile?rev=1000260&r1=1000259&r2=1000260&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/Rakefile (original)
+++ incubator/deltacloud/trunk/client/Rakefile Wed Sep 22 22:14:35 2010
@@ -25,8 +25,15 @@ task 'documentation' do
   load 'lib/documentation.rb'
 end
 
-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-client.gemspec'))
+end
+
+@specs.values.each do |spec|
+  Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.need_tar = true
+  end
 end
 
 if Gem.available?('rspec')

Modified: incubator/deltacloud/trunk/client/deltacloud-client.gemspec
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/deltacloud-client.gemspec?rev=1000260&r1=1000259&r2=1000260&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/deltacloud-client.gemspec (original)
+++ incubator/deltacloud/trunk/client/deltacloud-client.gemspec Wed Sep 22 22:14:35 2010
@@ -17,7 +17,7 @@
 # under the License.
 
 
-@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'
@@ -32,7 +32,13 @@
   s.test_files= Dir.glob("specs/**/**")
   s.extra_rdoc_files = Dir["COPYING"]
 
+  # 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('rest-client', '>= 1.4.2')
-  s.add_dependency('nokogiri', '>= 1.4.1')
+  s.add_dependency('nokogiri', '>= 1.4.1') if s.platform.to_s == 'ruby'
+  s.add_dependency('nokogiri', '>= 1.5.0.beta.2') if s.platform.to_s == 'java'
   s.add_development_dependency('rspec', '>= 1.3.0')
 end



Mime
View raw message