buildr 1.3.5 → 1.4.0

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 (151) hide show
  1. data/CHANGELOG +153 -8
  2. data/README.rdoc +1 -1
  3. data/addon/buildr/antlr.rb +5 -5
  4. data/addon/buildr/drb.rb +18 -18
  5. data/addon/buildr/hibernate.rb +18 -14
  6. data/addon/buildr/javacc.rb +4 -4
  7. data/addon/buildr/jetty.rb +5 -5
  8. data/addon/buildr/nailgun.rb +23 -23
  9. data/addon/buildr/openjpa.rb +1 -1
  10. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  11. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  12. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  13. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  14. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  15. data/addon/buildr/protobuf.rb +75 -0
  16. data/addon/buildr/xmlbeans.rb +5 -5
  17. data/buildr.buildfile +2 -2
  18. data/buildr.gemspec +8 -7
  19. data/doc/_layouts/default.html +2 -2
  20. data/doc/artifacts.textile +4 -4
  21. data/doc/building.textile +35 -3
  22. data/doc/contributing.textile +5 -0
  23. data/doc/download.textile +16 -5
  24. data/doc/extending.textile +38 -12
  25. data/doc/installing.textile +6 -5
  26. data/doc/languages.textile +182 -42
  27. data/doc/more_stuff.textile +2 -2
  28. data/doc/packaging.textile +14 -15
  29. data/doc/projects.textile +7 -2
  30. data/doc/quick_start.textile +4 -4
  31. data/doc/scripts/buildr-git.rb +63 -63
  32. data/doc/scripts/gitflow.rb +21 -21
  33. data/doc/settings_profiles.textile +9 -2
  34. data/doc/testing.textile +16 -5
  35. data/etc/KEYS +38 -0
  36. data/lib/buildr/core/application.rb +33 -27
  37. data/lib/buildr/core/build.rb +41 -28
  38. data/lib/buildr/core/cc.rb +172 -0
  39. data/lib/buildr/core/checks.rb +1 -1
  40. data/lib/buildr/core/common.rb +7 -6
  41. data/lib/buildr/core/compile.rb +7 -8
  42. data/lib/buildr/core/doc.rb +263 -0
  43. data/lib/buildr/core/environment.rb +6 -6
  44. data/lib/buildr/core/filter.rb +77 -35
  45. data/lib/buildr/core/generate.rb +7 -7
  46. data/lib/buildr/core/help.rb +1 -1
  47. data/lib/buildr/core/osx.rb +6 -6
  48. data/lib/buildr/core/progressbar.rb +4 -4
  49. data/lib/buildr/core/project.rb +144 -36
  50. data/lib/buildr/core/shell.rb +34 -34
  51. data/lib/buildr/core/test.rb +89 -20
  52. data/lib/buildr/core/transports.rb +8 -7
  53. data/lib/buildr/core/util.rb +77 -23
  54. data/lib/buildr/core.rb +1 -0
  55. data/lib/buildr/groovy/bdd.rb +5 -5
  56. data/lib/buildr/groovy/compiler.rb +19 -15
  57. data/lib/buildr/groovy/shell.rb +6 -6
  58. data/lib/buildr/ide/eclipse/java.rb +3 -3
  59. data/lib/buildr/ide/eclipse/plugin.rb +8 -5
  60. data/lib/buildr/ide/eclipse/scala.rb +4 -2
  61. data/lib/buildr/ide/eclipse.rb +148 -75
  62. data/lib/buildr/ide/idea.rb +2 -2
  63. data/lib/buildr/ide/idea7x.rb +23 -4
  64. data/lib/buildr/java/ant.rb +4 -4
  65. data/lib/buildr/java/bdd.rb +51 -54
  66. data/lib/buildr/java/cobertura.rb +57 -35
  67. data/lib/buildr/java/commands.rb +14 -5
  68. data/lib/buildr/java/compiler.rb +3 -217
  69. data/lib/buildr/java/deprecated.rb +4 -4
  70. data/lib/buildr/java/doc.rb +70 -0
  71. data/lib/buildr/java/emma.rb +22 -22
  72. data/lib/buildr/java/jruby.rb +4 -4
  73. data/lib/buildr/java/jtestr_runner.rb.erb +27 -25
  74. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  75. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +8 -3
  76. data/lib/buildr/java/packaging.rb +30 -29
  77. data/lib/buildr/java/pom.rb +4 -4
  78. data/lib/buildr/java/rjb.rb +6 -6
  79. data/lib/buildr/java/test_result.rb +61 -85
  80. data/lib/buildr/java/tests.rb +44 -27
  81. data/lib/buildr/java/version_requirement.rb +8 -8
  82. data/lib/buildr/java.rb +1 -0
  83. data/lib/buildr/packaging/archive.rb +55 -22
  84. data/lib/buildr/packaging/artifact.rb +75 -36
  85. data/lib/buildr/packaging/artifact_namespace.rb +90 -78
  86. data/lib/buildr/packaging/artifact_search.rb +5 -5
  87. data/lib/buildr/packaging/gems.rb +11 -7
  88. data/lib/buildr/packaging/package.rb +10 -7
  89. data/lib/buildr/packaging/tar.rb +14 -14
  90. data/lib/buildr/packaging/version_requirement.rb +30 -10
  91. data/lib/buildr/packaging/ziptask.rb +51 -13
  92. data/lib/buildr/scala/bdd.rb +25 -20
  93. data/lib/buildr/scala/compiler.rb +87 -40
  94. data/lib/buildr/scala/doc.rb +106 -0
  95. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  96. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  97. data/lib/buildr/scala/shell.rb +14 -9
  98. data/lib/buildr/scala/tests.rb +33 -26
  99. data/lib/buildr/scala.rb +1 -0
  100. data/lib/buildr/shell.rb +33 -33
  101. data/lib/buildr.rb +1 -1
  102. data/rakelib/all-in-one.rake +113 -0
  103. data/rakelib/checks.rake +1 -1
  104. data/rakelib/doc.rake +7 -0
  105. data/rakelib/package.rake +1 -1
  106. data/rakelib/release.rake +9 -6
  107. data/rakelib/rspec.rake +26 -7
  108. data/rakelib/setup.rake +15 -3
  109. data/rakelib/stage.rake +18 -11
  110. data/spec/addon/drb_spec.rb +25 -25
  111. data/spec/core/application_spec.rb +111 -21
  112. data/spec/core/build_spec.rb +16 -15
  113. data/spec/core/cc_spec.rb +174 -0
  114. data/spec/core/checks_spec.rb +34 -34
  115. data/spec/core/common_spec.rb +51 -5
  116. data/spec/core/compile_spec.rb +89 -14
  117. data/spec/core/extension_spec.rb +127 -19
  118. data/spec/core/generate_spec.rb +2 -2
  119. data/spec/core/project_spec.rb +10 -10
  120. data/spec/core/test_spec.rb +144 -35
  121. data/spec/core/transport_spec.rb +8 -8
  122. data/spec/core/util_spec.rb +63 -5
  123. data/spec/groovy/bdd_spec.rb +5 -5
  124. data/spec/groovy/compiler_spec.rb +29 -18
  125. data/spec/ide/eclipse_spec.rb +185 -9
  126. data/spec/ide/idea7x_spec.rb +22 -10
  127. data/spec/java/ant_spec.rb +9 -5
  128. data/spec/java/bdd_spec.rb +29 -37
  129. data/spec/java/cobertura_spec.rb +12 -12
  130. data/spec/java/commands_spec.rb +34 -0
  131. data/spec/java/compiler_spec.rb +53 -53
  132. data/spec/java/emma_spec.rb +11 -11
  133. data/spec/java/java_spec.rb +10 -10
  134. data/spec/java/packaging_spec.rb +67 -20
  135. data/spec/java/test_coverage_helper.rb +18 -18
  136. data/spec/java/tests_spec.rb +13 -9
  137. data/spec/packaging/archive_spec.rb +187 -20
  138. data/spec/packaging/artifact_namespace_spec.rb +172 -83
  139. data/spec/packaging/artifact_spec.rb +83 -18
  140. data/spec/packaging/packaging_spec.rb +41 -14
  141. data/spec/sandbox.rb +23 -12
  142. data/spec/scala/bdd_spec.rb +13 -8
  143. data/spec/scala/compiler_spec.rb +18 -13
  144. data/spec/scala/scala.rb +3 -3
  145. data/spec/scala/tests_spec.rb +46 -24
  146. data/spec/spec_helpers.rb +28 -10
  147. data/spec/version_requirement_spec.rb +25 -11
  148. metadata +149 -133
  149. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
  150. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +0 -35
  151. data/rakelib/stage.rake~ +0 -213
@@ -24,54 +24,54 @@ describe Buildr::Cobertura do
24
24
  # Reloading the extension because the sandbox removes all its actions
25
25
  Buildr.module_eval { remove_const :Cobertura }
26
26
  load File.expand_path('../lib/buildr/java/cobertura.rb')
27
- @tool_module = Buildr::Cobertura
27
+ @tool_module = Buildr::Cobertura
28
28
  end
29
-
29
+
30
30
  it_should_behave_like 'test coverage tool'
31
-
31
+
32
32
  describe 'project-specific' do
33
-
33
+
34
34
  describe 'data file' do
35
35
  it 'should have a default value' do
36
36
  define('foo').cobertura.data_file.should point_to_path('reports/cobertura.ser')
37
37
  end
38
-
38
+
39
39
  it 'should be overridable' do
40
40
  define('foo') { cobertura.data_file = path_to('target/data.cobertura') }
41
41
  project('foo').cobertura.data_file.should point_to_path('target/data.cobertura')
42
42
  end
43
-
43
+
44
44
  it 'should be created during instrumentation' do
45
45
  write 'src/main/java/Foo.java', 'public class Foo {}'
46
46
  define('foo')
47
47
  task('foo:cobertura:instrument').invoke
48
48
  file(project('foo').cobertura.data_file).should exist
49
49
  end
50
-
50
+
51
51
  it 'should not instrument projects which have no sources' do
52
52
  write 'bar/src/main/java/Baz.java', 'public class Baz {}'
53
53
  define('foo') { define('bar') }
54
54
  task('foo:bar:cobertura:instrument').invoke
55
55
  end
56
56
  end
57
-
57
+
58
58
  describe 'instrumentation' do
59
59
  before do
60
60
  ['Foo', 'Bar'].each { |cls| write File.join('src/main/java', "#{cls}.java"), "public class #{cls} {}" }
61
61
  end
62
-
62
+
63
63
  it 'should instrument only included classes' do
64
64
  define('foo') { cobertura.include 'Foo' }
65
65
  task("foo:cobertura:instrument").invoke
66
66
  Dir.chdir('target/instrumented/classes') { Dir.glob('*').sort.should == ['Foo.class'] }
67
67
  end
68
-
68
+
69
69
  it 'should not instrument excluded classes' do
70
70
  define('foo') { cobertura.exclude 'Foo' }
71
71
  task("foo:cobertura:instrument").invoke
72
72
  Dir.chdir('target/instrumented/classes') { Dir.glob('*').sort.should == ['Bar.class'] }
73
73
  end
74
-
74
+
75
75
  it 'should instrument classes that are included but not excluded' do
76
76
  write 'src/main/java/Baz.java', 'public class Baz {}'
77
77
  define('foo') { cobertura.include('Ba').exclude('ar') }
@@ -79,7 +79,7 @@ describe Buildr::Cobertura do
79
79
  Dir.chdir('target/instrumented/classes') { Dir.glob('*').sort.should == ['Baz.class'] }
80
80
  end
81
81
  end
82
-
82
+
83
83
  # TODO add specs for cobertura:check...somehow
84
84
  end
85
85
  end
@@ -0,0 +1,34 @@
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.join(File.dirname(__FILE__), '../spec_helpers')
17
+
18
+
19
+ describe Java::Commands do
20
+
21
+ it "should not be verbose by default" do
22
+ write "build.xml", <<-BUILD
23
+ <project name="MyProject" default="dist" basedir=".">
24
+ <description>
25
+ simple example build file
26
+ </description>
27
+ <target name="dist"/>
28
+ </project>
29
+ BUILD
30
+ lambda { Java::Commands.java("org.apache.tools.ant.Main", :classpath => Buildr::Ant.dependencies) }.should_not show_info(/java/)
31
+ lambda { Java::Commands.java("org.apache.tools.ant.Main", :classpath => Buildr::Ant.dependencies, :verbose => true) }.should show_info(/java/)
32
+ end
33
+
34
+ end
@@ -19,13 +19,13 @@ require File.join(File.dirname(__FILE__), '../spec_helpers')
19
19
 
20
20
  describe 'javac compiler' do
21
21
  it 'should identify itself from source directories' do
22
- write 'src/main/java/com/example/Test.java', 'package com.example; class Test {}'
22
+ write 'src/main/java/com/example/Test.java', 'package com.example; class Test {}'
23
23
  define('foo').compile.compiler.should eql(:javac)
24
24
  end
25
25
 
26
26
  it 'should identify from source directories using custom layout' do
27
- write 'src/com/example/Code.java', 'package com.example; class Code {}'
28
- write 'testing/com/example/Test.java', 'package com.example; class Test {}'
27
+ write 'src/com/example/Code.java', 'package com.example; class Code {}'
28
+ write 'testing/com/example/Test.java', 'package com.example; class Test {}'
29
29
  custom = Layout.new
30
30
  custom[:source, :main, :java] = 'src'
31
31
  custom[:source, :test, :java] = 'testing'
@@ -36,8 +36,8 @@ describe 'javac compiler' do
36
36
  end
37
37
 
38
38
  it 'should identify from compile source directories' do
39
- write 'src/com/example/Code.java', 'package com.example; class Code {}'
40
- write 'testing/com/example/Test.java', 'package com.example; class Test {}'
39
+ write 'src/com/example/Code.java', 'package com.example; class Code {}'
40
+ write 'testing/com/example/Test.java', 'package com.example; class Test {}'
41
41
  define 'foo' do
42
42
  lambda { compile.from 'src' }.should change { compile.compiler }.to(:javac)
43
43
  lambda { test.compile.from 'testing' }.should change { test.compile.compiler }.to(:javac)
@@ -103,28 +103,28 @@ describe 'javac compiler options' do
103
103
  compile_task.options.warnings.should be_false
104
104
  end
105
105
 
106
- it 'should set wranings option to true when running with --verbose option' do
106
+ it 'should set warnings option to true when running with --verbose option' do
107
107
  verbose true
108
- compile_task.options.warnings.should be_true
108
+ compile_task.options.warnings.should be_false
109
109
  end
110
110
 
111
111
  it 'should use -nowarn argument when warnings is false' do
112
112
  compile_task.using(:warnings=>false)
113
- javac_args.should include('-nowarn')
113
+ javac_args.should include('-nowarn')
114
114
  end
115
115
 
116
116
  it 'should not use -nowarn argument when warnings is true' do
117
117
  compile_task.using(:warnings=>true)
118
- javac_args.should_not include('-nowarn')
118
+ javac_args.should_not include('-nowarn')
119
119
  end
120
120
 
121
121
  it 'should not use -verbose argument by default' do
122
- javac_args.should_not include('-verbose')
122
+ javac_args.should_not include('-verbose')
123
123
  end
124
124
 
125
125
  it 'should use -verbose argument when running with --trace option' do
126
126
  trace true
127
- javac_args.should include('-verbose')
127
+ javac_args.should include('-verbose')
128
128
  end
129
129
 
130
130
  it 'should set debug option to true by default' do
@@ -251,7 +251,7 @@ describe 'javac compiler options' do
251
251
  end
252
252
 
253
253
 
254
- describe Project, '#javadoc' do
254
+ describe Project, '#doc' do
255
255
  def sources
256
256
  @sources ||= (1..3).map { |i| "Test#{i}" }.
257
257
  each { |name| write "src/main/java/foo/#{name}.java", "package foo; public class #{name}{}" }.
@@ -260,64 +260,64 @@ describe Project, '#javadoc' do
260
260
 
261
261
  it 'should return the project\'s Javadoc task' do
262
262
  define('foo') { compile.using(:javac) }
263
- project('foo').javadoc.name.should eql('foo:javadoc')
263
+ project('foo').doc.name.should eql('foo:doc')
264
264
  end
265
265
 
266
- it 'should return a Javadoc task' do
266
+ it 'should return a DocTask' do
267
267
  define('foo') { compile.using(:javac) }
268
- project('foo').javadoc.should be_kind_of(Javadoc::JavadocTask)
268
+ project('foo').doc.should be_kind_of(Doc::DocTask)
269
269
  end
270
270
 
271
- it 'should set target directory to target/javadoc' do
271
+ it 'should set target directory to target/doc' do
272
272
  define 'foo' do
273
273
  compile.using(:javac)
274
- javadoc.target.to_s.should point_to_path('target/javadoc')
274
+ doc.target.to_s.should point_to_path('target/doc')
275
275
  end
276
276
  end
277
277
 
278
278
  it 'should create file task for target directory' do
279
279
  define 'foo' do
280
280
  compile.using(:javac)
281
- javadoc.should_receive(:invoke_prerequisites)
281
+ doc.should_receive(:invoke_prerequisites)
282
282
  end
283
- project('foo').file('target/javadoc').invoke
283
+ project('foo').file('target/doc').invoke
284
284
  end
285
285
 
286
286
  it 'should respond to into() and return self' do
287
287
  define 'foo' do
288
288
  compile.using(:javac)
289
- javadoc.into('docs').should be(javadoc)
289
+ doc.into('docs').should be(doc)
290
290
  end
291
291
  end
292
292
 
293
293
  it 'should respond to into() and change target directory' do
294
294
  define 'foo' do
295
295
  compile.using(:javac)
296
- javadoc.into('docs')
297
- javadoc.should_receive(:invoke_prerequisites)
296
+ doc.into('docs')
297
+ doc.should_receive(:invoke_prerequisites)
298
298
  end
299
299
  file('docs').invoke
300
300
  end
301
301
 
302
302
  it 'should respond to from() and return self' do
303
303
  task = nil
304
- define('foo') { task = javadoc.from('srcs') }
305
- task.should be(project('foo').javadoc)
304
+ define('foo') { task = doc.from('srcs') }
305
+ task.should be(project('foo').doc)
306
306
  end
307
307
 
308
308
  it 'should respond to from() and add sources' do
309
309
  define 'foo' do
310
310
  compile.using(:javac)
311
- javadoc.from('srcs').should be(javadoc)
311
+ doc.from('srcs').should be(doc)
312
312
  end
313
313
  end
314
314
 
315
315
  it 'should respond to from() and add file task' do
316
316
  define 'foo' do
317
317
  compile.using(:javac)
318
- javadoc.from('srcs').should be(javadoc)
318
+ doc.from('srcs').should be(doc)
319
319
  end
320
- project('foo').javadoc.source_files.first.should point_to_path('srcs')
320
+ project('foo').doc.source_files.first.should point_to_path('srcs')
321
321
  end
322
322
 
323
323
  it 'should respond to from() and add project\'s sources and dependencies' do
@@ -325,27 +325,27 @@ describe Project, '#javadoc' do
325
325
  define 'foo' do
326
326
  compile.using(:javac)
327
327
  define('bar') { compile.using(:javac).with 'group:id:jar:1.0' }
328
- javadoc.from project('foo:bar')
328
+ doc.from project('foo:bar')
329
329
  end
330
- project('foo').javadoc.source_files.first.should point_to_path('bar/src/main/java/Test.java')
331
- project('foo').javadoc.classpath.map(&:to_spec).should include('group:id:jar:1.0')
330
+ project('foo').doc.source_files.first.should point_to_path('bar/src/main/java/Test.java')
331
+ project('foo').doc.classpath.map(&:to_spec).should include('group:id:jar:1.0')
332
332
  end
333
333
 
334
- it 'should generate javadocs from project' do
334
+ it 'should generate docs from project' do
335
335
  sources
336
336
  define('foo') { compile.using(:javac) }
337
- project('foo').javadoc.source_files.sort.should == sources.sort.map { |f| File.expand_path(f) }
337
+ project('foo').doc.source_files.sort.should == sources.sort.map { |f| File.expand_path(f) }
338
338
  end
339
339
 
340
340
  it 'should include compile dependencies' do
341
341
  define('foo') { compile.using(:javac).with 'group:id:jar:1.0' }
342
- project('foo').javadoc.classpath.map(&:to_spec).should include('group:id:jar:1.0')
342
+ project('foo').doc.classpath.map(&:to_spec).should include('group:id:jar:1.0')
343
343
  end
344
344
 
345
345
  it 'should respond to include() and return self' do
346
346
  define 'foo' do
347
347
  compile.using(:javac)
348
- javadoc.include('srcs').should be(javadoc)
348
+ doc.include('srcs').should be(doc)
349
349
  end
350
350
  end
351
351
 
@@ -353,15 +353,15 @@ describe Project, '#javadoc' do
353
353
  included = sources.first
354
354
  define 'foo' do
355
355
  compile.using(:javac)
356
- javadoc.include included
356
+ doc.include included
357
357
  end
358
- project('foo').javadoc.source_files.should include(included)
358
+ project('foo').doc.source_files.should include(included)
359
359
  end
360
360
 
361
361
  it 'should respond to exclude() and return self' do
362
362
  define 'foo' do
363
363
  compile.using(:javac)
364
- javadoc.exclude('srcs').should be(javadoc)
364
+ doc.exclude('srcs').should be(doc)
365
365
  end
366
366
  end
367
367
 
@@ -369,35 +369,35 @@ describe Project, '#javadoc' do
369
369
  excluded = sources.first
370
370
  define 'foo' do
371
371
  compile.using(:javac)
372
- javadoc.exclude excluded
372
+ doc.exclude excluded
373
373
  end
374
374
  sources
375
- project('foo').javadoc.source_files.sort.should == sources[1..-1].map { |f| File.expand_path(f) }
375
+ project('foo').doc.source_files.sort.should == sources[1..-1].map { |f| File.expand_path(f) }
376
376
  end
377
377
 
378
378
  it 'should respond to using() and return self' do
379
379
  define 'foo' do
380
380
  compile.using(:javac)
381
- javadoc.using(:windowtitle=>'Fooing').should be(javadoc)
381
+ doc.using(:windowtitle=>'Fooing').should be(doc)
382
382
  end
383
383
  end
384
384
 
385
385
  it 'should respond to using() and accept options' do
386
386
  define 'foo' do
387
387
  compile.using(:javac)
388
- javadoc.using :windowtitle=>'Fooing'
388
+ doc.using :windowtitle=>'Fooing'
389
389
  end
390
- project('foo').javadoc.options[:windowtitle].should eql('Fooing')
390
+ project('foo').doc.options[:windowtitle].should eql('Fooing')
391
391
  end
392
392
 
393
393
  it 'should pick -windowtitle from project name' do
394
394
  define 'foo' do
395
395
  compile.using(:javac)
396
- javadoc.options[:windowtitle].should eql('foo')
396
+ doc.options[:windowtitle].should eql('foo')
397
397
 
398
398
  define 'bar' do
399
399
  compile.using(:javac)
400
- javadoc.options[:windowtitle].should eql('foo:bar')
400
+ doc.options[:windowtitle].should eql('foo:bar')
401
401
  end
402
402
  end
403
403
  end
@@ -406,32 +406,32 @@ describe Project, '#javadoc' do
406
406
  desc 'My App'
407
407
  define 'foo' do
408
408
  compile.using(:javac)
409
- javadoc.options[:windowtitle].should eql('My App')
409
+ doc.options[:windowtitle].should eql('My App')
410
410
  end
411
411
  end
412
412
 
413
413
  it 'should produce documentation' do
414
414
  sources
415
415
  define('foo') { compile.using(:javac) }
416
- project('foo').javadoc.invoke
417
- (1..3).map { |i| "target/javadoc/foo/Test#{i}.html" }.each { |f| file(f).should exist }
416
+ project('foo').doc.invoke
417
+ (1..3).map { |i| "target/doc/foo/Test#{i}.html" }.each { |f| file(f).should exist }
418
418
  end
419
419
 
420
420
  it 'should fail on error' do
421
421
  write 'Test.java', 'class Test {}'
422
422
  define 'foo' do
423
423
  compile.using(:javac)
424
- javadoc.include 'Test.java'
424
+ doc.include 'Test.java'
425
425
  end
426
- lambda { project('foo').javadoc.invoke }.should raise_error(RuntimeError, /Failed to generate Javadocs/)
426
+ lambda { project('foo').doc.invoke }.should raise_error(RuntimeError, /Failed to generate Javadocs/)
427
427
  end
428
428
 
429
429
  it 'should be local task' do
430
430
  define 'foo' do
431
431
  define('bar') { compile.using(:javac) }
432
432
  end
433
- project('foo:bar').javadoc.should_receive(:invoke_prerequisites)
434
- in_original_dir(project('foo:bar').base_dir) { task('javadoc').invoke }
433
+ project('foo:bar').doc.should_receive(:invoke_prerequisites)
434
+ in_original_dir(project('foo:bar').base_dir) { task('doc').invoke }
435
435
  end
436
436
 
437
437
  it 'should not recurse' do
@@ -439,8 +439,8 @@ describe Project, '#javadoc' do
439
439
  compile.using(:javac)
440
440
  define('bar') { compile.using(:javac) }
441
441
  end
442
- project('foo:bar').javadoc.should_not_receive(:invoke_prerequisites)
443
- project('foo').javadoc.invoke
442
+ project('foo:bar').doc.should_not_receive(:invoke_prerequisites)
443
+ project('foo').doc.invoke
444
444
  end
445
445
  end
446
446
 
@@ -28,18 +28,18 @@ describe Buildr::Emma do
28
28
  end
29
29
 
30
30
  it_should_behave_like 'test coverage tool'
31
-
31
+
32
32
  describe 'project-specific' do
33
33
  describe 'metadata file' do
34
34
  it 'should have a default value' do
35
35
  define('foo').emma.metadata_file.should point_to_path('reports/emma/coverage.em')
36
36
  end
37
-
37
+
38
38
  it 'should be overridable' do
39
39
  define('foo') { emma.metadata_file = path_to('target/metadata.emma') }
40
40
  project('foo').emma.metadata_file.should point_to_path('target/metadata.emma')
41
41
  end
42
-
42
+
43
43
  it 'should be created during instrumentation' do
44
44
  write 'src/main/java/Foo.java', 'public class Foo {}'
45
45
  define('foo')
@@ -47,17 +47,17 @@ describe Buildr::Emma do
47
47
  file(project('foo').emma.metadata_file).should exist
48
48
  end
49
49
  end
50
-
50
+
51
51
  describe 'coverage file' do
52
52
  it 'should have a default value' do
53
53
  define('foo').emma.coverage_file.should point_to_path('reports/emma/coverage.ec')
54
54
  end
55
-
55
+
56
56
  it 'should be overridable' do
57
57
  define('foo') { emma.coverage_file = path_to('target/coverage.emma') }
58
58
  project('foo').emma.coverage_file.should point_to_path('target/coverage.emma')
59
59
  end
60
-
60
+
61
61
  it 'should be created during test' do
62
62
  write 'src/main/java/Foo.java', 'public class Foo {}'
63
63
  write_test :for=>'Foo', :in=>'src/test/java'
@@ -83,7 +83,7 @@ describe Buildr::Emma do
83
83
  task("foo:emma:instrument").invoke
84
84
  Dir.chdir('target/instrumented/classes') { Dir.glob('*').sort.should == ['Bar.class'] }
85
85
  end
86
-
86
+
87
87
  it 'should instrument classes that are included but not excluded' do
88
88
  write 'src/main/java/Baz.java', 'public class Baz {}'
89
89
  define('foo') { emma.include('Ba*').exclude('*ar') }
@@ -91,13 +91,13 @@ describe Buildr::Emma do
91
91
  Dir.chdir('target/instrumented/classes') { Dir.glob('*').sort.should == ['Baz.class'] }
92
92
  end
93
93
  end
94
-
94
+
95
95
  describe 'reports' do
96
96
  before do
97
97
  write 'src/main/java/Foo.java', 'public class Foo {}'
98
98
  write_test :for=>'Foo', :in=>'src/test/java'
99
99
  end
100
-
100
+
101
101
  describe 'in html' do
102
102
  it 'should inform the user if no coverage data' do
103
103
  rm 'src/test/java/FooTest.java'
@@ -106,14 +106,14 @@ describe Buildr::Emma do
106
106
  should show_info(/No test coverage report for foo. Missing: #{project('foo').emma.coverage_file}/)
107
107
  end
108
108
  end
109
-
109
+
110
110
  describe 'in xml' do
111
111
  it 'should have an xml file' do
112
112
  define('foo')
113
113
  task('foo:emma:xml').invoke
114
114
  file(File.join(project('foo').emma.report_dir, 'coverage.xml')).should exist
115
115
  end
116
- end
116
+ end
117
117
  end
118
118
  end
119
119
  end
@@ -48,42 +48,42 @@ describe Java, '#tools_jar' do
48
48
  before do
49
49
  @old_home = ENV['JAVA_HOME']
50
50
  end
51
-
51
+
52
52
  describe 'when JAVA_HOME points to a JDK' do
53
53
  before do
54
54
  Java.instance_eval { @tools_jar = nil }
55
55
  write 'jdk/lib/tools.jar'
56
56
  ENV['JAVA_HOME'] = File.expand_path('jdk')
57
57
  end
58
-
58
+
59
59
  it 'should return the path to tools.jar' do
60
60
  Java.tools_jar.should point_to_path('jdk/lib/tools.jar')
61
61
  end
62
62
  end
63
-
63
+
64
64
  describe 'when JAVA_HOME points to a JRE inside a JDK' do
65
65
  before do
66
66
  Java.instance_eval { @tools_jar = nil }
67
67
  write 'jdk/lib/tools.jar'
68
68
  ENV['JAVA_HOME'] = File.expand_path('jdk/jre')
69
69
  end
70
-
70
+
71
71
  it 'should return the path to tools.jar' do
72
72
  Java.tools_jar.should point_to_path('jdk/lib/tools.jar')
73
73
  end
74
74
  end
75
-
75
+
76
76
  describe 'when there is no tools.jar' do
77
77
  before do
78
78
  Java.instance_eval { @tools_jar = nil }
79
79
  ENV['JAVA_HOME'] = File.expand_path('jdk')
80
80
  end
81
-
81
+
82
82
  it 'should return nil' do
83
83
  Java.tools_jar.should be_nil
84
84
  end
85
85
  end
86
-
86
+
87
87
  after do
88
88
  ENV['JAVA_HOME'] = @old_home
89
89
  end
@@ -93,13 +93,13 @@ describe Java, '#java' do
93
93
  before do
94
94
  @old_home = ENV['JAVA_HOME']
95
95
  end
96
-
96
+
97
97
  describe 'when JAVA_HOME points to an invalid JRE/JDK installation' do
98
98
  before do
99
99
  write 'jdk'
100
100
  ENV['JAVA_HOME'] = File.expand_path('jdk')
101
101
  end
102
-
102
+
103
103
  it 'should fail with an error message mentioning JAVA_HOME' do
104
104
  begin
105
105
  Java.java ['-version']
@@ -109,7 +109,7 @@ describe Java, '#java' do
109
109
  end
110
110
  end
111
111
  end
112
-
112
+
113
113
  after do
114
114
  ENV['JAVA_HOME'] = @old_home
115
115
  end