You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/08/26 18:56:58 UTC

svn commit: r689132 - in /incubator/buildr/trunk: Rakefile buildr.gemspec

Author: assaf
Date: Tue Aug 26 09:56:58 2008
New Revision: 689132

URL: http://svn.apache.org/viewvc?rev=689132&view=rev
Log:
Now using buildr.gemspec to create both specifications (ruby and java).  It's not pretty (globals!), but it keeps everything neatly in one single file.

Modified:
    incubator/buildr/trunk/Rakefile
    incubator/buildr/trunk/buildr.gemspec

Modified: incubator/buildr/trunk/Rakefile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/Rakefile?rev=689132&r1=689131&r2=689132&view=diff
==============================================================================
--- incubator/buildr/trunk/Rakefile (original)
+++ incubator/buildr/trunk/Rakefile Tue Aug 26 09:56:58 2008
@@ -16,21 +16,9 @@
 
 require 'rake/gempackagetask'
 
-def spec(platform = nil)
-  @specs ||= {}
-  platform ||= RUBY_PLATFORM =~ /java/ ? 'java' : 'ruby'
-  @specs[platform] ||= begin
-    spec = Gem::Specification.load(File.join(File.dirname(__FILE__), 'buildr.gemspec'))
-    spec.platform = platform
-    if platform =~ /java/
-      spec.add_dependency 'jruby-openssl', '0.2'
-      spec.add_dependency 'ci_reporter', '1.5.1' # must come after builder dependency
-    else
-      # Place first on the dependency list, otherwise AntWrap picks the latest RJB.
-      spec.dependencies.unshift Gem::Dependency.new('rjb', '1.1.4')
-    end
-    spec
-  end
+def spec(platform = RUBY_PLATFORM[/java/] || 'ruby')
+  @specs ||= ['ruby', 'java'].inject({}) { |hash, $platform| hash.update($platform=>Gem::Specification.load('buildr.gemspec')) }
+  @specs[platform]
 end
 
 

Modified: incubator/buildr/trunk/buildr.gemspec
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/buildr.gemspec?rev=689132&r1=689131&r2=689132&view=diff
==============================================================================
--- incubator/buildr/trunk/buildr.gemspec (original)
+++ incubator/buildr/trunk/buildr.gemspec Tue Aug 26 09:56:58 2008
@@ -18,22 +18,25 @@
   spec.name           = 'buildr'
   spec.version        = '1.3.3'
   spec.author         = 'Apache Buildr'
-  spec.email          = "#{spec.name}-user@incubator.apache.org"
-  spec.homepage       = "http://incubator.apache.org/#{spec.name}/"
+  spec.email          = "buildr-user@incubator.apache.org"
+  spec.homepage       = "http://incubator.apache.org/buildr"
   spec.summary        = 'A build system that doesn\'t suck'
+  spec.rubyforge_project  = 'buildr'
 
-  spec.files          = Dir['lib/**/*', 'addon/**/*', 'README', 'CHANGELOG', 'LICENSE', 'NOTICE', 'DISCLAIMER', 'KEYS',
+  # 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.
+  spec.platform       = $platform || RUBY_PLATFORM[/java/] || 'ruby'
+  spec.files          = Dir['lib/**/*', 'addon/**/*', 'README.rdoc', 'CHANGELOG', 'LICENSE', 'NOTICE', 'DISCLAIMER', 'KEYS',
                          '*.gemspec', 'Rakefile', 'rakelib/**/*', 'spec/**/*', 'doc/**/*']
   spec.require_paths  = ['lib', 'addon']
   spec.bindir         = 'bin'                               # Use these for applications.
   spec.executable     = 'buildr'
 
-  spec.has_rdoc           = true
-  spec.extra_rdoc_files   = ['README', 'CHANGELOG', 'LICENSE', 'NOTICE', 'DISCLAIMER']
-  spec.rdoc_options       << '--title' << "Buildr -- #{spec.summary}" <<
-                             '--main' << 'README' << '--line-numbers' << '--inline-source' << '-p' <<
-                             '--webcvs' << 'http://svn.apache.org/repos/asf/incubator/#{spec.name}/trunk/'
-  spec.rubyforge_project  = 'buildr'
+  spec.has_rdoc         = true
+  spec.extra_rdoc_files = ['README.rdoc', 'CHANGELOG', 'LICENSE', 'NOTICE', 'DISCLAIMER']
+  spec.rdoc_options     << '--title' << "Buildr" << '--main' << 'README.rdoc' <<
+                           '--line-numbers' << '--inline-source' << '-p' <<
+                           '--webcvs' << 'http://svn.apache.org/repos/asf/incubator/buildr/trunk/'
 
   # Tested against these dependencies.
   spec.add_dependency 'rake',                 '0.8.1'
@@ -44,8 +47,11 @@
   spec.add_dependency 'highline',             '1.4.0'
   spec.add_dependency 'rubyforge',            '1.0.0'
   spec.add_dependency 'hoe',                  '1.6.0'
+  spec.add_dependency 'rjb',                  '1.1.4' if spec.platform.to_s == 'ruby' 
   spec.add_dependency 'Antwrap',              '0.7.0'
   spec.add_dependency 'rspec',                '1.1.4'
   spec.add_dependency 'xml-simple',           '1.0.11'
   spec.add_dependency 'archive-tar-minitar',  '0.5.2'
-end
+  spec.add_dependency 'jruby-openssl',        '0.2'   if spec.platform.to_s == 'java'
+  spec.add_dependency 'ci_reporter',          '1.5.1' if spec.platform.to_s == 'java'
+end
\ No newline at end of file