buildr 1.4.7.pre2-java → 1.4.8-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.
- data/CHANGELOG +65 -2
- data/Rakefile +3 -6
- data/addon/buildr/bnd.rb +13 -3
- data/addon/buildr/{checkstyle.rake → checkstyle.rb} +1 -1
- data/addon/buildr/{findbugs.rake → findbugs.rb} +0 -0
- data/addon/buildr/git_auto_version.rb +33 -0
- data/addon/buildr/gwt.rb +82 -0
- data/addon/buildr/jacoco.rb +194 -0
- data/addon/buildr/{javancss.rake → javancss.rb} +0 -0
- data/addon/buildr/nailgun.rb +2 -2
- data/addon/buildr/{pmd.rake → pmd.rb} +3 -1
- data/addon/buildr/sonar.rb +142 -0
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +37 -26
- data/doc/_layouts/default.html +0 -2
- data/doc/contributing.textile +47 -0
- data/doc/download.textile +24 -0
- data/doc/index.textile +43 -23
- data/doc/languages.textile +65 -6
- data/doc/more_stuff.textile +43 -0
- data/doc/packaging.textile +2 -0
- data/doc/settings_profiles.textile +1 -1
- data/etc/KEYS +44 -0
- data/lib/buildr.rb +3 -7
- data/lib/buildr/core/application.rb +41 -8
- data/lib/buildr/core/build.rb +102 -1
- data/lib/buildr/core/cc.rb +14 -8
- data/lib/buildr/core/doc.rb +9 -3
- data/lib/buildr/core/generate.rb +150 -9
- data/lib/buildr/core/run.rb +1 -1
- data/lib/buildr/core/shell.rb +1 -1
- data/lib/buildr/core/test.rb +1 -1
- data/lib/buildr/core/util.rb +5 -5
- data/lib/buildr/ide/eclipse.rb +118 -4
- data/lib/buildr/ide/idea.rb +278 -1
- data/lib/buildr/java/ant.rb +2 -3
- data/lib/buildr/java/bdd.rb +4 -4
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/pom.rb +5 -4
- data/lib/buildr/java/rjb.rb +5 -4
- data/lib/buildr/java/test_result.rb +4 -0
- data/lib/buildr/packaging/artifact.rb +1 -1
- data/lib/buildr/packaging/version_requirement.rb +1 -1
- data/lib/buildr/packaging/zip.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -2
- data/lib/buildr/run.rb +3 -2
- data/lib/buildr/scala.rb +1 -1
- data/lib/buildr/scala/bdd.rb +9 -2
- data/lib/buildr/scala/compiler.rb +94 -4
- data/lib/buildr/scala/doc.rb +17 -5
- data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
- data/lib/buildr/scala/tests.rb +15 -4
- data/lib/buildr/version.rb +1 -1
- data/rakelib/all-in-one.rake +50 -47
- data/rakelib/checks.rake +4 -4
- data/rakelib/doc.rake +84 -87
- data/rakelib/metrics.rake +9 -9
- data/rakelib/package.rake +14 -35
- data/rakelib/release.rake +11 -12
- data/rakelib/rspec.rake +73 -60
- data/rakelib/stage.rake +32 -54
- data/spec/addon/bnd_spec.rb +61 -7
- data/spec/core/application_spec.rb +1 -1
- data/spec/core/build_spec.rb +117 -0
- data/spec/core/cc_spec.rb +37 -15
- data/spec/core/common_spec.rb +3 -2
- data/spec/core/compile_spec.rb +3 -3
- data/spec/core/doc_spec.rb +1 -1
- data/spec/core/generate_from_eclipse_spec.rb +280 -0
- data/spec/core/run_spec.rb +17 -4
- data/spec/core/test_spec.rb +5 -3
- data/spec/ide/idea_spec.rb +2 -2
- data/spec/java/bdd_spec.rb +2 -2
- data/spec/java/cobertura_spec.rb +4 -0
- data/spec/java/emma_spec.rb +4 -1
- data/spec/java/java_spec.rb +1 -1
- data/spec/java/packaging_spec.rb +2 -1
- data/spec/java/pom_spec.rb +125 -0
- data/spec/packaging/archive_spec.rb +25 -2
- data/spec/packaging/artifact_spec.rb +3 -3
- data/spec/sandbox.rb +7 -2
- data/spec/scala/compiler_spec.rb +41 -0
- data/spec/scala/doc_spec.rb +22 -3
- data/spec/scala/scala.rb +2 -2
- data/spec/scala/tests_spec.rb +2 -2
- data/spec/spec_helpers.rb +6 -1
- data/spec/version_requirement_spec.rb +2 -0
- metadata +651 -480
- data/lib/buildr/ide/eclipse/java.rb +0 -49
- data/lib/buildr/ide/eclipse/plugin.rb +0 -67
- data/lib/buildr/ide/eclipse/scala.rb +0 -64
data/spec/core/common_spec.rb
CHANGED
@@ -542,10 +542,11 @@ describe Buildr::Filter do
|
|
542
542
|
|
543
543
|
it 'should preserve mode bits except readable' do
|
544
544
|
# legacy: pending "Pending the release of the fix for JRUBY-4927" if RUBY_PLATFORM =~ /java/
|
545
|
-
|
545
|
+
mode = 0o600
|
546
|
+
Dir['src/*'].each { |file| File.chmod(mode, file) }
|
546
547
|
@filter.from('src').into('target').run
|
547
548
|
Dir['target/*'].sort.each do |file|
|
548
|
-
(File.stat(file).mode &
|
549
|
+
(File.stat(file).mode & mode).should == mode
|
549
550
|
end
|
550
551
|
end
|
551
552
|
end
|
data/spec/core/compile_spec.rb
CHANGED
@@ -586,7 +586,7 @@ describe Project, '#resources' do
|
|
586
586
|
it 'should copy new resources to target directory' do
|
587
587
|
time = Time.now
|
588
588
|
mkdir_p 'target/resources'
|
589
|
-
File.utime(time-
|
589
|
+
File.utime(time-10, time-10, 'target/resources')
|
590
590
|
|
591
591
|
write 'src/main/resources/foo', 'Foo'
|
592
592
|
|
@@ -599,8 +599,8 @@ describe Project, '#resources' do
|
|
599
599
|
time = Time.now
|
600
600
|
mkdir_p 'target/resources'
|
601
601
|
write 'target/resources/foo', 'Foo'
|
602
|
-
File.utime(time-
|
603
|
-
File.utime(time-
|
602
|
+
File.utime(time-10, time-10, 'target/resources')
|
603
|
+
File.utime(time-10, time-10, 'target/resources/foo')
|
604
604
|
|
605
605
|
write 'src/main/resources/foo', 'Foo2'
|
606
606
|
define('foo')
|
data/spec/core/doc_spec.rb
CHANGED
@@ -124,7 +124,7 @@ describe Project, '#doc' do
|
|
124
124
|
compile.using(:javac)
|
125
125
|
doc.include included
|
126
126
|
end
|
127
|
-
project('foo').doc.source_files.should include(included)
|
127
|
+
project('foo').doc.source_files.should include(File.expand_path(included))
|
128
128
|
end
|
129
129
|
|
130
130
|
it 'should respond to exclude() and return self' do
|
@@ -0,0 +1,280 @@
|
|
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
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
17
|
+
|
18
|
+
module EclipseHelper
|
19
|
+
|
20
|
+
def setupExample(group, projectName, options = {})
|
21
|
+
options[:symName] ? symName = options[:symName] :symName = File.basename(projectName)
|
22
|
+
requiredPlugins = nil
|
23
|
+
if options[:requires]
|
24
|
+
requiredPlugins = "Require-Bundle: #{options[:requires]};bundle-version=\"1.1.0\",\n"
|
25
|
+
end
|
26
|
+
write "#{group}/#{projectName}/META-INF/MANIFEST.MF", <<-MANIFEST
|
27
|
+
Manifest-Version: 1.0
|
28
|
+
Name: #{projectName}
|
29
|
+
Bundle-Version: 1.1
|
30
|
+
Specification-Title: "Examples for #{File.basename(projectName)}"
|
31
|
+
Specification-Version: "1.0"
|
32
|
+
Specification-Vendor: "Acme Corp.".
|
33
|
+
Implementation-Title: "#{File.basename(projectName)}"
|
34
|
+
Implementation-Version: "build57"
|
35
|
+
Implementation-Vendor: "Acme Corp."
|
36
|
+
Bundle-SymbolicName: #{symName}
|
37
|
+
#{requiredPlugins}
|
38
|
+
MANIFEST
|
39
|
+
write "#{group}/#{projectName}/.project", <<-DOT_PROJECT
|
40
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
41
|
+
<projectDescription>
|
42
|
+
<name>#{File.basename(projectName)}</name>
|
43
|
+
<comment></comment>
|
44
|
+
<projects>
|
45
|
+
</projects>
|
46
|
+
<buildSpec>
|
47
|
+
<buildCommand>
|
48
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
49
|
+
<arguments>
|
50
|
+
</arguments>
|
51
|
+
</buildCommand>
|
52
|
+
<buildCommand>
|
53
|
+
<name>org.eclipse.pde.ManifestBuilder</name>
|
54
|
+
<arguments>
|
55
|
+
</arguments>
|
56
|
+
</buildCommand>
|
57
|
+
<buildCommand>
|
58
|
+
<name>org.eclipse.pde.SchemaBuilder</name>
|
59
|
+
<arguments>
|
60
|
+
</arguments>
|
61
|
+
</buildCommand>
|
62
|
+
</buildSpec>
|
63
|
+
<natures>
|
64
|
+
<nature>org.eclipse.pde.PluginNature</nature>
|
65
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
66
|
+
</natures>
|
67
|
+
</projectDescription>
|
68
|
+
DOT_PROJECT
|
69
|
+
|
70
|
+
write "#{group}/#{projectName}/.classpath", <<-DOT_CLASSPATH
|
71
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
72
|
+
<classpath>
|
73
|
+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
74
|
+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
75
|
+
<classpathentry kind="src" path="src"/>
|
76
|
+
<classpathentry combineaccessrules="false" kind="src" path="/another.plugin"/>
|
77
|
+
<classpathentry kind="output" path="bin"/>
|
78
|
+
</classpath>
|
79
|
+
DOT_CLASSPATH
|
80
|
+
|
81
|
+
write "#{group}/#{projectName}/plugin.xml", <<-PLUGIN_XML
|
82
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
83
|
+
<?eclipse version="3.0"?>
|
84
|
+
<plugin>
|
85
|
+
<!--some comment
|
86
|
+
-->
|
87
|
+
</plugin>
|
88
|
+
PLUGIN_XML
|
89
|
+
write "#{group}/#{projectName}/build.properties", <<-BUILD_PROPERTIES
|
90
|
+
source.. = src/
|
91
|
+
output.. = bin/
|
92
|
+
javacDefaultEncoding.. = UTF-8
|
93
|
+
bin.includes = META-INF/,\
|
94
|
+
.,\
|
95
|
+
plugin.xml,\
|
96
|
+
rsc/,
|
97
|
+
BUILD_PROPERTIES
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe Buildr::Generate do
|
102
|
+
include EclipseHelper
|
103
|
+
describe 'it should find a single eclipse project' do
|
104
|
+
top = "top_#{__LINE__}"
|
105
|
+
|
106
|
+
before do
|
107
|
+
setupExample(top, 'single')
|
108
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'should create a valid buildfile' do
|
112
|
+
define('first')
|
113
|
+
File.exists?(File.join(top, 'single', '.project')).should be_true
|
114
|
+
File.exists?(File.join(top, '.project')).should be_false
|
115
|
+
File.exists?('.project').should be_false
|
116
|
+
buildFile = File.join(top, 'buildfile')
|
117
|
+
file(buildFile).should exist
|
118
|
+
file(buildFile).should contain("GROUP = \"#{top}\"")
|
119
|
+
lambda { Buildr.application.run }.should_not raise_error
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should not add project if the corresponding .project file is not an eclipse project" do
|
123
|
+
buildFile = File.join(top, 'buildfile')
|
124
|
+
FileUtils.rm(buildFile)
|
125
|
+
write File.join(top, 'myproject', '.project'), '# Dummy file'
|
126
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
127
|
+
file(buildFile).should exist
|
128
|
+
file(buildFile).should contain('define "single"')
|
129
|
+
file(buildFile).should_not contain('define "myproject"')
|
130
|
+
lambda { Buildr.application.run }.should_not raise_error
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'should honour Bundle-Version in MANIFEST.MF' do
|
134
|
+
define('bundle_version')
|
135
|
+
buildFile = File.join(top, 'buildfile')
|
136
|
+
file(buildFile).should exist
|
137
|
+
file(buildFile).should contain('define "single"')
|
138
|
+
file(buildFile).should contain('define "single", :version => "1.1"')
|
139
|
+
lambda { Buildr.application.run }.should_not raise_error
|
140
|
+
end
|
141
|
+
|
142
|
+
it "should pass source in build.properties to layout[:source, :main, :java] and layout[:source, :main, :scala]" do
|
143
|
+
define('layout_source')
|
144
|
+
buildFile = File.join(top, 'buildfile')
|
145
|
+
file(buildFile).should exist
|
146
|
+
file(buildFile).should contain('define')
|
147
|
+
file(buildFile).should contain('define "single"')
|
148
|
+
file(buildFile).should contain('layout[:source, :main, :java]')
|
149
|
+
file(buildFile).should contain('layout[:source, :main, :scala]')
|
150
|
+
lambda { Buildr.application.run }.should_not raise_error
|
151
|
+
end
|
152
|
+
|
153
|
+
it "should pass output in build.properties to layout[:target, :main], etc" do
|
154
|
+
define('layout_target')
|
155
|
+
buildFile = File.join(top, 'buildfile')
|
156
|
+
file(buildFile).should exist
|
157
|
+
file(buildFile).should contain('define')
|
158
|
+
file(buildFile).should contain('define "single"')
|
159
|
+
file(buildFile).should contain('layout[:target, :main]')
|
160
|
+
file(buildFile).should contain('layout[:target, :main, :java]')
|
161
|
+
file(buildFile).should contain('layout[:target, :main, :scala]')
|
162
|
+
lambda { Buildr.application.run }.should_not raise_error
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should package an eclipse plugin" do
|
166
|
+
define('layout_target')
|
167
|
+
buildFile = File.join(top, 'buildfile')
|
168
|
+
file(buildFile).should exist
|
169
|
+
file(buildFile).should contain('define')
|
170
|
+
file(buildFile).should contain('package(:jar)')
|
171
|
+
lambda { Buildr.application.run }.should_not raise_error
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
175
|
+
|
176
|
+
describe 'it should check for a SymbolicName in MANIFEST.MF' do
|
177
|
+
top = "top_#{__LINE__}"
|
178
|
+
before do
|
179
|
+
setupExample(top, 'single', { :symName => 'singleSymbolicName'} )
|
180
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
181
|
+
end
|
182
|
+
it "should set the project name to the SymbolicName from the MANIFEST.MF" do
|
183
|
+
buildFile = File.join(top, 'buildfile')
|
184
|
+
file(buildFile).should exist
|
185
|
+
file(buildFile).should contain('define "singleSymbolicName"')
|
186
|
+
lambda { Buildr.application.run }.should_not raise_error
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
describe 'it should accecpt singleton SymbolicName in MANIFEST.MF' do
|
191
|
+
top = "top_#{__LINE__}"
|
192
|
+
before do
|
193
|
+
setupExample(top, 'single', { :symName => 'singleSymbolicName;singleton:=true'})
|
194
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
195
|
+
end
|
196
|
+
|
197
|
+
it "should not get confused if SymbolicName in MANIFEST.MF is a singleton:=true" do
|
198
|
+
buildFile = File.join(top, 'buildfile')
|
199
|
+
file(buildFile).should exist
|
200
|
+
file(buildFile).should contain('define "singleSymbolicName"')
|
201
|
+
lambda { Buildr.application.run }.should_not raise_error
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
describe 'it should find an eclipse project deep' do
|
206
|
+
top = "top_#{__LINE__}"
|
207
|
+
before do
|
208
|
+
setupExample(top, 'nested/single')
|
209
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
210
|
+
end
|
211
|
+
|
212
|
+
it 'should create a valid buildfile for a nested project' do
|
213
|
+
setupExample(top, 'single')
|
214
|
+
define('nested/second')
|
215
|
+
File.exists?(File.join(top, 'single', '.project')).should be_true
|
216
|
+
File.exists?(File.join(top, '.project')).should be_false
|
217
|
+
File.exists?('.project').should be_false
|
218
|
+
buildFile = File.join(top, 'buildfile')
|
219
|
+
file(buildFile).should contain("GROUP = \"#{top}\"")
|
220
|
+
file(buildFile).should contain('define "single"')
|
221
|
+
lambda { Buildr.application.run }.should_not raise_error
|
222
|
+
end
|
223
|
+
|
224
|
+
it "should correct the path for a nested plugin" do
|
225
|
+
define('base_dir')
|
226
|
+
buildFile = File.join(top, 'buildfile')
|
227
|
+
file(buildFile).should exist
|
228
|
+
file(buildFile).should contain('define "single"')
|
229
|
+
file(buildFile).should contain('define "single", :version => "1.1", :base_dir => "nested/single"')
|
230
|
+
lambda { Buildr.application.run }.should_not raise_error
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
describe 'it should detect dependencies between projects' do
|
236
|
+
top = "top_#{__LINE__}"
|
237
|
+
before do
|
238
|
+
setupExample(top, 'first')
|
239
|
+
write(File.join(top, 'first', 'src','org','demo','Demo.java'))
|
240
|
+
write(File.join(top, 'first', 'rsc','aResource.txt'))
|
241
|
+
setupExample(top, 'second', { :requires => 'first'} )
|
242
|
+
write(File.join(top, 'second', 'src','org','second','Demo.java'))
|
243
|
+
setupExample(top, 'aFragment', { :fragment_host => 'second'})
|
244
|
+
write(File.join(top, 'aFragment', 'fragment.xml'))
|
245
|
+
File.open(File.join(top, 'buildfile'), 'w') { |file| file.write Generate.from_eclipse(File.join(Dir.pwd, top)).join("\n") }
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'should add "compile.with dependencies" in MANIFEST.MF' do
|
249
|
+
define('base_dir')
|
250
|
+
buildFile = File.join(top, 'buildfile')
|
251
|
+
file(buildFile).should exist
|
252
|
+
file(buildFile).should contain('compile.with dependencies')
|
253
|
+
file(buildFile).should contain('resources')
|
254
|
+
lambda { Buildr.application.run }.should_not raise_error
|
255
|
+
end
|
256
|
+
#dependencies << projects("first")
|
257
|
+
|
258
|
+
it 'should honour Require-Bundle in MANIFEST.MF' do
|
259
|
+
define('base_dir')
|
260
|
+
buildFile = File.join(top, 'buildfile')
|
261
|
+
file(buildFile).should exist
|
262
|
+
file(buildFile).should contain(/define "second"/)
|
263
|
+
file(buildFile).should contain( /dependencies << projects\("first"\)/)
|
264
|
+
file(buildFile).should contain(/define "second".*do.*dependencies << projects\("first"\).* end/m)
|
265
|
+
lambda { Buildr.application.run }.should_not raise_error
|
266
|
+
end
|
267
|
+
|
268
|
+
# Fragments are only supported with buildr4osi which is not (yet?) part of buildr
|
269
|
+
it 'should skip fragments.' do
|
270
|
+
define('base_dir')
|
271
|
+
buildFile = File.join(top, 'buildfile')
|
272
|
+
file(buildFile).should exist
|
273
|
+
# system("cat #{buildFile}") # if $VERBOSE
|
274
|
+
file(buildFile).should contain('define "first"')
|
275
|
+
lambda { Buildr.application.run }.should_not raise_error
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
data/spec/core/run_spec.rb
CHANGED
@@ -27,13 +27,20 @@ describe Project, :run do
|
|
27
27
|
project('foo').run.should be_kind_of(Run::RunTask)
|
28
28
|
end
|
29
29
|
|
30
|
-
it 'should include compile
|
30
|
+
it 'should include compile dependencies' do
|
31
31
|
define('foo') do
|
32
32
|
compile.using(:javac).with 'group:compile:jar:1.0'
|
33
33
|
test.compile.using(:javac).with 'group:test:jar:1.0'
|
34
34
|
end
|
35
35
|
project('foo').run.classpath.should include(artifact('group:compile:jar:1.0'))
|
36
|
-
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should not include test dependencies' do
|
39
|
+
define('foo') do
|
40
|
+
compile.using(:javac).with 'group:compile:jar:1.0'
|
41
|
+
test.compile.using(:javac).with 'group:test:jar:1.0'
|
42
|
+
end
|
43
|
+
project('foo').run.classpath.should_not include(artifact('group:test:jar:1.0'))
|
37
44
|
end
|
38
45
|
|
39
46
|
it 'should respond to using() and return self' do
|
@@ -63,11 +70,17 @@ describe Project, :run do
|
|
63
70
|
end
|
64
71
|
project('foo').run.runner.should be_a(Run::JavaRunner)
|
65
72
|
end
|
73
|
+
|
74
|
+
it "should run with the project resources" do
|
75
|
+
write 'src/main/java/Test.java', 'class Test {}'
|
76
|
+
write 'src/main/resources/test.properties', ''
|
77
|
+
define 'foo'
|
78
|
+
project('foo').run.classpath.should include project('foo').resources.target
|
79
|
+
end
|
66
80
|
|
67
|
-
it 'should depend on project''s compile
|
81
|
+
it 'should depend on project''s compile task' do
|
68
82
|
define 'foo'
|
69
83
|
project('foo').run.prerequisites.should include(project('foo').compile)
|
70
|
-
project('foo').run.prerequisites.should include(project('foo').test)
|
71
84
|
end
|
72
85
|
|
73
86
|
it 'should be local task' do
|
data/spec/core/test_spec.rb
CHANGED
@@ -747,9 +747,11 @@ describe Rake::Task, 'test' do
|
|
747
747
|
end
|
748
748
|
|
749
749
|
it 'should stop at first failure' do
|
750
|
-
define('
|
751
|
-
|
752
|
-
|
750
|
+
define('myproject') do
|
751
|
+
define('foo') { test { fail } }
|
752
|
+
define('bar') { test { fail } }
|
753
|
+
end
|
754
|
+
lambda { task('test').invoke rescue nil }.should run_tasks('myproject:bar:test').but_not('myproject:foo:test')
|
753
755
|
end
|
754
756
|
|
755
757
|
it 'should ignore failure if options.test is :all' do
|
data/spec/ide/idea_spec.rb
CHANGED
@@ -331,7 +331,7 @@ describe Buildr::IntellijIdea do
|
|
331
331
|
|
332
332
|
xml.RunnerSettings(:RunnerId => "Run")
|
333
333
|
xml.ConfigurationWrapper(:RunnerId => "Run")
|
334
|
-
xml.method
|
334
|
+
xml.tag! :method
|
335
335
|
end
|
336
336
|
ipr.add_configuration("Run Planner.html", "GWT.ConfigurationType", "GWT Configuration") do |xml|
|
337
337
|
xml.module(:name => project.iml.id)
|
@@ -341,7 +341,7 @@ describe Buildr::IntellijIdea do
|
|
341
341
|
|
342
342
|
xml.RunnerSettings(:RunnerId => "Run")
|
343
343
|
xml.ConfigurationWrapper(:RunnerId => "Run")
|
344
|
-
xml.method
|
344
|
+
xml.tag! :method
|
345
345
|
end
|
346
346
|
end
|
347
347
|
invoke_generate_task
|
data/spec/java/bdd_spec.rb
CHANGED
@@ -31,7 +31,7 @@ describe Buildr::RSpec do
|
|
31
31
|
# This test fails on the CI machine if the spec is run as part of a suite but not if run individually
|
32
32
|
# This seems to indicate that there is interaction with some other test but until that other test is
|
33
33
|
# identified the test has been marked as pending on the ci box
|
34
|
-
pending "Unable to determine why it fails on the CI machine so disabling" if
|
34
|
+
pending "Unable to determine why it fails on the CI machine so disabling" if ENV['JOB_NAME']
|
35
35
|
write('src/spec/ruby/success_spec.rb', 'describe("success") { it("is true") { nil.should be_nil } }')
|
36
36
|
|
37
37
|
project('foo').test.invoke
|
@@ -42,7 +42,7 @@ describe Buildr::RSpec do
|
|
42
42
|
# This test fails on the CI machine if the spec is run as part of a suite but not if run individually
|
43
43
|
# This seems to indicate that there is interaction with some other test but until that other test is
|
44
44
|
# identified the test has been marked as pending on the ci box
|
45
|
-
pending "Unable to determine why it fails on the CI machine so disabling" if
|
45
|
+
pending "Unable to determine why it fails on the CI machine so disabling" if ENV['JOB_NAME']
|
46
46
|
success = File.expand_path('src/spec/ruby/success_spec.rb')
|
47
47
|
write(success, 'describe("success") { it("is true") { nil.should be_nil } }')
|
48
48
|
failure = File.expand_path('src/spec/ruby/failure_spec.rb')
|
data/spec/java/cobertura_spec.rb
CHANGED
@@ -15,6 +15,8 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test_coverage_helper'))
|
18
|
+
if ENV_JAVA['java.version'] < "1.7"
|
19
|
+
|
18
20
|
Sandbox.require_optional_extension 'buildr/java/cobertura'
|
19
21
|
artifacts(Buildr::Cobertura::dependencies).map(&:invoke)
|
20
22
|
|
@@ -110,3 +112,5 @@ JAVA
|
|
110
112
|
end
|
111
113
|
end
|
112
114
|
end
|
115
|
+
|
116
|
+
end
|
data/spec/java/emma_spec.rb
CHANGED
@@ -13,8 +13,9 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
16
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test_coverage_helper'))
|
17
|
+
if ENV_JAVA['java.version'] < "1.7"
|
18
|
+
|
18
19
|
Sandbox.require_optional_extension 'buildr/java/emma'
|
19
20
|
artifacts(Buildr::Emma::dependencies).map(&:invoke)
|
20
21
|
|
@@ -119,3 +120,5 @@ describe Buildr::Emma do
|
|
119
120
|
end
|
120
121
|
end
|
121
122
|
end
|
123
|
+
|
124
|
+
end
|