buildr 1.4.7-x86-mswin32 → 1.4.8-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +41 -0
- data/Rakefile +0 -6
- data/addon/buildr/bnd.rb +13 -3
- data/addon/buildr/checkstyle.rb +1 -1
- data/addon/buildr/git_auto_version.rb +33 -0
- data/addon/buildr/{gwt.rake → gwt.rb} +0 -0
- data/addon/buildr/jacoco.rb +194 -0
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +23 -16
- data/doc/_layouts/default.html +0 -2
- data/doc/contributing.textile +47 -0
- data/doc/download.textile +24 -0
- data/doc/index.textile +43 -23
- data/doc/languages.textile +65 -6
- data/doc/more_stuff.textile +12 -0
- data/doc/packaging.textile +2 -0
- data/doc/settings_profiles.textile +1 -1
- data/lib/buildr.rb +0 -4
- data/lib/buildr/core/application.rb +41 -8
- data/lib/buildr/core/build.rb +102 -1
- data/lib/buildr/core/cc.rb +14 -8
- data/lib/buildr/core/generate.rb +148 -7
- data/lib/buildr/core/util.rb +3 -3
- data/lib/buildr/ide/eclipse.rb +114 -0
- data/lib/buildr/ide/idea.rb +95 -1
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/rjb.rb +5 -4
- data/lib/buildr/packaging/artifact.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -2
- data/lib/buildr/scala.rb +1 -1
- data/lib/buildr/scala/bdd.rb +9 -2
- data/lib/buildr/scala/compiler.rb +94 -4
- data/lib/buildr/scala/doc.rb +17 -5
- data/lib/buildr/scala/tests.rb +15 -4
- data/lib/buildr/version.rb +1 -1
- data/rakelib/all-in-one.rake +50 -47
- data/rakelib/checks.rake +4 -4
- data/rakelib/doc.rake +85 -88
- data/rakelib/metrics.rake +9 -9
- data/rakelib/package.rake +13 -34
- data/rakelib/release.rake +11 -12
- data/rakelib/rspec.rake +71 -76
- data/rakelib/stage.rake +25 -51
- data/spec/addon/bnd_spec.rb +61 -7
- data/spec/core/build_spec.rb +117 -0
- data/spec/core/cc_spec.rb +36 -22
- data/spec/core/common_spec.rb +3 -2
- data/spec/core/compile_spec.rb +3 -3
- data/spec/core/generate_from_eclipse_spec.rb +280 -0
- data/spec/java/bdd_spec.rb +2 -2
- data/spec/java/packaging_spec.rb +2 -1
- data/spec/packaging/archive_spec.rb +25 -2
- data/spec/packaging/artifact_spec.rb +2 -2
- data/spec/sandbox.rb +3 -2
- data/spec/scala/compiler_spec.rb +41 -0
- data/spec/scala/doc_spec.rb +22 -3
- data/spec/scala/scala.rb +2 -2
- data/spec/scala/tests_spec.rb +2 -2
- metadata +223 -194
- data/addon/buildr/jdepend.rb.orig +0 -178
- data/doc/installing.textile.orig +0 -282
- data/doc/more_stuff.textile.orig +0 -1004
- data/lib/buildr/ide/eclipse/java.rb +0 -49
- data/lib/buildr/ide/eclipse/plugin.rb +0 -67
- data/lib/buildr/ide/eclipse/scala.rb +0 -64
data/rakelib/checks.rake
CHANGED
@@ -14,9 +14,9 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
desc
|
18
|
-
task
|
19
|
-
puts
|
17
|
+
desc 'Check that source files contain the Apache license'
|
18
|
+
task 'license' => FileList['{addond,lib,doc,rakelib}/**/*.{rb,rake,java}', 'buildr.gemspec', 'Rakefile'] do |task|
|
19
|
+
puts 'Checking that files contain the Apache license ... '
|
20
20
|
required = task.prerequisites.select { |fn| File.file?(fn) }
|
21
21
|
missing = required.reject { |fn|
|
22
22
|
comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|^-#\s+(.*?)$|<!--(.*?)-->/m).
|
@@ -24,5 +24,5 @@ task :license=>FileList["**/*.{rb,rake,java,gemspec,buildfile}", 'Rakefile'] do
|
|
24
24
|
comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
|
25
25
|
}
|
26
26
|
fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
|
27
|
-
puts
|
27
|
+
puts '[x] Source files contain the Apache license'
|
28
28
|
end
|
data/rakelib/doc.rake
CHANGED
@@ -13,111 +13,108 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
|
-
gem 'rdoc'
|
18
|
-
require 'rdoc/task'
|
19
|
-
desc "Creates a symlink to rake's lib directory to support combined rdoc generation"
|
20
|
-
file "rake/lib" do
|
21
|
-
rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, "rake.rb") }
|
22
|
-
mkdir_p "rake"
|
23
|
-
File.symlink(rake_path, "rake/lib")
|
24
|
-
end
|
16
|
+
begin
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
18
|
+
gem 'rdoc'
|
19
|
+
require 'rdoc/task'
|
20
|
+
desc 'Creates a symlink to rake' 's lib directory to support combined rdoc generation'
|
21
|
+
file 'rake/lib' do
|
22
|
+
rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, 'rake.rb') }
|
23
|
+
mkdir_p 'rake'
|
24
|
+
File.symlink(rake_path, 'rake/lib')
|
25
|
+
end
|
33
26
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
desc 'Generate RDoc documentation in rdoc/'
|
28
|
+
RDoc::Task.new :rdoc do |rdoc|
|
29
|
+
rdoc.rdoc_dir = 'rdoc'
|
30
|
+
rdoc.title = spec.name
|
31
|
+
rdoc.options = spec.rdoc_options.clone
|
32
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
33
|
+
rdoc.rdoc_files.include spec.extra_rdoc_files
|
38
34
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
output = "<ol class=\"toc\">"
|
44
|
-
input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).each do |entry|
|
45
|
-
id = (entry[1][/^id=(['"])(.*)\1$/, 2] rescue nil)
|
46
|
-
title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
|
47
|
-
if id
|
48
|
-
output << %{<li><a href="##{id}">#{title}</a></li>}
|
49
|
-
else
|
50
|
-
output << %{<li>#{title}</li>}
|
51
|
-
end
|
52
|
-
end
|
53
|
-
output << "</ol>"
|
54
|
-
output
|
55
|
-
end
|
56
|
-
end
|
57
|
-
Liquid::Template.register_filter(TocFilter)
|
35
|
+
# include rake source for better inheritance rdoc
|
36
|
+
rdoc.rdoc_files.include('rake/lib/**.rb')
|
37
|
+
end
|
38
|
+
task 'rdoc' => %w(rake/lib)
|
58
39
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
40
|
+
require 'jekylltask'
|
41
|
+
module TocFilter
|
42
|
+
def toc(input)
|
43
|
+
output = "<ol class=\"toc\">"
|
44
|
+
input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).each do |entry|
|
45
|
+
id = (entry[1][/^id=(['"])(.*)\1$/, 2] rescue nil)
|
46
|
+
title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
|
47
|
+
if id
|
48
|
+
output << %{<li><a href="##{id}">#{title}</a></li>}
|
49
|
+
else
|
50
|
+
output << %{<li>#{title}</li>}
|
51
|
+
end
|
63
52
|
end
|
64
|
-
|
65
|
-
|
66
|
-
puts "Buildr uses the jekyll gem to generate the Web site. You can install it by running bundler"
|
53
|
+
output << '</ol>'
|
54
|
+
output
|
67
55
|
end
|
56
|
+
end
|
57
|
+
Liquid::Template.register_filter(TocFilter)
|
68
58
|
|
69
|
-
|
70
|
-
|
71
|
-
|
59
|
+
desc 'Generate Buildr documentation in _site/'
|
60
|
+
JekyllTask.new 'jekyll' do |task|
|
61
|
+
task.source = 'doc'
|
62
|
+
task.target = '_site'
|
63
|
+
end
|
72
64
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
65
|
+
if 0 == system('pygmentize -V > /dev/null 2> /dev/null')
|
66
|
+
puts 'Buildr uses the Pygments python library. You can install it by running ' 'sudo easy_install Pygments' ' or ' 'sudo apt-get install python-pygments' ''
|
67
|
+
end
|
68
|
+
|
69
|
+
desc 'Generate Buildr documentation as buildr.pdf'
|
70
|
+
file 'buildr.pdf' => '_site' do |task|
|
71
|
+
pages = File.read('_site/preface.html').scan(/<li><a href=['"]([^'"]+)/).flatten.map { |f| "_site/#{f}" }
|
72
|
+
sh 'prince', '--input=html', '--no-network', '--log=prince_errors.log', "--output=#{task.name}", '_site/preface.html', *pages
|
73
|
+
end
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
cp 'CHANGELOG', '_site'
|
87
|
-
open("_site/.htaccess", "w") do |htaccess|
|
88
|
-
htaccess << %Q{
|
75
|
+
desc 'Build a copy of the Web site in the ./_site'
|
76
|
+
task 'site' => ['_site', :rdoc, 'buildr.pdf'] do
|
77
|
+
cp_r 'rdoc', '_site'
|
78
|
+
fail 'No RDocs in site directory' unless File.exist?('_site/rdoc/Buildr.html')
|
79
|
+
cp 'CHANGELOG', '_site'
|
80
|
+
open('_site/.htaccess', 'w') do |htaccess|
|
81
|
+
htaccess << %Q{
|
89
82
|
<FilesMatch "CHANGELOG">
|
90
83
|
ForceType 'text/plain; charset=UTF-8'
|
91
84
|
</FilesMatch>
|
92
85
|
}
|
93
|
-
end
|
94
|
-
cp 'buildr.pdf', '_site'
|
95
|
-
fail 'No PDF in site directory' unless File.exist?('_site/buildr.pdf')
|
96
|
-
puts 'OK'
|
97
86
|
end
|
87
|
+
cp 'buildr.pdf', '_site'
|
88
|
+
fail 'No PDF in site directory' unless File.exist?('_site/buildr.pdf')
|
89
|
+
puts 'OK'
|
90
|
+
end
|
98
91
|
|
99
92
|
# Publish prerequisites to Web site.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
93
|
+
task 'publish' => 'site' do
|
94
|
+
target = "people.apache.org:/www/#{spec.name}.apache.org/"
|
95
|
+
puts "Uploading new site to #{target} ..."
|
96
|
+
sh 'rsync', '--progress', '--recursive', '--delete', '_site/', target
|
97
|
+
sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
|
98
|
+
puts 'Done'
|
99
|
+
end
|
107
100
|
|
108
101
|
# Update HTML + PDF documentation (but not entire site; no specs, coverage, etc.)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
102
|
+
task 'publish-doc' => %w(buildr.pdf _site) do
|
103
|
+
cp 'buildr.pdf', '_site'
|
104
|
+
target = "people.apache.org:/www/#{spec.name}.apache.org/"
|
105
|
+
puts "Uploading new site to #{target} ..."
|
106
|
+
sh 'rsync', '--progress', '--recursive', '_site/', target # Note: no --delete
|
107
|
+
sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
|
108
|
+
puts 'Done'
|
109
|
+
end
|
117
110
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
end
|
111
|
+
task 'clobber' do
|
112
|
+
rm_rf '_site'
|
113
|
+
rm_f 'buildr.pdf'
|
114
|
+
rm_f 'prince_errors.log'
|
123
115
|
end
|
116
|
+
|
117
|
+
rescue Exception => e
|
118
|
+
# The doc tasks do not work on our CI infrastructure with jruby as the native libraries
|
119
|
+
# are not compatible with version of the C++ library we are running there
|
120
|
+
end
|
data/rakelib/metrics.rake
CHANGED
@@ -13,15 +13,15 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
namespace
|
16
|
+
namespace 'metrics' do
|
17
17
|
desc 'run Saikuro reports'
|
18
|
-
task
|
18
|
+
task 'saikuro' do
|
19
19
|
gem 'atoulme-Saikuro'
|
20
20
|
require 'saikuro'
|
21
|
-
output_dir = File.expand_path(File.join(File.dirname(__FILE__),
|
22
|
-
base_dir = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__),
|
23
|
-
rb_files =
|
24
|
-
FileList[File.expand_path(File.join(File.dirname(__FILE__),
|
21
|
+
output_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '_reports', 'saikuro'))
|
22
|
+
base_dir = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..')))
|
23
|
+
rb_files = %w(lib addon).collect { |folder|
|
24
|
+
FileList[File.expand_path(File.join(File.dirname(__FILE__), '..', folder, '**', '*.rb'))]
|
25
25
|
}.flatten.collect {|path|
|
26
26
|
Pathname.new(path).relative_path_from(base_dir).to_s
|
27
27
|
}
|
@@ -29,11 +29,11 @@ namespace :metrics do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
desc 'generate ccn treemap'
|
32
|
-
task
|
32
|
+
task 'ccn_treemap' do
|
33
33
|
require 'saikuro_treemap'
|
34
|
-
SaikuroTreemap.generate_treemap :code_dirs =>
|
34
|
+
SaikuroTreemap.generate_treemap :code_dirs => %w(lib addon), :output_file => '_reports/saikuro_treemap.html'
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
desc 'Run all metrics tools'
|
39
|
-
task
|
39
|
+
task 'metrics' => %w(metrics:saikuro metrics:ccn_treemap)
|
data/rakelib/package.rake
CHANGED
@@ -13,43 +13,22 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
16
|
require 'rubygems/package_task'
|
18
17
|
|
19
|
-
|
20
18
|
package = Gem::PackageTask.new(spec) do |pkg|
|
21
19
|
pkg.need_tar = true
|
22
20
|
pkg.need_zip = true
|
23
21
|
end
|
24
22
|
|
25
|
-
desc
|
26
|
-
task
|
27
|
-
|
28
|
-
args = RbConfig::CONFIG['ruby_install_name'], '-S', 'gem', 'install', "#{package.package_dir}/#{package.gem_spec.file_name}"
|
29
|
-
args.unshift('sudo') if sudo_needed?
|
30
|
-
sh *args
|
31
|
-
puts "[x] Installed Buildr #{spec.version}"
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "Uninstall previous rake install"
|
35
|
-
task :uninstall do |task|
|
36
|
-
puts "Uninstalling #{spec.name} ... "
|
37
|
-
args = RbConfig::CONFIG['ruby_install_name'], '-S', 'gem', 'uninstall', spec.name, '--version', spec.version.to_s
|
38
|
-
args.unshift('sudo') if sudo_needed?
|
39
|
-
sh *args
|
40
|
-
puts "[x] Uninstalled Buildr #{spec.version}"
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
desc "Compile Java libraries used by Buildr"
|
45
|
-
task :compile do
|
46
|
-
puts "Compiling Java libraries ..."
|
23
|
+
desc 'Compile Java libraries used by Buildr'
|
24
|
+
task 'compile' do
|
25
|
+
puts 'Compiling Java libraries ...'
|
47
26
|
args = RbConfig::CONFIG['ruby_install_name'], File.expand_path(RUBY_PLATFORM[/java/] ? '_jbuildr' : '_buildr'), '--buildfile', 'buildr.buildfile', 'compile'
|
48
27
|
args << '--trace' if Rake.application.options.trace
|
49
28
|
sh *args
|
50
29
|
end
|
51
|
-
file Gem::PackageTask.new(spec).package_dir =>
|
52
|
-
file Gem::PackageTask.new(spec).package_dir_path =>
|
30
|
+
file Gem::PackageTask.new(spec).package_dir => 'compile'
|
31
|
+
file Gem::PackageTask.new(spec).package_dir_path => 'compile'
|
53
32
|
|
54
33
|
# We also need the other packages (JRuby if building on Ruby, and vice versa)
|
55
34
|
# Must call new with block, even if block does nothing, otherwise bad things happen.
|
@@ -57,17 +36,17 @@ file Gem::PackageTask.new(spec).package_dir_path => :compile
|
|
57
36
|
Gem::PackageTask.new(s) { |task| }
|
58
37
|
end
|
59
38
|
|
60
|
-
|
61
|
-
|
62
|
-
task :snapshot=>[:package] do
|
39
|
+
desc 'Upload snapshot packages over to people.apache.org'
|
40
|
+
task 'snapshot' => %w(package) do
|
63
41
|
rm_rf '_snapshot' # Always start with empty directory
|
64
|
-
puts
|
42
|
+
puts 'Copying existing gems from Apache'
|
65
43
|
sh 'rsync', '--progress', '--recursive', 'people.apache.org:public_html/buildr/snapshot/', '_snapshot/'
|
66
|
-
puts
|
44
|
+
puts 'Copying new gems over'
|
67
45
|
cp FileList['pkg/{*.gem,*.tgz,*.zip}'], '_snapshot/gems'
|
68
|
-
puts
|
46
|
+
puts 'Generating gem index ...'
|
69
47
|
sh 'gem', 'generate_index', '--directory', '_snapshot'
|
70
|
-
puts
|
48
|
+
puts 'Copying gem and index back to Apache'
|
71
49
|
sh 'rsync', '--progress', '--recursive', '_snapshot/', 'people.apache.org:public_html/buildr/snapshot/'
|
72
50
|
end
|
73
|
-
task(
|
51
|
+
task('clobber') { rm_rf 'target' }
|
52
|
+
task('clobber') { rm_rf '_snapshot' }
|
data/rakelib/release.rake
CHANGED
@@ -14,26 +14,26 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
task
|
17
|
+
task 'release' do
|
18
18
|
# First, we need to get all the staged files from Apache to _release.
|
19
19
|
mkpath '_release'
|
20
20
|
lambda do
|
21
21
|
url = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}"
|
22
22
|
puts "Populating _release directory from #{url} ..."
|
23
23
|
sh 'rsync', '--progress', '--recursive', url, '_release'
|
24
|
-
puts
|
24
|
+
puts '[X] Staged files are now in _release'
|
25
25
|
end.call
|
26
26
|
|
27
27
|
|
28
28
|
# Upload binary and source packages and new Web site
|
29
29
|
lambda do
|
30
30
|
target = "people.apache.org:/www/www.apache.org/dist/#{spec.name}/#{spec.version}"
|
31
|
-
puts
|
31
|
+
puts 'Uploading packages to www.apache.org/dist ...'
|
32
32
|
host, remote_dir = target.split(':')
|
33
33
|
sh 'ssh', host, 'rm', '-rf', remote_dir rescue nil
|
34
34
|
sh 'ssh', host, 'mkdir', remote_dir
|
35
35
|
sh 'rsync', '--progress', '--recursive', "_release/#{spec.version}/dist/", target
|
36
|
-
puts
|
36
|
+
puts '[X] Uploaded packages to www.apache.org/dist'
|
37
37
|
|
38
38
|
target = "people.apache.org:/www/#{spec.name}.apache.org/"
|
39
39
|
puts "Uploading new site to #{spec.name}.apache.org ..."
|
@@ -54,7 +54,7 @@ task :release do
|
|
54
54
|
rubyforge.userconfig.merge!('release_changes'=>"_release/#{spec.version}/CHANGES", 'preformatted' => true)
|
55
55
|
rubyforge.add_release spec.rubyforge_project.downcase, spec.name.downcase, spec.version.to_s, *files
|
56
56
|
|
57
|
-
puts
|
57
|
+
puts 'Posting news to RubyForge ...'
|
58
58
|
changes = File.read("_release/#{spec.version}/CHANGES")[/.*?\n(.*)/m, 1]
|
59
59
|
rubyforge.post_news spec.rubyforge_project.downcase, "Buildr #{spec.version} released",
|
60
60
|
"#{spec.description}\n\nNew in Buildr #{spec.version}:\n#{changes.gsub(/^/, ' ')}\n"
|
@@ -68,8 +68,8 @@ task :release do
|
|
68
68
|
puts "Push gem #{f} to RubyForge.org / Gemcutter ... "
|
69
69
|
`gem push #{f}`
|
70
70
|
end
|
71
|
-
puts
|
72
|
-
end
|
71
|
+
puts '[X] Pushed gems to Rubyforge.org / Gemcutter'
|
72
|
+
end.call
|
73
73
|
|
74
74
|
# Create an SVN tag for this release.
|
75
75
|
lambda do
|
@@ -81,7 +81,7 @@ task :release do
|
|
81
81
|
if ok
|
82
82
|
puts "[X] Tagged this release as tags/#{spec.version} ... "
|
83
83
|
else
|
84
|
-
puts
|
84
|
+
puts 'Could not create tag, please do it yourself!'
|
85
85
|
puts %{ svn copy #{url} #{new_url} -m "Release #{spec.version}"}
|
86
86
|
end
|
87
87
|
end
|
@@ -98,7 +98,7 @@ task :release do
|
|
98
98
|
File.open 'CHANGELOG', 'w' do |file|
|
99
99
|
file.write modified
|
100
100
|
end
|
101
|
-
puts
|
101
|
+
puts '[X] Updated CHANGELOG and added entry for next release'
|
102
102
|
end.call
|
103
103
|
|
104
104
|
|
@@ -150,11 +150,10 @@ The Apache Buildr Team
|
|
150
150
|
File.open 'announce-email.txt', 'w' do |file|
|
151
151
|
file.write email
|
152
152
|
end
|
153
|
-
puts
|
153
|
+
puts '[X] Created release announce email template in ''announce-email.txt'''
|
154
154
|
puts email
|
155
155
|
end
|
156
156
|
|
157
157
|
end
|
158
158
|
|
159
|
-
|
160
|
-
task(:clobber) { rm_rf '_release' }
|
159
|
+
task('clobber') { rm_rf '_release' }
|
data/rakelib/rspec.rake
CHANGED
@@ -13,96 +13,91 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
directory '_reports'
|
16
|
+
require 'rspec/core/rake_task'
|
17
|
+
directory '_reports'
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
def default_spec_opts
|
20
|
+
default = %w{--format documentation --out _reports/specs.txt --backtrace}
|
21
|
+
default << '--colour' if $stdout.isatty && !(RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos/i)
|
22
|
+
default
|
23
|
+
end
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
# RSpec doesn't support file exclusion, so hack our own.
|
26
|
+
class RSpec::Core::RakeTask
|
27
|
+
attr_accessor :rspec_files
|
29
28
|
private
|
30
|
-
|
31
|
-
|
32
|
-
end
|
29
|
+
def files_to_run
|
30
|
+
@rspec_files
|
33
31
|
end
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
34
|
+
desc 'Run all specs'
|
35
|
+
RSpec::Core::RakeTask.new :spec => ['_reports', :compile] do |task|
|
36
|
+
ENV['USE_FSC'] = 'no'
|
37
|
+
task.rspec_files = FileList['spec/**/*_spec.rb']
|
38
|
+
task.rspec_files.exclude('spec/groovy/*') if RUBY_PLATFORM[/java/]
|
39
|
+
task.rspec_opts = default_spec_opts
|
40
|
+
task.rspec_opts = %w{--format html --out _reports/specs.html --backtrace}
|
41
|
+
end
|
42
|
+
file('_reports/specs.html') { task(:spec).invoke }
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
44
|
+
desc 'Run RSpec and generate Spec and coverage reports (slow)'
|
45
|
+
RSpec::Core::RakeTask.new :coverage => ['_reports', :compile] do |task|
|
46
|
+
ENV['USE_FSC'] = 'no'
|
47
|
+
task.rspec_files = FileList['spec/**/*_spec.rb']
|
48
|
+
task.rspec_files.exclude('spec/groovy/*') if RUBY_PLATFORM[/java/]
|
49
|
+
task.rspec_opts = default_spec_opts
|
50
|
+
task.rcov = true
|
51
|
+
task.rcov_opts = %w{-o _reports/coverage --exclude / --include-file ^lib --text-summary}
|
52
|
+
end
|
53
|
+
file('_reports/coverage') { task(:coverage).invoke }
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
55
|
+
task :load_ci_reporter do
|
56
|
+
gem 'ci_reporter'
|
57
|
+
ENV['CI_REPORTS'] = '_reports/ci'
|
58
|
+
# CI_Reporter does not quote the path to rspec_loader which causes problems when ruby is installed in C:/Program Files.
|
59
|
+
# However, newer versions of rspec don't like double quotes escaping as well, so removing them for now.
|
60
|
+
ci_rep_path = Gem.loaded_specs['ci_reporter'].full_gem_path
|
61
|
+
ENV['SPEC_OPTS'] = [ENV['SPEC_OPTS'], default_spec_opts, '--require', "#{ci_rep_path}/lib/ci/reporter/rake/rspec_loader.rb", '--format', 'CI::Reporter::RSpec'].join(" ")
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
64
|
+
desc 'Run all specs with CI reporter'
|
65
|
+
task 'ci' => %w(clobber load_ci_reporter spec)
|
67
66
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
67
|
+
def rvm_run_in(version, command)
|
68
|
+
if !(RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos/i)
|
69
|
+
cmd_prefix = "rvm #{version} exec"
|
70
|
+
sh "rm -f Gemfile.lock; #{cmd_prefix} bundle install; #{cmd_prefix} bundle exec #{command}"
|
71
|
+
else
|
72
|
+
sh "#{version =~ /jruby/ ? "j" : ""}ruby -S #{command}"
|
75
73
|
end
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
desc "Run all specs specifically with Ruby 1.8"
|
86
|
-
task :ruby_1_8 do
|
87
|
-
puts "Running test suite using Ruby ..."
|
88
|
-
rvm_run_in("ruby-1.8.7-p358@buildr", "rake spec")
|
89
|
-
end
|
90
|
-
|
91
|
-
desc "Run all specs specifically with JRuby"
|
92
|
-
task :jruby do
|
93
|
-
puts "Running test suite using JRuby ..."
|
94
|
-
rvm_run_in("jruby-1.6.7@buildr", "rake spec")
|
95
|
-
end
|
76
|
+
# Useful for testing with JRuby when using Ruby and vice versa.
|
77
|
+
namespace 'spec' do
|
78
|
+
desc 'Run all specs specifically with Ruby 1.9'
|
79
|
+
task 'ruby_1_9' do
|
80
|
+
puts 'Running test suite using Ruby ...'
|
81
|
+
rvm_run_in('ruby-1.9.2-p320@buildr', 'rake spec')
|
82
|
+
end
|
96
83
|
|
97
|
-
|
98
|
-
|
84
|
+
desc 'Run all specs specifically with Ruby 1.8'
|
85
|
+
task 'ruby_1_8' do
|
86
|
+
puts 'Running test suite using Ruby ...'
|
87
|
+
rvm_run_in('ruby-1.8.7-p358@buildr', 'rake spec')
|
99
88
|
end
|
100
89
|
|
101
|
-
|
102
|
-
|
103
|
-
|
90
|
+
desc 'Run all specs specifically with JRuby'
|
91
|
+
task 'jruby' do
|
92
|
+
puts 'Running test suite using JRuby ...'
|
93
|
+
rvm_run_in('jruby-1.6.7@buildr', 'rake spec')
|
104
94
|
end
|
105
95
|
|
106
|
-
|
107
|
-
|
96
|
+
desc 'Run all specs across various rubies'
|
97
|
+
task 'all' => %w(jruby ruby_1_8 ruby_1_9)
|
98
|
+
end
|
99
|
+
|
100
|
+
task 'clobber' do
|
101
|
+
rm_f 'failed'
|
102
|
+
rm_rf '_reports'
|
108
103
|
end
|