buildr 1.4.7 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/CHANGELOG +41 -0
  2. data/Rakefile +0 -6
  3. data/addon/buildr/bnd.rb +13 -3
  4. data/addon/buildr/checkstyle.rb +1 -1
  5. data/addon/buildr/git_auto_version.rb +33 -0
  6. data/addon/buildr/{gwt.rake → gwt.rb} +0 -0
  7. data/addon/buildr/jacoco.rb +194 -0
  8. data/buildr.buildfile +1 -1
  9. data/buildr.gemspec +23 -16
  10. data/doc/_layouts/default.html +0 -2
  11. data/doc/contributing.textile +47 -0
  12. data/doc/download.textile +24 -0
  13. data/doc/index.textile +43 -23
  14. data/doc/languages.textile +65 -6
  15. data/doc/more_stuff.textile +12 -0
  16. data/doc/packaging.textile +2 -0
  17. data/doc/settings_profiles.textile +1 -1
  18. data/lib/buildr.rb +0 -4
  19. data/lib/buildr/core/application.rb +41 -8
  20. data/lib/buildr/core/build.rb +102 -1
  21. data/lib/buildr/core/cc.rb +14 -8
  22. data/lib/buildr/core/generate.rb +148 -7
  23. data/lib/buildr/core/util.rb +3 -3
  24. data/lib/buildr/ide/eclipse.rb +114 -0
  25. data/lib/buildr/ide/idea.rb +95 -1
  26. data/lib/buildr/java/commands.rb +1 -1
  27. data/lib/buildr/java/rjb.rb +5 -4
  28. data/lib/buildr/packaging/artifact.rb +1 -1
  29. data/lib/buildr/packaging/ziptask.rb +2 -2
  30. data/lib/buildr/scala.rb +1 -1
  31. data/lib/buildr/scala/bdd.rb +9 -2
  32. data/lib/buildr/scala/compiler.rb +94 -4
  33. data/lib/buildr/scala/doc.rb +17 -5
  34. data/lib/buildr/scala/tests.rb +15 -4
  35. data/lib/buildr/version.rb +1 -1
  36. data/rakelib/all-in-one.rake +50 -47
  37. data/rakelib/checks.rake +4 -4
  38. data/rakelib/doc.rake +85 -88
  39. data/rakelib/metrics.rake +9 -9
  40. data/rakelib/package.rake +13 -34
  41. data/rakelib/release.rake +11 -12
  42. data/rakelib/rspec.rake +71 -76
  43. data/rakelib/stage.rake +25 -51
  44. data/spec/addon/bnd_spec.rb +61 -7
  45. data/spec/core/build_spec.rb +117 -0
  46. data/spec/core/cc_spec.rb +36 -22
  47. data/spec/core/common_spec.rb +3 -2
  48. data/spec/core/compile_spec.rb +3 -3
  49. data/spec/core/generate_from_eclipse_spec.rb +280 -0
  50. data/spec/java/bdd_spec.rb +2 -2
  51. data/spec/java/packaging_spec.rb +2 -1
  52. data/spec/packaging/archive_spec.rb +25 -2
  53. data/spec/packaging/artifact_spec.rb +2 -2
  54. data/spec/sandbox.rb +3 -2
  55. data/spec/scala/compiler_spec.rb +41 -0
  56. data/spec/scala/doc_spec.rb +22 -3
  57. data/spec/scala/scala.rb +2 -2
  58. data/spec/scala/tests_spec.rb +2 -2
  59. metadata +223 -194
  60. data/addon/buildr/jdepend.rb.orig +0 -178
  61. data/doc/installing.textile.orig +0 -282
  62. data/doc/more_stuff.textile.orig +0 -1004
  63. data/lib/buildr/ide/eclipse/java.rb +0 -49
  64. data/lib/buildr/ide/eclipse/plugin.rb +0 -67
  65. data/lib/buildr/ide/eclipse/scala.rb +0 -64
@@ -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
- Dir['src/*'].each { |file| File.chmod(0o755, file) }
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 & 0o755).should == 0o755
549
+ (File.stat(file).mode & mode).should == mode
549
550
  end
550
551
  end
551
552
  end
@@ -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-1, time-1, 'target/resources')
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-1, time-1, 'target/resources')
603
- File.utime(time-1, time-1, 'target/resources/foo')
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')
@@ -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
@@ -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 `hostname` == "vesta.apache.org\n"
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 `hostname` == "vesta.apache.org\n"
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')
@@ -204,7 +204,8 @@ shared_examples_for 'package with manifest' do
204
204
  package.invoke
205
205
  Zip::ZipFile.open(package.to_s) do |zip|
206
206
  permissions = format("%o", zip.file.stat('META-INF/MANIFEST.MF').mode)
207
- permissions.should match /644$/
207
+ expected_mode = Buildr::Util.win_os? ? /666$/ : /644$/
208
+ permissions.should match expected_mode
208
209
  end
209
210
  end
210
211
 
@@ -411,6 +411,23 @@ describe TarTask do
411
411
  yield entries if block_given?
412
412
  entries
413
413
  end
414
+
415
+ # chmod is not reliable on Windows
416
+ unless Buildr::Util.win_os?
417
+ it 'should preserve file permissions' do
418
+ # with JRuby it's important to use absolute paths with File.chmod()
419
+ # http://jira.codehaus.org/browse/JRUBY-3300
420
+ hello = File.expand_path('src/main/bin/hello')
421
+ write hello, 'echo hi'
422
+ File.chmod(0777, hello)
423
+ fail("Failed to set permission on #{hello}") unless (File.stat(hello).mode & 0777) == 0777
424
+
425
+ tar('foo.tgz').include('src/main/bin/*').invoke
426
+ unzip('target' => 'foo.tgz').extract
427
+ (File.stat('target/hello').mode & 0777).should == 0777
428
+ end
429
+ end
430
+
414
431
  end
415
432
 
416
433
 
@@ -473,8 +490,14 @@ describe "ZipTask" do
473
490
  entries = {}
474
491
  Zip::ZipFile.open @archive do |zip|
475
492
  zip.entries.each do |entry|
476
- # Ignore the / directory created for empty ZIPs when using java.util.zip.
477
- entries[entry.name.to_s] = zip.read(entry.name) unless entry.name.to_s == '/'
493
+ if entry.directory?
494
+ # Ignore the / directory created for empty ZIPs when using java.util.zip.
495
+ if entry.name.to_s != '/'
496
+ entries[entry.name.to_s] = nil
497
+ end
498
+ else
499
+ entries[entry.name.to_s] = zip.read(entry.name)
500
+ end
478
501
  end
479
502
  end
480
503
  yield entries if block_given?
@@ -1115,11 +1115,11 @@ XML
1115
1115
  end
1116
1116
 
1117
1117
  it 'should bring artifact and its dependencies' do
1118
- transitive(@complex).should eql(artifacts(@complex, @simple))
1118
+ transitive(@complex).should eql(artifacts(@complex, @simple - [@provided]))
1119
1119
  end
1120
1120
 
1121
1121
  it 'should bring dependencies of POM without artifact itself' do
1122
- transitive(@complex.sub(/jar/, 'pom')).should eql(artifacts(@simple))
1122
+ transitive(@complex.sub(/jar/, 'pom')).should eql(artifacts(@simple - [@provided]))
1123
1123
  end
1124
1124
 
1125
1125
  it 'should bring artifact and transitive depenencies' do
@@ -19,11 +19,12 @@
19
19
  # repository and cache these across test cases.
20
20
  Buildr.application.instance_eval { @rakefile = File.expand_path('buildfile') }
21
21
  repositories.remote << 'http://repo1.maven.org/maven2'
22
- repositories.remote << 'http://scala-tools.org/repo-releases'
22
+ repositories.remote << 'https://oss.sonatype.org/content/groups/scala-tools'
23
+
23
24
 
24
25
  # Force Scala version for specs; don't want to rely on SCALA_HOME
25
26
  module Buildr::Scala
26
- SCALA_VERSION_FOR_SPECS = ENV["SCALA_VERSION"] || "2.8.1"
27
+ SCALA_VERSION_FOR_SPECS = ENV["SCALA_VERSION"] || "2.9.2"
27
28
  end
28
29
  Buildr.settings.build['scala.version'] = Buildr::Scala::SCALA_VERSION_FOR_SPECS
29
30
 
@@ -319,3 +319,44 @@ describe 'scala compiler 2.9 options' do
319
319
 
320
320
  end if Buildr::Scala.version?(2.9)
321
321
 
322
+ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.6"
323
+
324
+ describe 'zinc compiler (enabled through Buildr.settings)' do
325
+ before :each do
326
+ Buildr.settings.build['scalac.incremental'] = true
327
+ end
328
+
329
+ it 'should compile with zinc' do
330
+ write 'src/main/scala/com/example/Test.scala', 'package com.example; class Test { val i = 1 }'
331
+ project = define('foo')
332
+ compile_task = project.compile.using(:scalac)
333
+ compiler = compile_task.instance_eval { @compiler }
334
+ compiler.send(:zinc?).should eql(true)
335
+ compiler.should_receive(:compile_with_zinc).once
336
+ compile_task.invoke
337
+ end
338
+
339
+ after :each do
340
+ Buildr.settings.build['scalac.incremental'] = nil
341
+ end
342
+
343
+ it_should_behave_like ScalacCompiler
344
+ end
345
+
346
+ describe 'zinc compiler (enabled through project.scala_options)' do
347
+
348
+ it 'should compile with zinc' do
349
+ write 'src/main/scala/com/example/Test.scala', 'package com.example; class Test { val i = 1 }'
350
+ project = define('foo')
351
+ project.scalac_options.incremental = true
352
+ compile_task = project.compile.using(:scalac)
353
+ compiler = compile_task.instance_eval { @compiler }
354
+ compiler.send(:zinc?).should eql(true)
355
+ compiler.should_receive(:compile_with_zinc).once
356
+ compile_task.invoke
357
+ end
358
+ end
359
+
360
+ elsif Buildr::VERSION >= '1.5'
361
+ raise "JVM version guard in #{__FILE__} should be removed since it is assumed that Java 1.5 is no longer supported."
362
+ end