buildr 1.4.6-x86-mswin32 → 1.4.7-x86-mswin32

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 (137) hide show
  1. data/CHANGELOG +81 -0
  2. data/Rakefile +5 -2
  3. data/addon/buildr/antlr.rb +0 -4
  4. data/addon/buildr/bnd.rb +3 -1
  5. data/addon/buildr/checkstyle.rb +201 -0
  6. data/addon/buildr/cobertura.rb +0 -1
  7. data/addon/buildr/drb.rb +0 -2
  8. data/addon/buildr/emma.rb +0 -1
  9. data/addon/buildr/findbugs.rb +227 -0
  10. data/addon/buildr/gwt.rake +82 -0
  11. data/addon/buildr/hibernate.rb +0 -4
  12. data/addon/buildr/javacc.rb +0 -4
  13. data/addon/buildr/javancss.rb +155 -0
  14. data/addon/buildr/jdepend.rb +138 -24
  15. data/addon/buildr/jdepend.rb.orig +178 -0
  16. data/addon/buildr/jetty.rb +0 -5
  17. data/addon/buildr/jibx.rb +85 -86
  18. data/addon/buildr/nailgun.rb +2 -2
  19. data/addon/buildr/openjpa.rb +0 -4
  20. data/addon/buildr/pmd.rb +166 -0
  21. data/addon/buildr/protobuf.rb +0 -1
  22. data/addon/buildr/sonar.rb +142 -0
  23. data/addon/buildr/xmlbeans.rb +0 -5
  24. data/buildr.gemspec +36 -21
  25. data/doc/_layouts/default.html +1 -0
  26. data/doc/contributing.textile +11 -2
  27. data/doc/download.textile +17 -5
  28. data/doc/index.textile +21 -46
  29. data/doc/installing.textile +18 -8
  30. data/doc/installing.textile.orig +282 -0
  31. data/doc/languages.textile +0 -38
  32. data/doc/more_stuff.textile +199 -12
  33. data/doc/more_stuff.textile.orig +1004 -0
  34. data/doc/packaging.textile +10 -0
  35. data/doc/settings_profiles.textile +2 -2
  36. data/etc/KEYS +44 -0
  37. data/lib/buildr.rb +67 -4
  38. data/lib/buildr/clojure.rb +0 -2
  39. data/lib/buildr/core/application.rb +23 -32
  40. data/lib/buildr/core/build.rb +0 -7
  41. data/lib/buildr/core/cc.rb +0 -5
  42. data/lib/buildr/core/checks.rb +0 -4
  43. data/lib/buildr/core/common.rb +0 -5
  44. data/lib/buildr/core/compile.rb +5 -10
  45. data/lib/buildr/core/doc.rb +9 -3
  46. data/lib/buildr/core/environment.rb +0 -1
  47. data/lib/buildr/core/filter.rb +0 -5
  48. data/lib/buildr/core/generate.rb +2 -6
  49. data/lib/buildr/core/help.rb +1 -6
  50. data/lib/buildr/core/linux.rb +0 -1
  51. data/lib/buildr/core/osx.rb +0 -1
  52. data/lib/buildr/core/project.rb +0 -4
  53. data/lib/buildr/core/run.rb +1 -5
  54. data/lib/buildr/core/shell.rb +1 -6
  55. data/lib/buildr/core/test.rb +1 -7
  56. data/lib/buildr/core/transports.rb +4 -6
  57. data/lib/buildr/core/util.rb +2 -65
  58. data/lib/buildr/groovy/doc.rb +0 -3
  59. data/lib/buildr/groovy/shell.rb +0 -2
  60. data/lib/buildr/ide/eclipse.rb +4 -13
  61. data/lib/buildr/ide/eclipse/java.rb +0 -4
  62. data/lib/buildr/ide/eclipse/plugin.rb +0 -4
  63. data/lib/buildr/ide/eclipse/scala.rb +0 -4
  64. data/lib/buildr/ide/idea.rb +284 -52
  65. data/lib/buildr/java/ant.rb +2 -6
  66. data/lib/buildr/java/bdd.rb +5 -123
  67. data/lib/buildr/java/cobertura.rb +16 -10
  68. data/lib/buildr/java/commands.rb +33 -7
  69. data/lib/buildr/java/compiler.rb +0 -7
  70. data/lib/buildr/java/deprecated.rb +0 -4
  71. data/lib/buildr/java/doc.rb +0 -2
  72. data/lib/buildr/java/emma.rb +0 -4
  73. data/lib/buildr/java/jruby.rb +0 -2
  74. data/lib/buildr/java/packaging.rb +0 -4
  75. data/lib/buildr/java/pom.rb +24 -16
  76. data/lib/buildr/java/rjb.rb +1 -1
  77. data/lib/buildr/java/test_result.rb +1 -2
  78. data/lib/buildr/java/tests.rb +68 -6
  79. data/lib/buildr/packaging/archive.rb +0 -1
  80. data/lib/buildr/packaging/artifact.rb +19 -16
  81. data/lib/buildr/packaging/artifact_namespace.rb +51 -24
  82. data/lib/buildr/packaging/artifact_search.rb +1 -2
  83. data/lib/buildr/packaging/gems.rb +1 -13
  84. data/lib/buildr/packaging/package.rb +0 -6
  85. data/lib/buildr/packaging/tar.rb +2 -4
  86. data/lib/buildr/packaging/version_requirement.rb +1 -1
  87. data/lib/buildr/packaging/zip.rb +1 -2
  88. data/lib/buildr/packaging/ziptask.rb +0 -4
  89. data/lib/buildr/run.rb +3 -3
  90. data/lib/buildr/scala/bdd.rb +129 -11
  91. data/lib/buildr/scala/compiler.rb +53 -6
  92. data/lib/buildr/scala/doc.rb +6 -4
  93. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
  94. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.java +38 -0
  95. data/lib/buildr/scala/shell.rb +0 -4
  96. data/lib/buildr/scala/tests.rb +15 -6
  97. data/lib/buildr/shell.rb +0 -1
  98. data/lib/buildr/version.rb +1 -1
  99. data/rakelib/all-in-one.rake +20 -11
  100. data/rakelib/checks.rake +0 -31
  101. data/rakelib/doc.rake +86 -100
  102. data/rakelib/package.rake +3 -3
  103. data/rakelib/release.rake +1 -1
  104. data/rakelib/rspec.rake +23 -7
  105. data/rakelib/stage.rake +18 -21
  106. data/spec/addon/bnd_spec.rb +2 -2
  107. data/spec/addon/jaxb_xjc_spec.rb +5 -0
  108. data/spec/core/application_spec.rb +11 -64
  109. data/spec/core/cc_spec.rb +12 -5
  110. data/spec/core/compile_spec.rb +11 -0
  111. data/spec/core/doc_spec.rb +1 -1
  112. data/spec/core/run_spec.rb +17 -4
  113. data/spec/core/test_spec.rb +5 -3
  114. data/spec/ide/idea_spec.rb +60 -0
  115. data/spec/java/bdd_spec.rb +8 -218
  116. data/spec/java/cobertura_spec.rb +4 -0
  117. data/spec/java/compiler_spec.rb +11 -8
  118. data/spec/java/emma_spec.rb +4 -1
  119. data/spec/java/java_spec.rb +1 -1
  120. data/spec/java/pom_spec.rb +125 -0
  121. data/spec/java/tests_spec.rb +185 -0
  122. data/spec/packaging/archive_spec.rb +1 -1
  123. data/spec/packaging/artifact_namespace_spec.rb +15 -0
  124. data/spec/packaging/artifact_spec.rb +26 -1
  125. data/spec/sandbox.rb +7 -1
  126. data/spec/scala/bdd_spec.rb +111 -8
  127. data/spec/scala/tests_spec.rb +5 -1
  128. data/spec/spec_helpers.rb +9 -4
  129. data/spec/version_requirement_spec.rb +2 -0
  130. metadata +570 -505
  131. data/lib/buildr/core.rb +0 -34
  132. data/lib/buildr/ide.rb +0 -19
  133. data/lib/buildr/java.rb +0 -25
  134. data/lib/buildr/java/jtestr_result.rb +0 -331
  135. data/lib/buildr/java/jtestr_runner.rb.erb +0 -116
  136. data/lib/buildr/packaging.rb +0 -25
  137. data/rakelib/setup.rake +0 -68
data/rakelib/checks.rake CHANGED
@@ -26,34 +26,3 @@ task :license=>FileList["**/*.{rb,rake,java,gemspec,buildfile}", 'Rakefile'] do
26
26
  fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
27
27
  puts "[x] Source files contain the Apache license"
28
28
  end
29
-
30
-
31
- desc "Look for new dependencies, check transitive dependencies"
32
- task :dependency do
33
- =begin
34
- puts "Checking that all dependencies are up to date ..."
35
- # Find if anything has a more recent dependency. These are not errors, just reports.
36
- spec.dependencies.each do |dep|
37
- current = Gem::SourceInfoCache.search(dep).last
38
- latest = Gem::SourceInfoCache.search(Gem::Dependency.new(dep.name, '>0')).last
39
- puts "A new version of #{dep.name} is available, #{latest.version} replaces #{current.version}" if (current && latest && latest.version > current.version)
40
- end
41
-
42
- # Returns orderd list of transitive dependencies for the given dependency.
43
- transitive = lambda { |depend|
44
- dep_spec = Gem::SourceIndex.from_installed_gems.search(depend).last
45
- fail "No specification for dependency #{depend}" unless dep_spec
46
- dep_spec.runtime_dependencies.map { |trans| transitive[trans].push(trans) }.flatten.uniq }
47
- # For each dependency, make sure *all* its transitive dependencies are listed
48
- # as a Buildr dependency, and order is preserved.
49
- spec.dependencies.select {|dep| dep.type == :runtime }.each_with_index do |dep, index|
50
- puts "checking #{dep.name}"
51
- transitive[dep].each do |trans|
52
- matching = spec.dependencies.find { |existing| trans =~ existing }
53
- fail "#{trans} required by #{dep} and missing from spec" unless matching
54
- fail "#{trans} must come before #{dep} in dependency list" unless spec.dependencies.index(matching) < index
55
- end
56
- end
57
- puts "[X] Checked all dependencies are up to date and transitive dependencies are correctly ordered"
58
- =end
59
- end
data/rakelib/doc.rake CHANGED
@@ -13,125 +13,111 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
+ if !RUBY_PLATFORM[/java/]
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
25
 
17
- task 'doc:setup'
18
- begin # For the Web site, we use the SDoc RDoc generator/theme (http://github.com/voloko/sdoc/)
19
- require 'sdoc'
20
- rescue LoadError
21
- puts "Buildr uses the SDoc RDoc generator/theme. You can install it by running rake doc:setup"
22
- task('doc:setup') { install_gem 'voloko-sdoc', :source=>'http://gems.github.com' }
23
- end
24
-
25
-
26
- require 'rake/rdoctask'
27
-
28
- desc "Creates a symlink to rake's lib directory to support combined rdoc generation"
29
- file "rake/lib" do
30
- rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, "rake.rb") }
31
- mkdir_p "rake"
32
- File.symlink(rake_path, "rake/lib")
33
- end
34
-
35
- desc "Generate RDoc documentation in rdoc/"
36
- Rake::RDocTask.new :rdoc do |rdoc|
37
- rdoc.rdoc_dir = 'rdoc'
38
- rdoc.title = spec.name
39
- rdoc.options = spec.rdoc_options.clone
40
- rdoc.rdoc_files.include('lib/**/*.rb')
41
- rdoc.rdoc_files.include spec.extra_rdoc_files
42
-
43
- # include rake source for better inheritance rdoc
44
- rdoc.rdoc_files.include('rake/lib/**.rb')
45
- end
46
- task :rdoc => ["rake/lib"]
26
+ desc "Generate RDoc documentation in rdoc/"
27
+ RDoc::Task.new :rdoc do |rdoc|
28
+ rdoc.rdoc_dir = 'rdoc'
29
+ rdoc.title = spec.name
30
+ rdoc.options = spec.rdoc_options.clone
31
+ rdoc.rdoc_files.include('lib/**/*.rb')
32
+ rdoc.rdoc_files.include spec.extra_rdoc_files
47
33
 
48
- begin
49
- require 'jekylltask'
50
- module TocFilter
51
- def toc(input)
52
- output = "<ol class=\"toc\">"
53
- input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).each do |entry|
54
- id = (entry[1][/^id=(['"])(.*)\1$/, 2] rescue nil)
55
- title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
56
- if id
57
- output << %{<li><a href="##{id}">#{title}</a></li>}
58
- else
59
- output << %{<li>#{title}</li>}
34
+ # include rake source for better inheritance rdoc
35
+ rdoc.rdoc_files.include('rake/lib/**.rb')
36
+ end
37
+ task :rdoc => ["rake/lib"]
38
+
39
+ begin
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
60
52
  end
53
+ output << "</ol>"
54
+ output
61
55
  end
62
- output << "</ol>"
63
- output
64
56
  end
65
- end
66
- Liquid::Template.register_filter(TocFilter)
67
-
68
- desc "Generate Buildr documentation in _site/"
69
- JekyllTask.new :jekyll do |task|
70
- task.source = 'doc'
71
- task.target = '_site'
72
- end
57
+ Liquid::Template.register_filter(TocFilter)
73
58
 
74
- rescue LoadError
75
- puts "Buildr uses the jekyll gem to generate the Web site. You can install it by running rake doc:setup"
76
- task 'doc:setup' do
77
- install_gem 'jekyll', :version=>'0.10.0'
78
- install_gem 'jekylltask', :version=>'1.0.2'
79
- if `pygmentize -V`.empty?
80
- args = %w{easy_install Pygments}
81
- args.unshift 'sudo' unless Config::CONFIG['host_os'] =~ /windows/
82
- sh *args
59
+ desc "Generate Buildr documentation in _site/"
60
+ JekyllTask.new :jekyll do |task|
61
+ task.source = 'doc'
62
+ task.target = '_site'
83
63
  end
64
+
65
+ rescue LoadError
66
+ puts "Buildr uses the jekyll gem to generate the Web site. You can install it by running bundler"
84
67
  end
85
- end
86
68
 
69
+ if 0 == system("pygmentize -V > /dev/null 2> /dev/null")
70
+ puts "Buildr uses the Pygments python library. You can install it by running 'sudo easy_install Pygments' or 'sudo apt-get install python-pygments'"
71
+ end
87
72
 
88
- desc "Generate Buildr documentation as buildr.pdf"
89
- file 'buildr.pdf'=>'_site' do |task|
90
- pages = File.read('_site/preface.html').scan(/<li><a href=['"]([^'"]+)/).flatten.map { |f| "_site/#{f}" }
91
- sh 'prince', '--input=html', '--no-network', '--log=prince_errors.log', "--output=#{task.name}", '_site/preface.html', *pages
92
- end
73
+ desc "Generate Buildr documentation as buildr.pdf"
74
+ file 'buildr.pdf'=>'_site' do |task|
75
+ pages = File.read('_site/preface.html').scan(/<li><a href=['"]([^'"]+)/).flatten.map { |f| "_site/#{f}" }
76
+ sh 'prince', '--input=html', '--no-network', '--log=prince_errors.log', "--output=#{task.name}", '_site/preface.html', *pages
77
+ end
93
78
 
94
- desc "Build a copy of the Web site in the ./_site"
95
- task :site=>['_site', :rdoc, '_reports/specs.html', '_reports/coverage', 'buildr.pdf'] do
96
- cp_r 'rdoc', '_site'
97
- fail 'No RDocs in site directory' unless File.exist?('_site/rdoc/files/lib/buildr_rb.html')
98
- cp '_reports/specs.html', '_site'
99
- cp_r '_reports/coverage', '_site'
100
- fail 'No coverage report in site directory' unless File.exist?('_site/coverage/index.html')
101
- cp 'CHANGELOG', '_site'
102
- open("_site/.htaccess", "w") do |htaccess|
103
- htaccess << %Q{
79
+ desc "Build a copy of the Web site in the ./_site"
80
+ task :site=>['_site', :rdoc, '_reports/specs.html', '_reports/coverage', 'buildr.pdf'] do
81
+ cp_r 'rdoc', '_site'
82
+ fail 'No RDocs in site directory' unless File.exist?('_site/rdoc/lib/buildr_rb.html')
83
+ cp '_reports/specs.html', '_site'
84
+ cp_r '_reports/coverage', '_site'
85
+ fail 'No coverage report in site directory' unless File.exist?('_site/coverage/index.html')
86
+ cp 'CHANGELOG', '_site'
87
+ open("_site/.htaccess", "w") do |htaccess|
88
+ htaccess << %Q{
104
89
  <FilesMatch "CHANGELOG">
105
90
  ForceType 'text/plain; charset=UTF-8'
106
91
  </FilesMatch>
107
92
  }
93
+ end
94
+ cp 'buildr.pdf', '_site'
95
+ fail 'No PDF in site directory' unless File.exist?('_site/buildr.pdf')
96
+ puts 'OK'
108
97
  end
109
- cp 'buildr.pdf', '_site'
110
- fail 'No PDF in site directory' unless File.exist?('_site/buildr.pdf')
111
- puts 'OK'
112
- end
113
98
 
114
99
  # Publish prerequisites to Web site.
115
- task 'publish'=>:site do
116
- target = "people.apache.org:/www/#{spec.name}.apache.org/"
117
- puts "Uploading new site to #{target} ..."
118
- sh 'rsync', '--progress', '--recursive', '--delete', '_site/', target
119
- sh 'ssh', 'people.apache.org', 'chmod', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
120
- puts "Done"
121
- end
100
+ task 'publish'=>:site do
101
+ target = "people.apache.org:/www/#{spec.name}.apache.org/"
102
+ puts "Uploading new site to #{target} ..."
103
+ sh 'rsync', '--progress', '--recursive', '--delete', '_site/', target
104
+ sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
105
+ puts "Done"
106
+ end
122
107
 
123
108
  # Update HTML + PDF documentation (but not entire site; no specs, coverage, etc.)
124
- task 'publish-doc' => ['buildr.pdf', '_site'] do
125
- cp 'buildr.pdf', '_site'
126
- target = "people.apache.org:/www/#{spec.name}.apache.org/"
127
- puts "Uploading new site to #{target} ..."
128
- sh 'rsync', '--progress', '--recursive', '_site/', target # Note: no --delete
129
- sh 'ssh', 'people.apache.org', 'chmod', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
130
- puts "Done"
131
- end
109
+ task 'publish-doc' => ['buildr.pdf', '_site'] do
110
+ cp 'buildr.pdf', '_site'
111
+ target = "people.apache.org:/www/#{spec.name}.apache.org/"
112
+ puts "Uploading new site to #{target} ..."
113
+ sh 'rsync', '--progress', '--recursive', '_site/', target # Note: no --delete
114
+ sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
115
+ puts "Done"
116
+ end
132
117
 
133
- task :clobber do
134
- rm_rf '_site'
135
- rm_f 'buildr.pdf'
136
- rm_f 'prince_errors.log'
118
+ task :clobber do
119
+ rm_rf '_site'
120
+ rm_f 'buildr.pdf'
121
+ rm_f 'prince_errors.log'
122
+ end
137
123
  end
data/rakelib/package.rake CHANGED
@@ -25,7 +25,7 @@ end
25
25
  desc "Install Buildr from source"
26
26
  task :install=>["#{package.package_dir}/#{package.gem_spec.file_name}"] do |task|
27
27
  print "Installing #{spec.name} ... "
28
- args = Config::CONFIG['ruby_install_name'], '-S', 'gem', 'install', "#{package.package_dir}/#{package.gem_spec.file_name}"
28
+ args = RbConfig::CONFIG['ruby_install_name'], '-S', 'gem', 'install', "#{package.package_dir}/#{package.gem_spec.file_name}"
29
29
  args.unshift('sudo') if sudo_needed?
30
30
  sh *args
31
31
  puts "[x] Installed Buildr #{spec.version}"
@@ -34,7 +34,7 @@ end
34
34
  desc "Uninstall previous rake install"
35
35
  task :uninstall do |task|
36
36
  puts "Uninstalling #{spec.name} ... "
37
- args = Config::CONFIG['ruby_install_name'], '-S', 'gem', 'uninstall', spec.name, '--version', spec.version.to_s
37
+ args = RbConfig::CONFIG['ruby_install_name'], '-S', 'gem', 'uninstall', spec.name, '--version', spec.version.to_s
38
38
  args.unshift('sudo') if sudo_needed?
39
39
  sh *args
40
40
  puts "[x] Uninstalled Buildr #{spec.version}"
@@ -44,7 +44,7 @@ end
44
44
  desc "Compile Java libraries used by Buildr"
45
45
  task :compile do
46
46
  puts "Compiling Java libraries ..."
47
- args = Config::CONFIG['ruby_install_name'], File.expand_path(RUBY_PLATFORM[/java/] ? '_jbuildr' : '_buildr'), '--buildfile', 'buildr.buildfile', 'compile'
47
+ args = RbConfig::CONFIG['ruby_install_name'], File.expand_path(RUBY_PLATFORM[/java/] ? '_jbuildr' : '_buildr'), '--buildfile', 'buildr.buildfile', 'compile'
48
48
  args << '--trace' if Rake.application.options.trace
49
49
  sh *args
50
50
  end
data/rakelib/release.rake CHANGED
@@ -38,7 +38,7 @@ task :release do
38
38
  target = "people.apache.org:/www/#{spec.name}.apache.org/"
39
39
  puts "Uploading new site to #{spec.name}.apache.org ..."
40
40
  sh 'rsync', '--progress', '--recursive', '--delete', "_release/#{spec.version}/site/", target
41
- sh 'ssh', 'people.apache.org', 'chmod', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
41
+ sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
42
42
  puts "[X] Uploaded new site to #{spec.name}.apache.org"
43
43
  end.call
44
44
 
data/rakelib/rspec.rake CHANGED
@@ -65,19 +65,37 @@ begin
65
65
  desc 'Run all specs with CI reporter'
66
66
  task :ci=>[:load_ci_reporter, :spec]
67
67
 
68
+ def rvm_run_in(version, command)
69
+ if !(Config::CONFIG['host_os'] =~ /mswin|win32|dos/i)
70
+ cmd_prefix = "rvm #{version} exec"
71
+ sh "rm -f Gemfile.lock; #{cmd_prefix} bundle install; #{cmd_prefix} bundle exec #{command}"
72
+ else
73
+ sh "#{version =~ /jruby/ ? "j" : ""}ruby -S #{command}"
74
+ end
75
+ end
76
+
68
77
  # Useful for testing with JRuby when using Ruby and vice versa.
69
78
  namespace :spec do
70
- desc "Run all specs specifically with Ruby"
71
- task :ruby do
79
+ desc "Run all specs specifically with Ruby 1.9"
80
+ task :ruby_1_9 do
72
81
  puts "Running test suite using Ruby ..."
73
- sh 'ruby -S rake spec'
82
+ rvm_run_in("ruby-1.9.2-p320@buildr", "rake spec")
83
+ end
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")
74
89
  end
75
90
 
76
91
  desc "Run all specs specifically with JRuby"
77
92
  task :jruby do
78
93
  puts "Running test suite using JRuby ..."
79
- sh 'jruby -S rake spec'
94
+ rvm_run_in("jruby-1.6.7@buildr", "rake spec")
80
95
  end
96
+
97
+ desc "Run all specs across various rubies"
98
+ task :all => [:jruby, :ruby_1_8, :ruby_1_9]
81
99
  end
82
100
 
83
101
  task :clobber do
@@ -86,7 +104,5 @@ begin
86
104
  end
87
105
 
88
106
  rescue LoadError => e
89
- puts "Buildr uses RSpec. You can install it by running rake setup"
90
- task(:setup) { install_gem 'rcov', :version=>'~>0.8' }
91
- task(:setup) { install_gem 'win32console' if RUBY_PLATFORM[/win32/] } # Colors for RSpec, only on Windows platform.
107
+ puts "Buildr uses RSpec. You can install it by running bundler"
92
108
  end
data/rakelib/stage.rake CHANGED
@@ -13,19 +13,15 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
-
16
+ require 'rubyforge'
17
17
  require 'digest/md5'
18
18
  require 'digest/sha1'
19
19
 
20
- begin # Releases upload Gems to RubyForge.
21
- require 'rubyforge'
22
- rescue LoadError
23
- task(:setup) { install_gem 'rubyforge' }
24
- end
25
-
26
20
  gpg_cmd = 'gpg2'
27
21
 
28
22
  task :prepare do |task, args|
23
+ gpg_arg = args.gpg || ENV['gpg']
24
+
29
25
  # Make sure we're doing a release from checked code.
30
26
  lambda do
31
27
  puts "Checking there are no local changes ... "
@@ -41,31 +37,30 @@ task :prepare do |task, args|
41
37
  puts "Checking that CHANGELOG indicates most recent version and today's date ... "
42
38
  expecting = "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
43
39
  header = File.readlines('CHANGELOG').first.chomp
44
- #fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
40
+ fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
45
41
  puts "[x] CHANGELOG indicates most recent version and today's date"
46
42
  end.call
47
43
 
48
44
  # Need GPG to sign the packages.
49
45
  lambda do
50
- args.gpg or fail "Please run with gpg=<argument for gpg --local-user>"
51
- gpg_ok = `gpg2 --list-keys #{args.gpg}`
46
+ gpg_arg or fail "Please run with gpg=<argument for gpg --local-user>"
47
+ gpg_ok = `gpg2 --list-keys #{gpg_arg}` rescue nil
52
48
  if !$?.success?
53
- gpg_ok = `gpg --list-keys #{args.gpg}`
49
+ gpg_ok = `gpg --list-keys #{gpg_arg}`
54
50
  gpg_cmd = 'gpg'
55
51
  end
56
- fail "No GPG user #{args.gpg}" if gpg_ok.empty?
52
+ fail "No GPG user #{gpg_arg}" if gpg_ok.empty?
57
53
  end.call
58
54
 
59
55
  task(:license).invoke
60
- task(:dependency).invoke
61
56
 
62
57
  # Need JRuby, Scala and Groovy installed to run all the specs.
63
58
  lambda do
64
- puts "Checking that we have JRuby, Scala and Groovy available ... "
65
- sh 'jruby --version'
66
- sh 'scala -version'
59
+ puts "Checking that we have Scala and Groovy available ... "
60
+ `scala -version`
61
+ $?.exitstatus == 1 or fail "Scala is not installed"
67
62
  sh 'groovy -version'
68
- puts "[X] We have JRuby, Scala and Groovy"
63
+ puts "[X] We have Scala and Groovy"
69
64
  end.call
70
65
 
71
66
  # Need Prince to generate PDF
@@ -84,11 +79,13 @@ task :prepare do |task, args|
84
79
  end.call
85
80
 
86
81
  # We will be speccing in one platform, so also spec the other one.
87
- task(RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby').invoke # Test the *other* platform
82
+ task('spec:ruby_1_9').invoke unless RUBY_VERSION >= '1.9' && !RUBY_PLATFORM[/java/]
83
+ task('spec:ruby_1_8').invoke unless RUBY_VERSION >= '1.8.7' && !RUBY_PLATFORM[/java/]
84
+ task('spec:jruby').invoke unless RUBY_PLATFORM[/java/]
88
85
  end
89
86
 
90
-
91
- task :stage=>['setup', 'doc:setup', :clobber, :prepare] do |task, args|
87
+ task :stage=>[:clobber, :prepare] do |task, args|
88
+ gpg_arg = args.gpg || ENV['gpg']
92
89
  mkpath '_staged'
93
90
 
94
91
  # Start by figuring out what has changed.
@@ -117,7 +114,7 @@ task :stage=>['setup', 'doc:setup', :clobber, :prepare] do |task, args|
117
114
  bytes = File.open(pkg, 'rb') { |file| file.read }
118
115
  File.open(pkg + '.md5', 'w') { |file| file.write Digest::MD5.hexdigest(bytes) << ' ' << File.basename(pkg) }
119
116
  File.open(pkg + '.sha1', 'w') { |file| file.write Digest::SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
120
- sh gpg_cmd, '--local-user', args.gpg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
117
+ sh gpg_cmd, '--local-user', gpg_arg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
121
118
  end
122
119
  cp 'etc/KEYS', '_staged/dist'
123
120
  puts "[X] Created and signed release packages in _staged/dist"
@@ -273,14 +273,14 @@ SRC
273
273
 
274
274
  it "defaults -classpath to compile path and dependencies" do
275
275
  @foo.packages[0].to_params['-classpath'].should include(@foo.compile.target.to_s)
276
- @foo.packages[0].to_params['-classpath'].should include(Buildr.artifacts(Buildr::Ant.dependencies[0]).to_s)
276
+ @foo.packages[0].to_params['-classpath'].should include(Buildr.artifact(Buildr::Ant.dependencies[0]).to_s)
277
277
  @bar.packages[0].to_params['-classpath'].should include(@bar.compile.target.to_s)
278
278
  end
279
279
 
280
280
  it "classpath method returns compile path and dependencies" do
281
281
  @foo.packages[0].classpath.should include(@foo.compile.target)
282
282
  Buildr::Ant.dependencies.each do |dependency|
283
- @foo.packages[0].classpath.to_s.should include(Buildr.artifacts(dependency).to_s)
283
+ @foo.packages[0].classpath.to_s.should include(Buildr.artifact(dependency).to_s)
284
284
  end
285
285
  @bar.packages[0].classpath.should include(@bar.compile.target)
286
286
  end
@@ -13,6 +13,7 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
+ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.6"
16
17
 
17
18
  require File.expand_path('../spec_helpers', File.dirname(__FILE__))
18
19
  Sandbox.require_optional_extension 'buildr/jaxb_xjc'
@@ -123,3 +124,7 @@ describe Buildr::JaxbXjc do
123
124
  end
124
125
  end
125
126
  end
127
+
128
+ elsif Buildr::VERSION >= '1.5'
129
+ raise "JVM version guard in #{__FILE__} should be removed since it is assumed that Java 1.5 is no longer supported."
130
+ end