buildr 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +35 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/buildr.buildfile +6 -1
- data/buildr.gemspec +10 -9
- data/doc/_config.yml +1 -0
- data/doc/_layouts/default.html +25 -19
- data/doc/artifacts.textile +0 -36
- data/doc/building.textile +0 -38
- data/doc/contributing.textile +51 -15
- data/doc/css/default.css +11 -4
- data/doc/css/print.css +32 -24
- data/doc/download.textile +2 -1
- data/doc/extending.textile +10 -20
- data/doc/images/1442160941-frontcover.jpg +0 -0
- data/doc/images/asf-logo.png +0 -0
- data/doc/images/note.png +0 -0
- data/doc/images/project-structure.png +0 -0
- data/doc/images/tip.png +0 -0
- data/doc/images/zbuildr.png +0 -0
- data/doc/index.textile +39 -17
- data/doc/{getting_started.textile → installing.textile} +2 -67
- data/doc/languages.textile +50 -52
- data/doc/more_stuff.textile +154 -62
- data/doc/packaging.textile +0 -82
- data/doc/preface.textile +41 -15
- data/doc/projects.textile +0 -18
- data/doc/quick_start.textile +210 -0
- data/doc/scripts/install-linux.sh +10 -2
- data/doc/settings_profiles.textile +1 -33
- data/doc/testing.textile +6 -32
- data/lib/buildr.rb +2 -1
- data/lib/buildr/core.rb +6 -0
- data/lib/buildr/core/application.rb +2 -5
- data/lib/buildr/core/build.rb +29 -19
- data/lib/buildr/core/compile.rb +22 -4
- data/lib/buildr/core/filter.rb +2 -4
- data/lib/buildr/core/project.rb +5 -4
- data/lib/buildr/core/shell.rb +198 -0
- data/lib/buildr/core/test.rb +2 -0
- data/lib/buildr/core/transports.rb +18 -19
- data/lib/buildr/core/util.rb +178 -9
- data/lib/buildr/groovy.rb +1 -0
- data/lib/buildr/groovy/bdd.rb +5 -5
- data/lib/buildr/groovy/shell.rb +48 -0
- data/lib/buildr/ide/eclipse.rb +148 -36
- data/lib/buildr/ide/eclipse/java.rb +53 -0
- data/lib/buildr/ide/eclipse/plugin.rb +68 -0
- data/lib/buildr/ide/eclipse/scala.rb +66 -0
- data/lib/buildr/java/bdd.rb +16 -8
- data/lib/buildr/java/cobertura.rb +44 -13
- data/lib/buildr/java/commands.rb +5 -3
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +18 -0
- data/lib/buildr/java/packaging.rb +2 -2
- data/lib/buildr/java/rjb.rb +1 -1
- data/lib/buildr/java/test_result.rb +48 -1
- data/lib/buildr/java/tests.rb +8 -5
- data/lib/buildr/packaging/artifact_namespace.rb +1 -1
- data/lib/buildr/packaging/package.rb +6 -2
- data/lib/buildr/packaging/zip.rb +10 -1
- data/lib/buildr/packaging/ziptask.rb +5 -2
- data/lib/buildr/scala.rb +1 -0
- data/lib/buildr/scala/bdd.rb +17 -8
- data/lib/buildr/scala/compiler.rb +66 -21
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +35 -0
- data/lib/buildr/scala/shell.rb +55 -0
- data/lib/buildr/scala/tests.rb +6 -5
- data/lib/buildr/shell.rb +180 -0
- data/rakelib/doc.rake +2 -3
- data/rakelib/jekylltask.rb +42 -32
- data/rakelib/package.rake +4 -2
- data/rakelib/rspec.rake +3 -3
- data/rakelib/setup.rake +7 -1
- data/rakelib/stage.rake +9 -2
- data/rakelib/stage.rake~ +213 -0
- data/spec/core/application_spec.rb +84 -1
- data/spec/core/build_spec.rb +54 -2
- data/spec/core/common_spec.rb +1 -1
- data/spec/core/compile_spec.rb +2 -1
- data/spec/core/extension_spec.rb +93 -0
- data/spec/core/test_spec.rb +2 -2
- data/spec/core/transport_spec.rb +1 -1
- data/spec/groovy/bdd_spec.rb +6 -6
- data/spec/groovy/compiler_spec.rb +1 -0
- data/spec/ide/eclipse_spec.rb +262 -72
- data/spec/java/{ant.rb → ant_spec.rb} +0 -0
- data/spec/java/bdd_spec.rb +15 -0
- data/spec/java/cobertura_spec.rb +9 -1
- data/spec/java/emma_spec.rb +1 -1
- data/spec/java/java_spec.rb +26 -0
- data/spec/java/packaging_spec.rb +9 -7
- data/spec/java/{test_coverage_spec.rb → test_coverage_helper.rb} +6 -4
- data/spec/java/tests_spec.rb +22 -0
- data/spec/packaging/archive_spec.rb +14 -0
- data/spec/packaging/artifact_spec.rb +2 -2
- data/spec/packaging/packaging_spec.rb +97 -2
- data/spec/sandbox.rb +3 -1
- data/spec/scala/bdd_spec.rb +17 -48
- data/spec/scala/compiler_spec.rb +31 -2
- data/spec/scala/tests_spec.rb +1 -0
- data/spec/spec_helpers.rb +12 -0
- metadata +145 -148
@@ -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
|
+
|
17
|
+
require 'buildr/core/project'
|
18
|
+
require 'buildr/core/common'
|
19
|
+
|
20
|
+
module Buildr
|
21
|
+
module Eclipse
|
22
|
+
module Java
|
23
|
+
include Extension
|
24
|
+
|
25
|
+
NATURE = 'org.eclipse.jdt.core.javanature'
|
26
|
+
CONTAINER = 'org.eclipse.jdt.launching.JRE_CONTAINER'
|
27
|
+
BUILDER = 'org.eclipse.jdt.core.javabuilder'
|
28
|
+
|
29
|
+
after_define do |project|
|
30
|
+
eclipse = project.eclipse
|
31
|
+
|
32
|
+
# smart defaults
|
33
|
+
if project.compile.language == :java || project.test.compile.language == :java
|
34
|
+
eclipse.natures = NATURE if eclipse.natures.empty?
|
35
|
+
eclipse.classpath_containers = CONTAINER if eclipse.classpath_containers.empty?
|
36
|
+
eclipse.builders = BUILDER if eclipse.builders.empty?
|
37
|
+
end
|
38
|
+
|
39
|
+
# :java nature explicitly set
|
40
|
+
if eclipse.natures.include? :java
|
41
|
+
eclipse.natures += NATURE unless eclipse.natures.include? NATURE
|
42
|
+
eclipse.classpath_containers += CONTAINER unless eclipse.classpath_containers.include? CONTAINER
|
43
|
+
eclipse.builders += BUILDER unless eclipse.builders.include? BUILDER
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class Buildr::Project
|
52
|
+
include Buildr::Eclipse::Java
|
53
|
+
end
|
@@ -0,0 +1,68 @@
|
|
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 'buildr/core/project'
|
18
|
+
require 'buildr/core/common'
|
19
|
+
|
20
|
+
module Buildr
|
21
|
+
module Eclipse
|
22
|
+
module Plugin
|
23
|
+
include Extension
|
24
|
+
|
25
|
+
NATURE = 'org.eclipse.pde.PluginNature'
|
26
|
+
CONTAINER = 'org.eclipse.pde.core.requiredPlugins'
|
27
|
+
BUILDERS = ['org.eclipse.pde.ManifestBuilder', 'org.eclipse.pde.SchemaBuilder']
|
28
|
+
|
29
|
+
after_define do |project|
|
30
|
+
eclipse = project.eclipse
|
31
|
+
|
32
|
+
# smart defaults
|
33
|
+
if eclipse.natures.empty? && ((File.exists? project.path_to("plugin.xml")) || (File.exists? project.path_to("OSGI-INF")))
|
34
|
+
eclipse.natures = [NATURE, Buildr::Eclipse::Java::NATURE]
|
35
|
+
eclipse.classpath_containers = [CONTAINER, Buildr::Eclipse::Java::CONTAINER] if eclipse.classpath_containers.empty?
|
36
|
+
eclipse.builders = BUILDERS + [Buildr::Eclipse::Java::BUILDER] if eclipse.builders.empty?
|
37
|
+
end
|
38
|
+
|
39
|
+
# :plugin nature explicitly set
|
40
|
+
if eclipse.natures.include? :plugin
|
41
|
+
unless eclipse.natures.include? NATURE
|
42
|
+
# plugin nature must be before java nature
|
43
|
+
eclipse.natures += [Buildr::Eclipse::Java::NATURE] unless eclipse.natures.include? Buildr::Eclipse::Java::NATURE
|
44
|
+
index = eclipse.natures.index(Buildr::Eclipse::Java::NATURE) || -1
|
45
|
+
eclipse.natures = eclipse.natures.insert(index, NATURE)
|
46
|
+
end
|
47
|
+
unless eclipse.classpath_containers.include? CONTAINER
|
48
|
+
# plugin container must be before java container
|
49
|
+
index = eclipse.classpath_containers.index(Buildr::Eclipse::Java::CONTAINER) || -1
|
50
|
+
eclipse.classpath_containers = eclipse.classpath_containers.insert(index, CONTAINER)
|
51
|
+
end
|
52
|
+
unless (eclipse.builders.include?(BUILDER[0]) && eclipse.builders.include?(BUILDER[1]))
|
53
|
+
# plugin builder must be before java builder
|
54
|
+
index = eclipse.classpath_containers.index(Buildr::Eclipse::Java::BUILDER) || -1
|
55
|
+
eclipse.builders = eclipse.builders.insert(index, BUILDER[1]) unless eclipse.builders.include? BUILDER[1]
|
56
|
+
index = eclipse.classpath_containers.index(BUILDER[1]) || -1
|
57
|
+
eclipse.builders = eclipse.builders.insert(index, BUILDER[0]) unless eclipse.builders.include? BUILDER[0]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class Buildr::Project
|
67
|
+
include Buildr::Eclipse::Plugin
|
68
|
+
end
|
@@ -0,0 +1,66 @@
|
|
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 'buildr/core/project'
|
18
|
+
require 'buildr/core/common'
|
19
|
+
|
20
|
+
module Buildr
|
21
|
+
module Eclipse
|
22
|
+
module Scala
|
23
|
+
include Extension
|
24
|
+
|
25
|
+
NATURE = 'ch.epfl.lamp.sdt.core.scalanature'
|
26
|
+
CONTAINER = 'ch.epfl.lamp.sdt.launching.SCALA_CONTAINER'
|
27
|
+
BUILDER = 'ch.epfl.lamp.sdt.core.scalabuilder'
|
28
|
+
|
29
|
+
after_define do |project|
|
30
|
+
eclipse = project.eclipse
|
31
|
+
|
32
|
+
# smart defaults
|
33
|
+
if eclipse.natures.empty? && (project.compile.language == :scala || project.test.compile.language == :scala)
|
34
|
+
eclipse.natures = [NATURE, Buildr::Eclipse::Java::NATURE]
|
35
|
+
eclipse.classpath_containers = [CONTAINER, Buildr::Eclipse::Java::CONTAINER] if eclipse.classpath_containers.empty?
|
36
|
+
eclipse.builders = BUILDER if eclipse.builders.empty?
|
37
|
+
end
|
38
|
+
|
39
|
+
# :scala nature explicitly set
|
40
|
+
if eclipse.natures.include? :scala
|
41
|
+
unless eclipse.natures.include? NATURE
|
42
|
+
# scala nature must be before java nature
|
43
|
+
eclipse.natures += [Buildr::Eclipse::Java::NATURE] unless eclipse.natures.include? Buildr::Eclipse::Java::NATURE
|
44
|
+
index = eclipse.natures.index(Buildr::Eclipse::Java::NATURE) || -1
|
45
|
+
eclipse.natures = eclipse.natures.insert(index, NATURE)
|
46
|
+
end
|
47
|
+
unless eclipse.classpath_containers.include? CONTAINER
|
48
|
+
# scala container must be before java container
|
49
|
+
index = eclipse.classpath_containers.index(Buildr::Eclipse::Java::CONTAINER) || -1
|
50
|
+
eclipse.classpath_containers = eclipse.classpath_containers.insert(index, CONTAINER)
|
51
|
+
end
|
52
|
+
unless eclipse.builders.include? BUILDER
|
53
|
+
# scala builder overrides java builder
|
54
|
+
eclipse.builders -= [Buildr::Eclipse::Java::BUILDER]
|
55
|
+
eclipse.builders += [BUILDER]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class Buildr::Project
|
65
|
+
include Buildr::Eclipse::Scala
|
66
|
+
end
|
data/lib/buildr/java/bdd.rb
CHANGED
@@ -48,7 +48,7 @@ module Buildr
|
|
48
48
|
module TestFramework::JRubyBased
|
49
49
|
extend self
|
50
50
|
|
51
|
-
VERSION = '1.1
|
51
|
+
VERSION = '1.3.1'
|
52
52
|
|
53
53
|
class << self
|
54
54
|
def version
|
@@ -94,7 +94,7 @@ module Buildr
|
|
94
94
|
|
95
95
|
Buildr.write(runner.file, runner.content)
|
96
96
|
rm_f runner.result
|
97
|
-
|
97
|
+
|
98
98
|
if RUBY_PLATFORM[/java/] && !options.fork
|
99
99
|
runtime = new_runtime
|
100
100
|
runtime.getObject.java.lang.System.getProperties().putAll(options[:properties] || {})
|
@@ -109,7 +109,7 @@ module Buildr
|
|
109
109
|
if Exception === result
|
110
110
|
raise [result.message, result.backtrace].flatten.join("\n")
|
111
111
|
end
|
112
|
-
result.
|
112
|
+
tests - result.failed
|
113
113
|
end
|
114
114
|
|
115
115
|
def jruby_home
|
@@ -201,9 +201,13 @@ module Buildr
|
|
201
201
|
runner.gems ||= {}
|
202
202
|
runner.rspec ||= ['--format', 'progress', '--format', "html:#{runner.html_report}"]
|
203
203
|
runner.format.each { |format| runner.rspec << '--format' << format } if runner.format
|
204
|
-
runner.rspec.push '--format', "
|
204
|
+
runner.rspec.push '--format', "#{runner_formatter}:#{runner.result}"
|
205
205
|
runner
|
206
|
-
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def runner_formatter
|
209
|
+
"Buildr::TestFramework::TestResult::YamlFormatter"
|
210
|
+
end
|
207
211
|
|
208
212
|
end
|
209
213
|
|
@@ -236,8 +240,7 @@ module Buildr
|
|
236
240
|
end
|
237
241
|
|
238
242
|
def tests(dependencies) #:nodoc:
|
239
|
-
Dir[task.project.path_to(:source, bdd_dir, lang, '**/*_spec.rb')].
|
240
|
-
select do |name|
|
243
|
+
Dir[task.project.path_to(:source, bdd_dir, lang, '**/*_spec.rb')].select do |name|
|
241
244
|
selector = ENV['SPEC']
|
242
245
|
selector.nil? || Regexp.new(selector) === name
|
243
246
|
end
|
@@ -268,7 +271,8 @@ module Buildr
|
|
268
271
|
argv.push *<%= tests.inspect %>
|
269
272
|
parser.order!(argv)
|
270
273
|
$rspec_options = parser.options
|
271
|
-
|
274
|
+
|
275
|
+
Buildr::TestFramework::TestResult::Error.guard('<%= runner.result %>') do
|
272
276
|
::Spec::Runner::CommandLine.run($rspec_options)
|
273
277
|
end
|
274
278
|
exit 0 # let buildr figure the result from the yaml file
|
@@ -379,6 +383,10 @@ module Buildr
|
|
379
383
|
Filter::Mapper.new(:erb, binding).transform(File.read(runner_erb), runner_erb)
|
380
384
|
end
|
381
385
|
|
386
|
+
def runner_formatter
|
387
|
+
'Buildr::TestFramework::TestResult::JtestRYamlFormatter'
|
388
|
+
end
|
389
|
+
|
382
390
|
end
|
383
391
|
|
384
392
|
|
@@ -19,7 +19,7 @@ require 'buildr/java'
|
|
19
19
|
|
20
20
|
module Buildr
|
21
21
|
|
22
|
-
# Provides the <code>cobertura:html</code> and <code>cobertura:
|
22
|
+
# Provides the <code>cobertura:html</code>, <code>cobertura:xml</code> and <code>cobertura:check</code> tasks.
|
23
23
|
# Require explicitly using <code>require "buildr/cobertura"</code>.
|
24
24
|
#
|
25
25
|
# You can generate cobertura reports for a single project
|
@@ -37,6 +37,7 @@ module Buildr
|
|
37
37
|
# cobertura.exclude 'some.foo.util.SimpleUtil'
|
38
38
|
# cobertura.exclude /*.Const(ants)?/i
|
39
39
|
# end
|
40
|
+
#
|
40
41
|
module Cobertura
|
41
42
|
|
42
43
|
VERSION = '1.9'
|
@@ -70,7 +71,7 @@ module Buildr
|
|
70
71
|
|
71
72
|
attr_reader :project
|
72
73
|
private :project
|
73
|
-
|
74
|
+
|
74
75
|
attr_writer :data_file, :instrumented_dir, :report_dir
|
75
76
|
|
76
77
|
def data_file
|
@@ -116,6 +117,15 @@ module Buildr
|
|
116
117
|
def sources
|
117
118
|
project.compile.sources
|
118
119
|
end
|
120
|
+
|
121
|
+
def check
|
122
|
+
@check ||= CoberturaCheck.new
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
class CoberturaCheck
|
127
|
+
attr_writer :branch_rate, :line_rate, :total_branch_rate, :total_line_rate, :package_line_rate, :package_branch_rate
|
128
|
+
attr_reader :branch_rate, :line_rate, :total_branch_rate, :total_line_rate, :package_line_rate, :package_branch_rate
|
119
129
|
end
|
120
130
|
|
121
131
|
module CoberturaExtension # :nodoc:
|
@@ -171,23 +181,44 @@ module Buildr
|
|
171
181
|
project.test.with Cobertura.dependencies
|
172
182
|
project.test.options[:properties]["net.sourceforge.cobertura.datafile"] = cobertura.data_file
|
173
183
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
ant
|
179
|
-
:
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
+
unless project.compile.sources.empty?
|
185
|
+
[:xml, :html].each do |format|
|
186
|
+
task format => ['instrument', 'test'] do
|
187
|
+
info "Creating test coverage reports in #{cobertura.report_to(format)}"
|
188
|
+
Buildr.ant "cobertura" do |ant|
|
189
|
+
ant.taskdef :resource=>"tasks.properties",
|
190
|
+
:classpath=>Buildr.artifacts(Cobertura.dependencies).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
|
191
|
+
ant.send "cobertura-report", :format=>format,
|
192
|
+
:destdir=>cobertura.report_to(format), :datafile=>cobertura.data_file do
|
193
|
+
cobertura.sources.flatten.each do |src|
|
194
|
+
ant.fileset(:dir=>src.to_s) if File.exist?(src.to_s)
|
195
|
+
end
|
184
196
|
end
|
185
197
|
end
|
186
198
|
end
|
187
199
|
end
|
188
200
|
end
|
201
|
+
|
202
|
+
task :check => [:instrument, :test] do
|
203
|
+
Buildr.ant "cobertura" do |ant|
|
204
|
+
ant.taskdef :classpath=>Cobertura.requires.join(File::PATH_SEPARATOR), :resource=>"tasks.properties"
|
205
|
+
|
206
|
+
params = { :datafile => Cobertura.data_file }
|
207
|
+
|
208
|
+
# oh so ugly...
|
209
|
+
params[:branchrate] = cobertura.check.branch_rate if cobertura.check.branch_rate
|
210
|
+
params[:linerate] = cobertura.check.line_rate if cobertura.check.line_rate
|
211
|
+
params[:totalbranchrate] = cobertura.check.total_branch_rate if cobertura.check.total_branch_rate
|
212
|
+
params[:totallinerate] = cobertura.check.total_line_rate if cobertura.check.total_line_rate
|
213
|
+
params[:packagebranchrate] = cobertura.check.package_branch_rate if cobertura.check.package_branch_rate
|
214
|
+
params[:packagelinerate] = cobertura.check.package_line_rate if cobertura.check.package_line_rate
|
215
|
+
|
216
|
+
ant.send("cobertura-check", params) do
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
189
221
|
end
|
190
|
-
|
191
222
|
end
|
192
223
|
|
193
224
|
project.clean do
|
data/lib/buildr/java/commands.rb
CHANGED
@@ -51,8 +51,8 @@ module Java
|
|
51
51
|
block = lambda { |ok, res| fail "Failed to execute #{name}, see errors above" unless ok } unless block
|
52
52
|
puts cmd_args.join(' ') if Buildr.application.options.trace
|
53
53
|
cmd_args = cmd_args.map(&:inspect).join(' ') if Util.win_os?
|
54
|
-
|
55
|
-
block.call ok,
|
54
|
+
sh(*cmd_args) do |ok, ps|
|
55
|
+
block.call ok, ps
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -190,7 +190,9 @@ module Java
|
|
190
190
|
# Returns the path to the specified Java command (with no argument to java itself).
|
191
191
|
def path_to_bin(name = nil)
|
192
192
|
home = ENV['JAVA_HOME'] or fail 'Are we forgetting something? JAVA_HOME not set.'
|
193
|
-
File.expand_path(File.join(home, 'bin'
|
193
|
+
bin = File.expand_path(File.join(home, 'bin'))
|
194
|
+
fail 'JAVA_HOME environment variable does not point to a valid JRE/JDK installation.' unless File.exist? bin
|
195
|
+
File.expand_path(File.join(bin, name.to_s))
|
194
196
|
end
|
195
197
|
|
196
198
|
# :call-seq:
|
Binary file
|
@@ -18,6 +18,7 @@
|
|
18
18
|
package org.apache.buildr;
|
19
19
|
|
20
20
|
import java.lang.reflect.Method;
|
21
|
+
import java.lang.reflect.Field;
|
21
22
|
import java.lang.reflect.Modifier;
|
22
23
|
import java.io.File;
|
23
24
|
import java.io.IOException;
|
@@ -33,6 +34,7 @@ public class JavaTestFilter {
|
|
33
34
|
private Vector methodAnnotations = new Vector();
|
34
35
|
private Vector classAnnotations = new Vector();
|
35
36
|
private Vector interfaces = new Vector();
|
37
|
+
private Vector fieldNames = new Vector();
|
36
38
|
|
37
39
|
public JavaTestFilter(String[] paths) throws IOException {
|
38
40
|
URL[] urls = new URL[paths.length];
|
@@ -70,6 +72,14 @@ public class JavaTestFilter {
|
|
70
72
|
return this;
|
71
73
|
}
|
72
74
|
|
75
|
+
public JavaTestFilter addFields(String[] names) {
|
76
|
+
for (int i = names.length; i -- > 0;) {
|
77
|
+
String name = names[i];
|
78
|
+
fieldNames.add(name);
|
79
|
+
}
|
80
|
+
return this;
|
81
|
+
}
|
82
|
+
|
73
83
|
private boolean isTest(Class cls) {
|
74
84
|
if (Modifier.isAbstract(cls.getModifiers()) || !Modifier.isPublic(cls.getModifiers()))
|
75
85
|
return false;
|
@@ -94,6 +104,14 @@ public class JavaTestFilter {
|
|
94
104
|
}
|
95
105
|
}
|
96
106
|
}
|
107
|
+
if (fieldNames != null) {
|
108
|
+
Field[] fields = cls.getFields();
|
109
|
+
for (int j = 0; j < fields.length; j++) {
|
110
|
+
for (Iterator it = fieldNames.iterator(); it.hasNext(); ) {
|
111
|
+
if (fields[j].getName().equals(it.next())) { return true; }
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
97
115
|
return false;
|
98
116
|
}
|
99
117
|
|
@@ -39,7 +39,7 @@ module Buildr
|
|
39
39
|
sections = str.split(SECTION_SEPARATOR).reject { |s| s.strip.empty? }
|
40
40
|
new sections.map { |section|
|
41
41
|
lines = section.split(LINE_SEPARATOR).inject([]) { |merged, line|
|
42
|
-
if line[
|
42
|
+
if line[/^ /] == ' '
|
43
43
|
merged.last << line[1..-1]
|
44
44
|
else
|
45
45
|
merged << line
|
@@ -302,7 +302,7 @@ module Buildr
|
|
302
302
|
@wsdls = []
|
303
303
|
prepare do
|
304
304
|
path('META-INF').include @wsdls
|
305
|
-
path('META-INF').include @services_xml, :as=>
|
305
|
+
path('META-INF').include @services_xml, :as=>'services.xml' if @services_xml
|
306
306
|
path('lib').include Buildr.artifacts(@libs) unless @libs.nil? || @libs.empty?
|
307
307
|
end
|
308
308
|
end
|
data/lib/buildr/java/rjb.rb
CHANGED
@@ -134,7 +134,7 @@ module Java
|
|
134
134
|
|
135
135
|
def __package__(name) #:nodoc:
|
136
136
|
const = name.split('.').map { |part| part.gsub(/^./) { |char| char.upcase } }.join
|
137
|
-
return const_get(const) if constants.include?(const)
|
137
|
+
return const_get(const) if constants.include?(const) || constants.include?(const.to_sym)
|
138
138
|
package = Module.new
|
139
139
|
package.extend Package
|
140
140
|
package.instance_variable_set :@name, name
|