buildr 1.2.10 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +566 -268
- data/DISCLAIMER +7 -1
- data/KEYS +151 -0
- data/NOTICE +23 -8
- data/README +122 -22
- data/Rakefile +49 -229
- data/{lib → addon}/buildr/antlr.rb +23 -10
- data/addon/buildr/cobertura.rb +232 -0
- data/{lib → addon}/buildr/hibernate.rb +20 -4
- data/{lib → addon}/buildr/javacc.rb +27 -12
- data/addon/buildr/jdepend.rb +60 -0
- data/{lib → addon}/buildr/jetty.rb +34 -18
- data/addon/buildr/nailgun.rb +892 -0
- data/{lib → addon}/buildr/openjpa.rb +23 -6
- data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
- data/{lib/buildr/jetty → addon/buildr/org/apache/buildr}/JettyWrapper.java +19 -0
- data/{lib → addon}/buildr/xmlbeans.rb +39 -14
- data/bin/buildr +21 -7
- data/buildr.gemspec +50 -0
- data/doc/css/default.css +225 -0
- data/doc/css/print.css +95 -0
- data/doc/css/syntax.css +43 -0
- data/doc/images/apache-incubator-logo.png +0 -0
- data/doc/images/buildr-hires.png +0 -0
- data/doc/images/buildr.png +0 -0
- data/doc/images/note.png +0 -0
- data/doc/images/tip.png +0 -0
- data/doc/images/zbuildr.tif +0 -0
- data/doc/pages/artifacts.textile +317 -0
- data/doc/pages/building.textile +501 -0
- data/doc/pages/contributing.textile +178 -0
- data/doc/pages/download.textile +25 -0
- data/doc/pages/extending.textile +229 -0
- data/doc/pages/getting_started.textile +337 -0
- data/doc/pages/index.textile +63 -0
- data/doc/pages/mailing_lists.textile +17 -0
- data/doc/pages/more_stuff.textile +367 -0
- data/doc/pages/packaging.textile +592 -0
- data/doc/pages/projects.textile +449 -0
- data/doc/pages/recipes.textile +127 -0
- data/doc/pages/settings_profiles.textile +339 -0
- data/doc/pages/testing.textile +475 -0
- data/doc/pages/troubleshooting.textile +121 -0
- data/doc/pages/whats_new.textile +389 -0
- data/doc/print.haml +52 -0
- data/doc/print.toc.yaml +28 -0
- data/doc/scripts/buildr-git.rb +411 -0
- data/doc/scripts/install-jruby.sh +44 -0
- data/doc/scripts/install-linux.sh +64 -0
- data/doc/scripts/install-osx.sh +52 -0
- data/doc/site.haml +55 -0
- data/doc/site.toc.yaml +44 -0
- data/lib/buildr.rb +28 -45
- data/lib/buildr/core.rb +27 -0
- data/lib/buildr/core/application.rb +373 -0
- data/lib/buildr/core/application_cli.rb +134 -0
- data/lib/{core → buildr/core}/build.rb +91 -77
- data/lib/{core → buildr/core}/checks.rb +116 -95
- data/lib/buildr/core/common.rb +155 -0
- data/lib/buildr/core/compile.rb +594 -0
- data/lib/buildr/core/environment.rb +120 -0
- data/lib/buildr/core/filter.rb +258 -0
- data/lib/{core → buildr/core}/generate.rb +22 -5
- data/lib/buildr/core/help.rb +118 -0
- data/lib/buildr/core/progressbar.rb +156 -0
- data/lib/{core → buildr/core}/project.rb +468 -213
- data/lib/buildr/core/test.rb +690 -0
- data/lib/{core → buildr/core}/transports.rb +107 -127
- data/lib/buildr/core/util.rb +235 -0
- data/lib/buildr/ide.rb +19 -0
- data/lib/{java → buildr/ide}/eclipse.rb +86 -60
- data/lib/{java → buildr/ide}/idea.ipr.template +16 -0
- data/lib/buildr/ide/idea.rb +194 -0
- data/lib/buildr/ide/idea7x.ipr.template +290 -0
- data/lib/buildr/ide/idea7x.rb +210 -0
- data/lib/buildr/java.rb +26 -0
- data/lib/buildr/java/ant.rb +71 -0
- data/lib/buildr/java/bdd_frameworks.rb +267 -0
- data/lib/buildr/java/commands.rb +210 -0
- data/lib/buildr/java/compilers.rb +432 -0
- data/lib/buildr/java/deprecated.rb +141 -0
- data/lib/buildr/java/groovyc.rb +137 -0
- data/lib/buildr/java/jruby.rb +99 -0
- data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
- data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
- data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
- data/lib/buildr/java/packaging.rb +706 -0
- data/lib/{java → buildr/java}/pom.rb +20 -4
- data/lib/buildr/java/rjb.rb +142 -0
- data/lib/buildr/java/test_frameworks.rb +290 -0
- data/lib/buildr/java/version_requirement.rb +172 -0
- data/lib/buildr/packaging.rb +21 -0
- data/lib/{java → buildr/packaging}/artifact.rb +170 -179
- data/lib/buildr/packaging/artifact_namespace.rb +957 -0
- data/lib/buildr/packaging/artifact_search.rb +140 -0
- data/lib/buildr/packaging/gems.rb +102 -0
- data/lib/buildr/packaging/package.rb +233 -0
- data/lib/{tasks → buildr/packaging}/tar.rb +18 -1
- data/lib/{tasks → buildr/packaging}/zip.rb +153 -105
- data/rakelib/apache.rake +126 -0
- data/rakelib/changelog.rake +56 -0
- data/rakelib/doc.rake +103 -0
- data/rakelib/package.rake +44 -0
- data/rakelib/release.rake +53 -0
- data/rakelib/rspec.rake +81 -0
- data/rakelib/rubyforge.rake +45 -0
- data/rakelib/scm.rake +49 -0
- data/rakelib/setup.rake +59 -0
- data/rakelib/stage.rake +45 -0
- data/spec/application_spec.rb +316 -0
- data/spec/archive_spec.rb +494 -0
- data/spec/artifact_namespace_spec.rb +635 -0
- data/spec/artifact_spec.rb +738 -0
- data/spec/build_spec.rb +193 -0
- data/spec/checks_spec.rb +537 -0
- data/spec/common_spec.rb +579 -0
- data/spec/compile_spec.rb +561 -0
- data/spec/groovy_compilers_spec.rb +239 -0
- data/spec/java_bdd_frameworks_spec.rb +238 -0
- data/spec/java_compilers_spec.rb +446 -0
- data/spec/java_packaging_spec.rb +1042 -0
- data/spec/java_test_frameworks_spec.rb +414 -0
- data/spec/packaging_helper.rb +63 -0
- data/spec/packaging_spec.rb +589 -0
- data/spec/project_spec.rb +739 -0
- data/spec/sandbox.rb +116 -0
- data/spec/scala_compilers_spec.rb +239 -0
- data/spec/spec.opts +6 -0
- data/spec/spec_helpers.rb +283 -0
- data/spec/test_spec.rb +871 -0
- data/spec/transport_spec.rb +300 -0
- data/spec/version_requirement_spec.rb +115 -0
- metadata +188 -77
- data/lib/buildr/cobertura.rb +0 -89
- data/lib/buildr/jdepend.rb +0 -40
- data/lib/buildr/jetty/JettyWrapper$1.class +0 -0
- data/lib/buildr/jetty/JettyWrapper$BuildrHandler.class +0 -0
- data/lib/buildr/jetty/JettyWrapper.class +0 -0
- data/lib/buildr/scala.rb +0 -368
- data/lib/core/application.rb +0 -188
- data/lib/core/common.rb +0 -562
- data/lib/core/help.rb +0 -72
- data/lib/core/rake_ext.rb +0 -81
- data/lib/java/ant.rb +0 -71
- data/lib/java/compile.rb +0 -589
- data/lib/java/idea.rb +0 -159
- data/lib/java/java.rb +0 -432
- data/lib/java/packaging.rb +0 -581
- data/lib/java/test.rb +0 -795
- data/lib/tasks/concat.rb +0 -35
data/rakelib/apache.rake
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
require 'md5'
|
18
|
+
require 'sha1'
|
19
|
+
|
20
|
+
|
21
|
+
# Tasks specific to Apache projects (license, release, etc).
|
22
|
+
namespace 'apache' do
|
23
|
+
|
24
|
+
desc 'Check that source files contain the Apache license'
|
25
|
+
task 'license' do |task|
|
26
|
+
print 'Checking that files contain the Apache license ... '
|
27
|
+
required = task.prerequisites.select { |fn| File.file?(fn) }
|
28
|
+
missing = required.reject { |fn|
|
29
|
+
comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|<!--(.*?)-->/m).
|
30
|
+
map { |match| match.compact }.flatten.join("\n")
|
31
|
+
comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
|
32
|
+
}
|
33
|
+
fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
|
34
|
+
puts 'OK'
|
35
|
+
end
|
36
|
+
task('license').prerequisites.exclude('.class', '.png', '.jar', '.tif', '.textile', '.haml',
|
37
|
+
'README', 'LICENSE', 'CHANGELOG', 'DISCLAIMER', 'NOTICE', 'KEYS', 'spec/spec.opts')
|
38
|
+
|
39
|
+
task 'check' do
|
40
|
+
ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
file 'staged/distro'=>'package' do
|
45
|
+
puts 'Copying and signing release files ...'
|
46
|
+
mkpath 'staged/distro'
|
47
|
+
FileList['pkg/*.{gem,zip,tgz}'].each do |pkg|
|
48
|
+
cp pkg, pkg.pathmap('staged/distro/%n-incubating%x')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
task 'sign'=>['KEYS', 'staged/distro'] do
|
53
|
+
gpg_user = ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
|
54
|
+
FileList['staged/distro/*.{gem,zip,tgz}'].each do |pkg|
|
55
|
+
bytes = File.open(pkg, 'rb') { |file| file.read }
|
56
|
+
File.open(pkg + '.md5', 'w') { |file| file.write MD5.hexdigest(bytes) << ' ' << File.basename(pkg) }
|
57
|
+
File.open(pkg + '.sha1', 'w') { |file| file.write SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
|
58
|
+
sh 'gpg', '--local-user', gpg_user, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
|
59
|
+
end
|
60
|
+
cp 'KEYS', 'staged/distro'
|
61
|
+
end
|
62
|
+
|
63
|
+
# Publish prerequisites to distro server.
|
64
|
+
task 'publish:distro' do |task, args|
|
65
|
+
target = args.incubating ? "people.apache.org:/www/www.apache.org/dist/incubator/#{spec.name}/#{spec.version}-incubating" :
|
66
|
+
"people.apache.org:/www/www.apache.org/dist/#{spec.name}/#{spec.version}"
|
67
|
+
puts 'Uploading packages to Apache distro ...'
|
68
|
+
sh 'rsync', '--progress', 'published/distro/*', target
|
69
|
+
puts 'Done'
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
task 'distro-links'=>['staged/site', 'apache:sign'] do |task, args|
|
74
|
+
url = args.incubating ? "http://www.apache.org/dist/incubator/#{spec.name}/#{spec.version}-incubating" :
|
75
|
+
"http://www.apache.org/dist/#{spec.name}/#{spec.version}"
|
76
|
+
rows = FileList['staged/distro/*.{gem,tgz,zip}'].map { |pkg|
|
77
|
+
name, md5 = File.basename(pkg), File.read("#{pkg}.md5").split.first
|
78
|
+
<<-HTML
|
79
|
+
<tr>
|
80
|
+
<td><a href="#{url}/#{name}">#{name}</a></td>
|
81
|
+
<td><a href="#{url}/#{name}.md5">#{md5}</a></td>
|
82
|
+
<td><a href="#{url}/#{name}.asc">Sig</a></td>
|
83
|
+
</tr>
|
84
|
+
HTML
|
85
|
+
}
|
86
|
+
html = <<-HTML
|
87
|
+
<h3>#{spec.name} #{spec.version}#{args.incubating && "-incubating"} (#{Time.now.strftime('%Y-%m-%d')})</h3>
|
88
|
+
<table>
|
89
|
+
<thead><th>Package</th><th>MD5 Checksum</th><th>PGP</th></thead>
|
90
|
+
#{rows.join("\n")}
|
91
|
+
</table>
|
92
|
+
<p style="text-align:right"> (<a href="#{url}/KEYS">Release signing keys</a>)</p>
|
93
|
+
HTML
|
94
|
+
file_name = 'staged/site/download.html'
|
95
|
+
modified = File.read(file_name).sub(/<h2.*binaries.*source.*<\/h2>.*/i) { |header| "#{header}\n#{html}\n" }
|
96
|
+
File.open file_name, 'w' do |file|
|
97
|
+
file.write modified
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
file 'staged/site'=>'site' do
|
102
|
+
mkpath 'staged'
|
103
|
+
rm_rf 'staged/site'
|
104
|
+
cp_r 'site', 'staged'
|
105
|
+
end
|
106
|
+
|
107
|
+
# Publish prerequisites to Web site.
|
108
|
+
task 'publish:site' do |task, args|
|
109
|
+
target = args.incubating ? "people.apache.org:/www/incubator.apache.org/#{spec.name}" :
|
110
|
+
"people.apache.org:/www/#{spec.name}.apache.org"
|
111
|
+
puts 'Uploading Apache Web site ...'
|
112
|
+
sh 'rsync', '--progress', '--recursive', '--delete', 'published/distro/site/', target
|
113
|
+
puts 'Done'
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
task 'stage:check'=>['apache:license', 'apache:check']
|
120
|
+
task 'stage:prepare'=>['staged/distro', 'staged/site', 'apache:distro-links'] do |task|
|
121
|
+
# Since this requires input (passphrase), do it at the very end.
|
122
|
+
task.enhance do
|
123
|
+
task('apache:sign').invoke
|
124
|
+
end
|
125
|
+
end
|
126
|
+
task 'release:publish'=>['apache:publish:distro', 'apache:publish:site']
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
# Handling of CHANGELOG.
|
18
|
+
namespace 'changelog' do
|
19
|
+
|
20
|
+
task 'check'=>'CHANGELOG' do
|
21
|
+
print 'Checking that CHANGELOG indicates most recent version and today\'s date ... '
|
22
|
+
expecting = "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
|
23
|
+
header = File.readlines('CHANGELOG').first.chomp
|
24
|
+
fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
|
25
|
+
puts 'OK'
|
26
|
+
end
|
27
|
+
|
28
|
+
file 'staged/CHANGES'=>'CHANGELOG' do |task|
|
29
|
+
# Read the changes for this release.
|
30
|
+
print 'Looking for changes between this release and previous one ... '
|
31
|
+
pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
|
32
|
+
changes = File.read('CHANGELOG').scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash }
|
33
|
+
current = changes[spec.version.to_s]
|
34
|
+
fail "No changeset found for version #{spec.version}" unless current
|
35
|
+
File.open task.name, 'w' do |file|
|
36
|
+
file.write "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})\n"
|
37
|
+
file.write current
|
38
|
+
end
|
39
|
+
puts 'OK'
|
40
|
+
end
|
41
|
+
|
42
|
+
task 'wrapup'=>'CHANGELOG' do
|
43
|
+
next_version = spec.version.to_ints.zip([0, 0, 1]).map { |a| a.inject(0) { |t,i| t + i } }.join('.')
|
44
|
+
print 'Adding new entry to CHANGELOG ... '
|
45
|
+
modified = "#{next_version} (Pending)\n\n" + File.read('CHANGELOG')
|
46
|
+
File.open 'CHANGELOG', 'w' do |file|
|
47
|
+
file.write modified
|
48
|
+
end
|
49
|
+
puts 'Done'
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
task 'stage:check'=>'changelog:check'
|
55
|
+
task 'stage:prepare'=>'staged/CHANGES'
|
56
|
+
task 'release:wrapup'=>'changelog:wrapup'
|
data/rakelib/doc.rake
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
require 'rake/rdoctask'
|
18
|
+
|
19
|
+
desc 'Generate RDoc documentation'
|
20
|
+
rdoc = Rake::RDocTask.new('rdoc') do |rdoc|
|
21
|
+
rdoc.rdoc_dir = 'rdoc'
|
22
|
+
rdoc.title = spec.name
|
23
|
+
rdoc.options = spec.rdoc_options + ['--promiscuous']
|
24
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
25
|
+
rdoc.rdoc_files.include spec.extra_rdoc_files
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
begin
|
30
|
+
gem 'allison'
|
31
|
+
rdoc.template = File.expand_path('lib/allison.rb', Gem.loaded_specs['allison'].full_gem_path)
|
32
|
+
rescue LoadError
|
33
|
+
puts 'Please run rake setup to install the Allison RDoc template'
|
34
|
+
task 'setup' do
|
35
|
+
install_gem 'allison'
|
36
|
+
end
|
37
|
+
task 'stage:check' do
|
38
|
+
fail 'Please run rake setup to install the Allison RDoc template'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
begin
|
44
|
+
require 'docter'
|
45
|
+
require 'docter/server'
|
46
|
+
|
47
|
+
#Docter.filter_for(:footnote) do |html|
|
48
|
+
# html.gsub(/<p id="fn(\d+)">(.*?)<\/p>/, %{<p id="fn\\1" class="footnote">\\2</p>})
|
49
|
+
#end
|
50
|
+
|
51
|
+
collection = Docter.collection(spec.name).using('doc/site.toc.yaml').include('doc/pages', 'LICENSE', 'CHANGELOG')
|
52
|
+
# TODO: Add coverage reports when we get them to run.
|
53
|
+
template = Docter.template('doc/site.haml').
|
54
|
+
include('doc/css', 'doc/images', 'doc/scripts', 'reports/specs.html', 'rdoc', 'print/buildr.pdf')
|
55
|
+
|
56
|
+
desc 'Run Docter server on port 3000'
|
57
|
+
Docter::Rake.serve 'docter', collection, template, :port=>3000
|
58
|
+
|
59
|
+
desc 'Generate Web site in directory site'
|
60
|
+
Docter::Rake.generate 'site', collection, template
|
61
|
+
|
62
|
+
Docter::Rake.generate 'print',
|
63
|
+
Docter.collection(spec.name).using('doc/print.toc.yaml').include('doc/pages', 'LICENSE'),
|
64
|
+
Docter.template('doc/print.haml').include('doc/css', 'doc/images'), :one_page
|
65
|
+
|
66
|
+
file('print/buildr.pdf'=>'print') do |task|
|
67
|
+
mkpath 'site'
|
68
|
+
sh 'prince', 'print/index.html', '-o', task.name, '--media=print' do |ok, res|
|
69
|
+
fail 'Failed to create PDF, see errors above' unless ok
|
70
|
+
end
|
71
|
+
end
|
72
|
+
task 'site'=>'print/buildr.pdf' do
|
73
|
+
cp 'print/buildr.pdf', 'site'
|
74
|
+
end
|
75
|
+
|
76
|
+
task 'site' do
|
77
|
+
print 'Checking that we have site documentation, RDoc and PDF ... '
|
78
|
+
fail 'No PDF generated, you need to install PrinceXML!' unless File.exist?('site/buildr.pdf')
|
79
|
+
fail 'No RDocs in site directory' unless File.exist?('site/rdoc/files/lib/buildr_rb.html')
|
80
|
+
fail 'No site documentation in site directory' unless File.exist?('site/index.html')
|
81
|
+
fail 'No specifications site directory' unless File.exist?('site/specs.html')
|
82
|
+
puts 'OK'
|
83
|
+
end
|
84
|
+
|
85
|
+
desc 'Produce PDF'
|
86
|
+
task 'pdf'=>'print/buildr.pdf' do |task|
|
87
|
+
sh 'open', 'print/buildr.pdf'
|
88
|
+
end
|
89
|
+
|
90
|
+
task 'clobber' do
|
91
|
+
rm_rf 'print'
|
92
|
+
rm_rf 'site'
|
93
|
+
end
|
94
|
+
|
95
|
+
rescue LoadError
|
96
|
+
puts 'Please run rake setup to install the Docter document generation library'
|
97
|
+
task 'setup' do
|
98
|
+
install_gem 'docter', '~>1.1.3'
|
99
|
+
end
|
100
|
+
task 'stage:check' do
|
101
|
+
fail 'Please run rake setup to install the Docter document generation library'
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
require 'rake/gempackagetask'
|
18
|
+
|
19
|
+
|
20
|
+
desc 'Clean up all temporary directories used for running tests, creating documentation, packaging, etc.'
|
21
|
+
task 'clobber'
|
22
|
+
|
23
|
+
package = Rake::GemPackageTask.new(spec) do |pkg|
|
24
|
+
pkg.need_tar = true
|
25
|
+
pkg.need_zip = true
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'Install the package locally'
|
29
|
+
task 'install'=>['setup', "#{package.package_dir}/#{package.gem_file}"] do |task|
|
30
|
+
print "Installing #{spec.name} ... "
|
31
|
+
args = [Config::CONFIG['ruby_install_name'], '-S', 'gem', 'install', "#{package.package_dir}/#{package.gem_file}"]
|
32
|
+
args.unshift('sudo') unless windows?
|
33
|
+
sh *args
|
34
|
+
puts 'Done'
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'Uninstall previously installed packaged'
|
38
|
+
task 'uninstall' do |task|
|
39
|
+
print "Uninstalling #{spec.name} ... "
|
40
|
+
args = [Config::CONFIG['ruby_install_name'], '-S', 'gem', 'uninstall', spec.name, '--version', spec.version.to_s]
|
41
|
+
args.unshift('sudo') unless windows?
|
42
|
+
sh *args
|
43
|
+
puts 'Done'
|
44
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
# Released files are placed in this directory first, and from there published to various servers.
|
17
|
+
file 'published' do |task, args|
|
18
|
+
mkpath task.name
|
19
|
+
puts "Populating published directory from #{args.staging} ..."
|
20
|
+
sh 'rsync', '--progress', '--recursive', "#{args.staging}/", 'published'
|
21
|
+
puts 'Done'
|
22
|
+
end
|
23
|
+
|
24
|
+
task 'clobber' do
|
25
|
+
rm_rf 'published'
|
26
|
+
end
|
27
|
+
|
28
|
+
namespace 'release' do
|
29
|
+
task 'prepare'=>['setup', 'clobber', 'published']
|
30
|
+
|
31
|
+
task 'publish'
|
32
|
+
|
33
|
+
task 'wrapup'
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Make a release using previously staged files"
|
37
|
+
task 'release'=>['release:prepare', 'release:publish', 'release:wrapup']
|
38
|
+
|
39
|
+
|
40
|
+
task 'next_version' do
|
41
|
+
ver_file = "lib/#{spec.name}.rb"
|
42
|
+
if File.exist?(ver_file)
|
43
|
+
next_version = spec.version.to_ints.zip([0, 0, 1]).map { |a| a.inject(0) { |t,i| t + i } }.join('.')
|
44
|
+
print "Updating #{ver_file} to next version number (#{next_version}) ... "
|
45
|
+
modified = File.read(ver_file).sub(/(VERSION\s*=\s*)(['"])(.*)\2/) { |line| "#{$1}#{$2}#{next_version}#{$2}" }
|
46
|
+
File.open ver_file, 'w' do |file|
|
47
|
+
file.write modified
|
48
|
+
end
|
49
|
+
puts 'Done'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
task 'release:wrapup'=>'next_version'
|
data/rakelib/rspec.rake
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'spec/rake/spectask'
|
19
|
+
|
20
|
+
directory 'reports'
|
21
|
+
task 'clobber' do
|
22
|
+
rm 'failing' rescue nil
|
23
|
+
rm_rf 'reports'
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Run all specs'
|
27
|
+
Spec::Rake::SpecTask.new('spec'=>'reports') do |task|
|
28
|
+
task.spec_files = FileList['spec/**/*_spec.rb']
|
29
|
+
task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' <<
|
30
|
+
'--format' << 'html:reports/specs.html' << '--backtrace'
|
31
|
+
end
|
32
|
+
file 'reports/specs.html'=>'spec'
|
33
|
+
|
34
|
+
desc 'Run all failing examples from previous run'
|
35
|
+
Spec::Rake::SpecTask.new('failing') do |task|
|
36
|
+
task.spec_files = FileList['spec/**/*_spec.rb']
|
37
|
+
task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' << '--example' << 'failing'
|
38
|
+
end
|
39
|
+
|
40
|
+
# Useful for testing with JRuby when using Ruby and vice versa.
|
41
|
+
namespace 'spec' do
|
42
|
+
=begin
|
43
|
+
# TODO: Horribly broken! Fix some other time.
|
44
|
+
desc 'Run RSpec and generate Spec and coverage reports (slow)'
|
45
|
+
Spec::Rake::SpecTask.new('rcov') do |task|
|
46
|
+
task.spec_files = FileList['spec/**/*spec.rb']
|
47
|
+
task.rcov = true
|
48
|
+
task.rcov_opts = '--exclude', 'spec,bin'
|
49
|
+
task.rcov_dir = 'coverage'
|
50
|
+
end
|
51
|
+
=end
|
52
|
+
|
53
|
+
desc 'Run all specs specifically with Ruby'
|
54
|
+
task 'ruby' do
|
55
|
+
puts 'Running test suite using Ruby ...'
|
56
|
+
sh 'ruby -S rake spec'
|
57
|
+
end
|
58
|
+
|
59
|
+
desc 'Run all specs specifically with JRuby'
|
60
|
+
task 'jruby' do
|
61
|
+
puts 'Running test suite using JRuby ...'
|
62
|
+
sh 'jruby -S rake spec'
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
task 'setup' do
|
68
|
+
install_gem 'win32console' if Gem.win_platform? # Colors for RSpec, only on Windows platform.
|
69
|
+
end
|
70
|
+
|
71
|
+
rescue LoadError
|
72
|
+
puts 'Please run rake setup to install RSpec'
|
73
|
+
task 'stage:check' do
|
74
|
+
fail 'Please run rake setup to install RSpec'
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
task 'stage:prepare'=>'spec'
|
80
|
+
task 'stage:prepare'=>RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby'
|
81
|
+
# TODO: Add Rcov when we get it working again.
|