0
# Packaging and local installation.
0
ruby_spec = specify(Gem::Platform::RUBY)
0
+ruby_package = Rake::GemPackageTask.new(ruby_spec) { |pkg| pkg.need_tar = pkg.need_zip = true }
0
jruby_spec = specify('java')
0
-ruby_package = Rake::GemPackageTask.new(ruby_spec) do |pkg|
0
-jruby_package = Rake::GemPackageTask.new(jruby_spec) do |pkg|
0
+jruby_package = Rake::GemPackageTask.new(jruby_spec) { |pkg| pkg.need_tar = pkg.need_zip = false }
0
desc 'Install the package locally'
0
task :install=>:package do |task|
0
task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing'
0
-desc 'Run all failing examples
'
0
+desc 'Run all failing examples
from previous run'
0
Spec::Rake::SpecTask.new('failing') do |task|
0
task.spec_files = FileList['spec/**/*_spec.rb']
0
task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' << '--example' << 'failing'
0
-desc 'Run all specs and generate reports in html directory'
0
-Spec::Rake::SpecTask.new('spec:report') do |task|
0
- task.spec_files = FileList['spec/**/*_spec.rb']
0
- task.spec_opts << '--format' << 'html:html/report.html' << '--backtrace'
0
- task.rcov_dir = 'html/coverage'
0
- task.rcov_opts = ['--exclude', 'spec,bin']
0
- system 'jruby -S rake spec'
0
+ desc 'Run all specs and generate test/coverage reports in html directory'
0
+ Spec::Rake::SpecTask.new('report') do |task|
0
+ task.spec_files = FileList['spec/**/*_spec.rb']
0
+ task.spec_opts << '--format' << 'html:html/report.html' << '--backtrace'
0
+ task.rcov_dir = 'html/coverage'
0
+ task.rcov_opts = ['--exclude', 'spec,bin']
0
+ desc 'Run all specs specifically with Ruby'
0
+ task('ruby') { system 'ruby -S rake spec' }
0
+ desc 'Run all specs specifically with JRuby'
0
+ task('jruby') { system 'jruby -S rake spec' }
0
:template => Docter.template('doc/print.haml').include('doc/css', 'doc/images')
0
- Docter.filter_for(:footnote) do |html|
0
- html.gsub(/<p id="fn(\d+)">(.*?)<\/p>/, %{<p id="fn\\1" class="footnote">\\2</p>})
0
+ #Docter.filter_for(:footnote) do |html|
0
+ # html.gsub(/<p id="fn(\d+)">(.*?)<\/p>/, %{<p id="fn\\1" class="footnote">\\2</p>})
0
desc 'Generate HTML documentation'
0
html = Docter::Rake.generate('html', web_docs[:collection], web_docs[:template])
0
desc 'Run Docter server'
0
- Docter::Rake.serve
:docter, web_docs[:collection], web_docs[:template], :port=>3000
0
+ Docter::Rake.serve
'docter', web_docs[:collection], web_docs[:template], :port=>3000
0
task('docs').enhance [html]
0
task('clobber') { rm_rf html.to_s }
0
# - Create MD5/SHA1/PGP signatures
0
# - Upload to people.apache.org:/www/www.apache.org/dist/incubator/buildr
0
+ task 'prepare'=>'clobber'
0
+ # Check that all source files have licenses.
0
+ puts 'Checking that files contain the Apache license'
0
+ directories = 'lib', 'spec', 'docs', 'bin'
0
+ ignore = 'class', 'opts'
0
+ FileList['lib/**/*', 'spec/**/*', 'bin/**', 'doc/css/*', 'doc/scripts/*'].
0
+ exclude('doc/css/eiffel.css').reject { |file| File.directory?(file) || ignore.include?(file[/[^.]*$/]) }.each do |file|
0
+ comments = File.read(file).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|<!--(.*?)-->/m).
0
+ map { |match| match.reject(&:nil?) }.flatten.join("\n")
0
+ fail "File #{file} missing Apache License, please add it before making a release!" unless
0
+ comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
0
+ # Compile Java libraries.
0
+ task 'prepare'=>'compile' do
0
+ FileList['lib/**/*.java'].each { |src| fail "Can't find .class file for #{src}!" unless File.exist?(src.ext('class')) }
0
+ # Make sure we have RDoc template, Docter and PDF genereation.
0
+ task 'prepare'=>[rdoc.template, pdf] do
0
+ fail 'Release requires the Allison RDoc template, please gem install allison!' unless rdoc.template =~ /allison.rb/
0
+ fail 'No PDF generated, you need to install PrinceXML!' unless File.exist?('html/buildr.pdf')
0
+ # Run specs on Ruby and JRuby, make sure we generate test/coverage reports.
0
+ task 'prepare'=>['spec:jruby', 'spec:report'] do
0
+ fail 'No test reports in html directory!' unless File.exist?('html/report.html')
0
+ fail 'No coverage reports in html directory!' unless File.exist?('html/coverage/index.html')