buildr 1.3.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. data/CHANGELOG +780 -0
  2. data/DISCLAIMER +7 -0
  3. data/KEYS +151 -0
  4. data/LICENSE +176 -0
  5. data/NOTICE +31 -0
  6. data/README +173 -0
  7. data/Rakefile +63 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/cobertura.rb +232 -0
  10. data/addon/buildr/hibernate.rb +142 -0
  11. data/addon/buildr/javacc.rb +85 -0
  12. data/addon/buildr/jdepend.rb +60 -0
  13. data/addon/buildr/jetty.rb +248 -0
  14. data/addon/buildr/nailgun.rb +892 -0
  15. data/addon/buildr/openjpa.rb +90 -0
  16. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  17. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  18. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  19. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  20. data/addon/buildr/xmlbeans.rb +93 -0
  21. data/bin/buildr +21 -0
  22. data/buildr.gemspec +50 -0
  23. data/doc/css/default.css +225 -0
  24. data/doc/css/print.css +95 -0
  25. data/doc/css/syntax.css +43 -0
  26. data/doc/images/apache-incubator-logo.png +0 -0
  27. data/doc/images/buildr-hires.png +0 -0
  28. data/doc/images/buildr.png +0 -0
  29. data/doc/images/note.png +0 -0
  30. data/doc/images/tip.png +0 -0
  31. data/doc/images/zbuildr.tif +0 -0
  32. data/doc/pages/artifacts.textile +317 -0
  33. data/doc/pages/building.textile +501 -0
  34. data/doc/pages/contributing.textile +178 -0
  35. data/doc/pages/download.textile +25 -0
  36. data/doc/pages/extending.textile +229 -0
  37. data/doc/pages/getting_started.textile +337 -0
  38. data/doc/pages/index.textile +63 -0
  39. data/doc/pages/mailing_lists.textile +17 -0
  40. data/doc/pages/more_stuff.textile +367 -0
  41. data/doc/pages/packaging.textile +592 -0
  42. data/doc/pages/projects.textile +449 -0
  43. data/doc/pages/recipes.textile +127 -0
  44. data/doc/pages/settings_profiles.textile +339 -0
  45. data/doc/pages/testing.textile +475 -0
  46. data/doc/pages/troubleshooting.textile +121 -0
  47. data/doc/pages/whats_new.textile +389 -0
  48. data/doc/print.haml +52 -0
  49. data/doc/print.toc.yaml +28 -0
  50. data/doc/scripts/buildr-git.rb +411 -0
  51. data/doc/scripts/install-jruby.sh +44 -0
  52. data/doc/scripts/install-linux.sh +64 -0
  53. data/doc/scripts/install-osx.sh +52 -0
  54. data/doc/site.haml +55 -0
  55. data/doc/site.toc.yaml +44 -0
  56. data/lib/buildr.rb +47 -0
  57. data/lib/buildr/core.rb +27 -0
  58. data/lib/buildr/core/application.rb +373 -0
  59. data/lib/buildr/core/application_cli.rb +134 -0
  60. data/lib/buildr/core/build.rb +262 -0
  61. data/lib/buildr/core/checks.rb +382 -0
  62. data/lib/buildr/core/common.rb +155 -0
  63. data/lib/buildr/core/compile.rb +594 -0
  64. data/lib/buildr/core/environment.rb +120 -0
  65. data/lib/buildr/core/filter.rb +258 -0
  66. data/lib/buildr/core/generate.rb +195 -0
  67. data/lib/buildr/core/help.rb +118 -0
  68. data/lib/buildr/core/progressbar.rb +156 -0
  69. data/lib/buildr/core/project.rb +890 -0
  70. data/lib/buildr/core/test.rb +690 -0
  71. data/lib/buildr/core/transports.rb +486 -0
  72. data/lib/buildr/core/util.rb +235 -0
  73. data/lib/buildr/ide.rb +19 -0
  74. data/lib/buildr/ide/eclipse.rb +181 -0
  75. data/lib/buildr/ide/idea.ipr.template +300 -0
  76. data/lib/buildr/ide/idea.rb +194 -0
  77. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  78. data/lib/buildr/ide/idea7x.rb +210 -0
  79. data/lib/buildr/java.rb +26 -0
  80. data/lib/buildr/java/ant.rb +71 -0
  81. data/lib/buildr/java/bdd_frameworks.rb +267 -0
  82. data/lib/buildr/java/commands.rb +210 -0
  83. data/lib/buildr/java/compilers.rb +432 -0
  84. data/lib/buildr/java/deprecated.rb +141 -0
  85. data/lib/buildr/java/groovyc.rb +137 -0
  86. data/lib/buildr/java/jruby.rb +99 -0
  87. data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
  88. data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
  89. data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
  90. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  91. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
  92. data/lib/buildr/java/packaging.rb +706 -0
  93. data/lib/buildr/java/pom.rb +178 -0
  94. data/lib/buildr/java/rjb.rb +142 -0
  95. data/lib/buildr/java/test_frameworks.rb +290 -0
  96. data/lib/buildr/java/version_requirement.rb +172 -0
  97. data/lib/buildr/packaging.rb +21 -0
  98. data/lib/buildr/packaging/artifact.rb +729 -0
  99. data/lib/buildr/packaging/artifact_namespace.rb +957 -0
  100. data/lib/buildr/packaging/artifact_search.rb +140 -0
  101. data/lib/buildr/packaging/gems.rb +102 -0
  102. data/lib/buildr/packaging/package.rb +233 -0
  103. data/lib/buildr/packaging/tar.rb +104 -0
  104. data/lib/buildr/packaging/zip.rb +719 -0
  105. data/rakelib/apache.rake +126 -0
  106. data/rakelib/changelog.rake +56 -0
  107. data/rakelib/doc.rake +103 -0
  108. data/rakelib/package.rake +44 -0
  109. data/rakelib/release.rake +53 -0
  110. data/rakelib/rspec.rake +81 -0
  111. data/rakelib/rubyforge.rake +45 -0
  112. data/rakelib/scm.rake +49 -0
  113. data/rakelib/setup.rake +59 -0
  114. data/rakelib/stage.rake +45 -0
  115. data/spec/application_spec.rb +316 -0
  116. data/spec/archive_spec.rb +494 -0
  117. data/spec/artifact_namespace_spec.rb +635 -0
  118. data/spec/artifact_spec.rb +738 -0
  119. data/spec/build_spec.rb +193 -0
  120. data/spec/checks_spec.rb +537 -0
  121. data/spec/common_spec.rb +579 -0
  122. data/spec/compile_spec.rb +561 -0
  123. data/spec/groovy_compilers_spec.rb +239 -0
  124. data/spec/java_bdd_frameworks_spec.rb +238 -0
  125. data/spec/java_compilers_spec.rb +446 -0
  126. data/spec/java_packaging_spec.rb +1042 -0
  127. data/spec/java_test_frameworks_spec.rb +414 -0
  128. data/spec/packaging_helper.rb +63 -0
  129. data/spec/packaging_spec.rb +589 -0
  130. data/spec/project_spec.rb +739 -0
  131. data/spec/sandbox.rb +116 -0
  132. data/spec/scala_compilers_spec.rb +239 -0
  133. data/spec/spec.opts +6 -0
  134. data/spec/spec_helpers.rb +283 -0
  135. data/spec/test_spec.rb +871 -0
  136. data/spec/transport_spec.rb +300 -0
  137. data/spec/version_requirement_spec.rb +115 -0
  138. metadata +324 -0
@@ -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'
@@ -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'
@@ -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.