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/27 02:46:37 UTC

svn commit: r689304 - in /incubator/buildr/trunk: KEYS Rakefile _buildr buildr.gemspec etc/KEYS rakelib/apache.rake rakelib/rspec.rake spec/spec.opts

Author: assaf
Date: Tue Aug 26 17:46:36 2008
New Revision: 689304

URL: http://svn.apache.org/viewvc?rev=689304&view=rev
Log:
All source files are now included in Gem.
Moved KEYS file to etc/KEYS.
Checking license on more files, including HAML templates.
Removed spec.opts.

Added:
    incubator/buildr/trunk/etc/KEYS
      - copied, changed from r689269, incubator/buildr/trunk/KEYS
Removed:
    incubator/buildr/trunk/KEYS
    incubator/buildr/trunk/spec/spec.opts
Modified:
    incubator/buildr/trunk/Rakefile
    incubator/buildr/trunk/_buildr
    incubator/buildr/trunk/buildr.gemspec
    incubator/buildr/trunk/rakelib/apache.rake
    incubator/buildr/trunk/rakelib/rspec.rake

Modified: incubator/buildr/trunk/Rakefile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/Rakefile?rev=689304&r1=689303&r2=689304&view=diff
==============================================================================
--- incubator/buildr/trunk/Rakefile (original)
+++ incubator/buildr/trunk/Rakefile Tue Aug 26 17:46:36 2008
@@ -40,8 +40,10 @@
 ENV['incubating'] = 'true'
 ENV['staging'] = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}"
 
-task 'apache:license'=>spec.files
-#task('apache:license').prerequisites.exclude( ..not ASL.. )
+task('apache.license').prerequisites.include(spec.files).
+  exclude('.class', '.png', '.jar', '.tif', '.textile', '.icns',
+           'README', 'LICENSE', 'CHANGELOG', 'DISCLAIMER', 'NOTICE', 'etc/KEYS', 'etc/git-svn-authors')
+
 
 task 'spec:check' do
   print 'Checking that we have JRuby, Scala and Groovy available ... '

Modified: incubator/buildr/trunk/_buildr
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/_buildr?rev=689304&r1=689303&r2=689304&view=diff
==============================================================================
--- incubator/buildr/trunk/_buildr (original)
+++ incubator/buildr/trunk/_buildr Tue Aug 26 17:46:36 2008
@@ -1,4 +1,19 @@
 #!/usr/bin/env 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.
+
 
 # Run buildr from source, specifically for testing stuff without doing a rake install.
 # The _BUILDR_RB environment variable can be used to set the path to the ruby/jruby executable.
@@ -6,12 +21,12 @@
 #   export _BUILDR_RB=/path/to/jruby
 
 buildr_root = File.dirname(__FILE__)
-buildr_ruby = ENV['_BUILDR_RB'] || "ruby"
+buildr_ruby = ENV['_BUILDR_RB'] || 'ruby'
 cmd = [
     buildr_ruby,
-    "-I"+File.join(buildr_root, "lib"),
-    "-I"+File.join(buildr_root, "addon"),
-    File.join(buildr_root, "bin", "buildr"),
+    "-I"+File.join(buildr_root, 'lib'),
+    "-I"+File.join(buildr_root, 'addon'),
+    File.join(buildr_root, 'bin', 'buildr'),
 ] + ARGV
 
 exec *cmd

Modified: incubator/buildr/trunk/buildr.gemspec
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/buildr.gemspec?rev=689304&r1=689303&r2=689304&view=diff
==============================================================================
--- incubator/buildr/trunk/buildr.gemspec (original)
+++ incubator/buildr/trunk/buildr.gemspec Tue Aug 26 17:46:36 2008
@@ -26,8 +26,10 @@
   # 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.files          = Dir['lib/**/*', 'bin/**/*', 'addon/**/*', 'doc/**/*', 'spec/**/*',
+                            'README.rdoc', 'LICENSE', 'NOTICE', 'DISCLAIMER', 'CHANGELOG',
+                            'buildr.*', 'Rakefile', 'rakelib/**/*', '_buildr', 'etc/**/*']
   spec.require_paths  = ['lib', 'addon']
   spec.bindir         = 'bin'                               # Use these for applications.
   spec.executable     = 'buildr'

Copied: incubator/buildr/trunk/etc/KEYS (from r689269, incubator/buildr/trunk/KEYS)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/etc/KEYS?p2=incubator/buildr/trunk/etc/KEYS&p1=incubator/buildr/trunk/KEYS&r1=689269&r2=689304&rev=689304&view=diff
==============================================================================
    (empty)

Modified: incubator/buildr/trunk/rakelib/apache.rake
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/rakelib/apache.rake?rev=689304&r1=689303&r2=689304&view=diff
==============================================================================
--- incubator/buildr/trunk/rakelib/apache.rake (original)
+++ incubator/buildr/trunk/rakelib/apache.rake Tue Aug 26 17:46:36 2008
@@ -40,15 +40,13 @@
     print 'Checking that files contain the Apache license ... '
     required = task.prerequisites.select { |fn| File.file?(fn) }
     missing = required.reject { |fn| 
-      comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|<!--(.*?)-->/m).
+      comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|^-#\s+(.*?)$|<!--(.*?)-->/m).
         map { |match| match.compact }.flatten.join("\n")
       comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
     }
     fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
     puts 'OK'
   end
-  task('license').prerequisites.exclude('.class', '.png', '.jar', '.tif', '.textile', '.haml',
-    'README', 'LICENSE', 'CHANGELOG', 'DISCLAIMER', 'NOTICE', 'KEYS', 'spec/spec.opts')
 
   task 'check' do
     ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
@@ -63,7 +61,7 @@
     end
   end
 
-  task 'sign'=>['KEYS', 'staged/distro'] do
+  task 'sign'=>['etc/KEYS', 'staged/distro'] do
     gpg_user = ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
     FileList['staged/distro/*.{gem,zip,tgz}'].each do |pkg|
       bytes = File.open(pkg, 'rb') { |file| file.read }
@@ -71,7 +69,7 @@
       File.open(pkg + '.sha1', 'w') { |file| file.write SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
       sh 'gpg', '--local-user', gpg_user, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
     end
-    cp 'KEYS', 'staged/distro'
+    cp 'etc/KEYS', 'staged/distro'
   end
 
   # Publish prerequisites to distro server.
@@ -110,34 +108,6 @@
     puts 'Done'
   end
 
-=begin
-  task 'distro-links'=>['staged/site', 'apache:sign'] do |task, args|
-    rows = FileList['staged/distro/*.{gem,tgz,zip}'].map { |pkg|
-      name, md5 = File.basename(pkg), File.read("#{pkg}.md5").split.first
-      <<-HTML
-      <tr>
-        <td><a href="#{url}/#{name}">#{name}</a></td>
-        <td><a href="#{url}/#{name}.md5">#{md5}</a></td>
-        <td><a href="#{url}/#{name}.asc">Sig</a></td>
-      </tr>
-      HTML
-    }
-    html = <<-HTML
-    <h3>#{spec.name} #{spec.version}#{args.incubating && "-incubating"} (#{Time.now.strftime('%Y-%m-%d')})</h3>
-    <table>
-      <thead><th>Package</th><th>MD5 Checksum</th><th>PGP</th></thead>
-    #{rows.join("\n")}
-    </table>
-    <p style="text-align:right"> (<a href="#{url}/KEYS">Release signing keys</a>)</p>
-    HTML
-    file_name = 'staged/site/download.html'
-    modified = File.read(file_name).sub(/<h2.*binaries.*source.*<\/h2>.*/i) { |header| "#{header}\n#{html}\n" }
-    File.open file_name, 'w' do |file|
-      file.write modified
-    end
-  end
-=end
-
   file 'staged/site'=>['distro-links', 'staged', 'site'] do
     rm_rf 'staged/site'
     cp_r 'site', 'staged'

Modified: incubator/buildr/trunk/rakelib/rspec.rake
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/rakelib/rspec.rake?rev=689304&r1=689303&r2=689304&view=diff
==============================================================================
--- incubator/buildr/trunk/rakelib/rspec.rake (original)
+++ incubator/buildr/trunk/rakelib/rspec.rake Tue Aug 26 17:46:36 2008
@@ -25,26 +25,25 @@
 
   desc 'Run all specs'
   Spec::Rake::SpecTask.new('spec'=>'reports') do |task|
-    task.spec_files = FileList['spec/**/*_spec.rb']
-    task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failed' <<
-      '--format' << 'html:reports/specs.html' << '--backtrace'
+    task.spec_files = Dir['spec/**/*_spec.rb']
+    task.spec_opts = %w{--format specdoc --colour --format failing_examples:failed --format html:reports/specs.html --loadby mtime --backtrace}    
   end
   file 'reports/specs.html'=>'spec'
 
   desc 'Run all failed examples from previous run'
   Spec::Rake::SpecTask.new('failed') do |task|
-    task.spec_files = FileList['spec/**/*_spec.rb']
-    task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failed' << '--example' << 'failed'
+    task.spec_files = Dir['spec/**/*_spec.rb']
+    task.spec_opts = %w{--format specdoc --colour --format failing_examples:failed --example failed --backtrace}    
   end
 
   # TODO: Horribly broken!  Fix some other time.
   desc 'Run RSpec and generate Spec and coverage reports (slow)'
   Spec::Rake::SpecTask.new('rcov') do |task|
-    task.spec_files = FileList['spec/**/*spec.rb']
-    task.spec_opts = '--format', 'html:reports/specs.html', '--backtrace'
+    task.spec_files = Dir['spec/**/*spec.rb']
+    task.spec_opts = %W{--format progress --colour --format failing_examples:failed --format html:reports/specs.html --backtrace}    
     task.rcov = true
     task.rcov_dir = 'reports/coverage'
-    task.rcov_opts = '--exclude', "spec,bin,#{Config::CONFIG['sitedir']},#{Gem.path.join(',')}", '--text-summary'
+    task.rcov_opts = %W{--exclude spec,bin,#{Config::CONFIG['sitedir']},#{Gem.path.join(',')} --text-summary}
   end
   file 'reports/coverage'=>'rcov'
 
@@ -78,5 +77,4 @@
 
 
 task 'stage:prepare'=>'spec'
-task 'stage:prepare'=>RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby'
-# TODO:  Add Rcov when we get it working again.
+task 'stage:prepare'=>RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby' # Test the *other* platform
\ No newline at end of file