vic-buildr 1.3.1 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/CHANGELOG +90 -8
  2. data/{README → README.rdoc} +29 -16
  3. data/Rakefile +17 -19
  4. data/_buildr +50 -0
  5. data/addon/buildr/cobertura.rb +47 -44
  6. data/addon/buildr/emma.rb +237 -0
  7. data/addon/buildr/jetty.rb +1 -1
  8. data/addon/buildr/nailgun.rb +581 -661
  9. data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail$Main.class +0 -0
  10. data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.class +0 -0
  11. data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.java +0 -0
  12. data/addon/buildr/xmlbeans.rb +1 -1
  13. data/bin/buildr +9 -2
  14. data/buildr.buildfile +53 -0
  15. data/buildr.gemspec +23 -15
  16. data/doc/css/default.css +51 -48
  17. data/doc/css/print.css +60 -55
  18. data/doc/css/syntax.css +40 -31
  19. data/doc/images/growl-icon.tiff +0 -0
  20. data/doc/images/project-structure.png +0 -0
  21. data/doc/pages/artifacts.textile +46 -156
  22. data/doc/pages/building.textile +63 -324
  23. data/doc/pages/contributing.textile +116 -88
  24. data/doc/pages/download.textile +20 -15
  25. data/doc/pages/extending.textile +27 -81
  26. data/doc/pages/getting_started.textile +47 -111
  27. data/doc/pages/index.textile +19 -37
  28. data/doc/pages/languages.textile +407 -0
  29. data/doc/pages/more_stuff.textile +92 -173
  30. data/doc/pages/packaging.textile +72 -237
  31. data/doc/pages/projects.textile +58 -233
  32. data/doc/pages/recipes.textile +19 -43
  33. data/doc/pages/settings_profiles.textile +39 -104
  34. data/doc/pages/testing.textile +41 -304
  35. data/doc/pages/troubleshooting.textile +29 -47
  36. data/doc/pages/whats_new.textile +66 -157
  37. data/doc/print.haml +0 -1
  38. data/doc/print.toc.yaml +1 -0
  39. data/doc/scripts/buildr-git.rb +1 -1
  40. data/doc/scripts/install-jruby.sh +1 -1
  41. data/doc/scripts/install-linux.sh +4 -4
  42. data/doc/site.toc.yaml +8 -5
  43. data/{KEYS → etc/KEYS} +0 -0
  44. data/etc/git-svn-authors +16 -0
  45. data/lib/buildr.rb +2 -13
  46. data/lib/buildr/core/application.rb +200 -95
  47. data/lib/buildr/core/application_cli.rb +6 -1
  48. data/lib/buildr/core/build.rb +140 -91
  49. data/lib/buildr/core/checks.rb +5 -5
  50. data/lib/buildr/core/common.rb +1 -1
  51. data/lib/buildr/core/compile.rb +14 -12
  52. data/lib/buildr/core/filter.rb +151 -46
  53. data/lib/buildr/core/generate.rb +9 -7
  54. data/lib/buildr/core/progressbar.rb +1 -1
  55. data/lib/buildr/core/project.rb +8 -7
  56. data/lib/buildr/core/test.rb +54 -29
  57. data/lib/buildr/core/transports.rb +25 -20
  58. data/lib/buildr/core/util.rb +80 -26
  59. data/lib/buildr/groovy.rb +18 -0
  60. data/lib/buildr/groovy/bdd.rb +105 -0
  61. data/lib/buildr/groovy/compiler.rb +138 -0
  62. data/lib/buildr/ide/eclipse.rb +102 -71
  63. data/lib/buildr/ide/idea.rb +7 -12
  64. data/lib/buildr/ide/idea7x.rb +20 -20
  65. data/lib/buildr/java.rb +4 -7
  66. data/lib/buildr/java/ant.rb +26 -5
  67. data/lib/buildr/java/bdd.rb +447 -0
  68. data/lib/buildr/java/commands.rb +8 -9
  69. data/lib/buildr/java/{compilers.rb → compiler.rb} +8 -90
  70. data/lib/buildr/java/jruby.rb +29 -11
  71. data/lib/buildr/java/jtestr_runner.rb.erb +114 -0
  72. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  73. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +4 -1
  74. data/lib/buildr/java/packaging.rb +23 -16
  75. data/lib/buildr/java/pom.rb +1 -1
  76. data/lib/buildr/java/rjb.rb +21 -8
  77. data/lib/buildr/java/test_result.rb +277 -0
  78. data/lib/buildr/java/{test_frameworks.rb → tests.rb} +121 -88
  79. data/lib/buildr/packaging/artifact.rb +12 -11
  80. data/lib/buildr/packaging/artifact_namespace.rb +7 -4
  81. data/lib/buildr/packaging/gems.rb +3 -3
  82. data/lib/buildr/packaging/zip.rb +13 -10
  83. data/lib/buildr/resources/buildr.icns +0 -0
  84. data/lib/buildr/scala.rb +19 -0
  85. data/lib/buildr/scala/compiler.rb +109 -0
  86. data/lib/buildr/scala/tests.rb +203 -0
  87. data/rakelib/apache.rake +31 -41
  88. data/rakelib/doc.rake +2 -2
  89. data/rakelib/package.rake +31 -2
  90. data/rakelib/rspec.rake +22 -20
  91. data/rakelib/rubyforge.rake +1 -0
  92. data/rakelib/setup.rake +34 -9
  93. data/spec/addon/cobertura_spec.rb +77 -0
  94. data/spec/addon/emma_spec.rb +120 -0
  95. data/spec/addon/test_coverage_spec.rb +249 -0
  96. data/spec/{application_spec.rb → core/application_spec.rb} +82 -4
  97. data/spec/{artifact_namespace_spec.rb → core/artifact_namespace_spec.rb} +12 -1
  98. data/spec/core/build_spec.rb +415 -0
  99. data/spec/{checks_spec.rb → core/checks_spec.rb} +1 -1
  100. data/spec/{common_spec.rb → core/common_spec.rb} +119 -30
  101. data/spec/{compile_spec.rb → core/compile_spec.rb} +17 -13
  102. data/spec/{project_spec.rb → core/project_spec.rb} +9 -6
  103. data/spec/{test_spec.rb → core/test_spec.rb} +226 -32
  104. data/spec/{transport_spec.rb → core/transport_spec.rb} +35 -23
  105. data/spec/groovy/bdd_spec.rb +80 -0
  106. data/spec/{groovy_compilers_spec.rb → groovy/compiler_spec.rb} +1 -1
  107. data/spec/ide/eclipse_spec.rb +243 -0
  108. data/spec/{java_spec.rb → java/ant.rb} +7 -17
  109. data/spec/java/bdd_spec.rb +358 -0
  110. data/spec/{java_compilers_spec.rb → java/compiler_spec.rb} +1 -1
  111. data/spec/java/java_spec.rb +88 -0
  112. data/spec/{java_packaging_spec.rb → java/packaging_spec.rb} +65 -4
  113. data/spec/{java_test_frameworks_spec.rb → java/tests_spec.rb} +50 -10
  114. data/spec/{archive_spec.rb → packaging/archive_spec.rb} +12 -2
  115. data/spec/{artifact_spec.rb → packaging/artifact_spec.rb} +10 -3
  116. data/spec/{packaging_helper.rb → packaging/packaging_helper.rb} +0 -0
  117. data/spec/{packaging_spec.rb → packaging/packaging_spec.rb} +1 -1
  118. data/spec/sandbox.rb +25 -4
  119. data/spec/{scala_compilers_spec.rb → scala/compiler_spec.rb} +1 -1
  120. data/spec/scala/tests_spec.rb +215 -0
  121. data/spec/spec_helpers.rb +38 -17
  122. metadata +119 -69
  123. data/lib/buildr/java/bdd_frameworks.rb +0 -265
  124. data/lib/buildr/java/groovyc.rb +0 -137
  125. data/spec/build_spec.rb +0 -193
  126. data/spec/java_bdd_frameworks_spec.rb +0 -238
  127. data/spec/spec.opts +0 -6
@@ -2,22 +2,18 @@ h1. Getting Started
2
2
 
3
3
  h2. Installing Buildr
4
4
 
5
- The installation instructions are slightly different for each operating system.
6
- If you are using Ruby, pick the one that best matches your operating system and
7
- target platform.
5
+ The installation instructions are slightly different for each operating system. Pick the one that best matches your operating system and target platform.
8
6
 
9
- p(note). The current release of Buildr for Ruby does not work with Java 6 and
10
- can only be used with Java 1.5 or earlier. "Buildr for JRuby":#jruby works
11
- nicely with Java 6, consider using that instead.
7
+ The @gem install@ and @gem update@ commands install Buildr from a binary distribution provided through "RubyForge":http://rubyforge.org/projects/buildr. This distribution is maintained by contributors to this project, but is *not* an official Apache distribution. You can obtain the official Apache distribution files from the "download page":download.html.
8
+
9
+ The current release of Buildr for Ruby may not work well with Java 6, only Java 1.5 or earlier. If you need to use Java 6, consider "Buildr for JRuby":#jruby.
12
10
 
13
11
 
14
12
  h3. Linux
15
13
 
16
- To get started you will need a recent version of Ruby, Ruby Gems and build
17
- tools for compiling native libraries (@make@, @gcc@ and standard headers).
14
+ To get started you will need a recent version of Ruby, Ruby Gems and build tools for compiling native libraries (@make@, @gcc@ and standard headers).
18
15
 
19
- On *RedHat/Fedora* you can use yum to install Ruby and RubyGems, and then
20
- upgrade to the most recent version of RubyGems:
16
+ On *RedHat/Fedora* you can use yum to install Ruby and RubyGems, and then upgrade to the most recent version of RubyGems:
21
17
 
22
18
  {{{!sh
23
19
  $ sudo yum install ruby rubygems ruby-devel gcc
@@ -30,19 +26,17 @@ On *Ubuntu* you have to install several packages:
30
26
  $ sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential
31
27
  }}}
32
28
 
33
- The Debian package for @rubygems@ will not allow you to install Buildr, so you
34
- need to install RubyGems from source:
29
+ The Debian package for @rubygems@ will not allow you to install Buildr, so you need to install RubyGems from source:
35
30
 
36
31
  {{{!sh
37
- $ curl -OL http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
38
- $ tar xzf rubygems-1.0.1.tgz
39
- $ cd rubygems-1.0.1
32
+ $ wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
33
+ $ tar xzf rubygems-1.2.0.tgz
34
+ $ cd rubygems-1.2.0
40
35
  $ sudo ruby setup.rb
41
36
  $ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
42
37
  }}}
43
38
 
44
- Before installing Buildr, please set the @JAVA_HOME@ environment variable to
45
- point to your JDK distribution. Next, use Ruby Gem to install Buildr:
39
+ Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
46
40
 
47
41
  {{{!sh
48
42
  $ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
@@ -55,19 +49,12 @@ $ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
55
49
  $ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.0
56
50
  }}}
57
51
 
58
- You can also use this script "to install Buildr on
59
- Linux":scripts/install-linux.sh. This script will install Buildr or if already
60
- installed, upgrade to a more recent version. It will also install Ruby 1.8.6
61
- if not already installed (using @yum@ or @apt-get@) and upgrage RubyGems to
62
- 1.0.1.
52
+ You can also use this script "to install Buildr on Linux":scripts/install-linux.sh. This script will install Buildr or if already installed, upgrade to a more recent version. It will also install Ruby 1.8.6 if not already installed (using @yum@ or @apt-get@) and upgrage RubyGems to 1.0.1.
63
53
 
64
54
 
65
- h3. OS/X
55
+ h3. OS X
66
56
 
67
- OS/X 10.5 (Leopard) comes with a recent version of Ruby 1.8.6. OS/X 10.4
68
- (Tiger) includes an older version of Ruby, we recommend you first install Ruby
69
- 1.8.6 using MacPorts (@sudo port install ruby rb-rubygems@), Fink or the
70
- "Ruby One-Click Installer for OS/X":http://rubyosx.rubyforge.org/.
57
+ OS X 10.5 (Leopard) comes with a recent version of Ruby 1.8.6. OS X 10.4 (Tiger) includes an older version of Ruby, we recommend you first install Ruby 1.8.6 using MacPorts (@sudo port install ruby rb-rubygems@), Fink or the "Ruby One-Click Installer for OS X":http://rubyosx.rubyforge.org/.
71
58
 
72
59
  We recommend you first upgrade to the latest version of Ruby gems:
73
60
 
@@ -75,8 +62,7 @@ We recommend you first upgrade to the latest version of Ruby gems:
75
62
  $ sudo gem update --system
76
63
  }}}
77
64
 
78
- Before installing Buildr, please set the @JAVA_HOME@ environment variable to
79
- point to your JDK distribution:
65
+ Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution:
80
66
 
81
67
  {{{!sh
82
68
  $ export JAVA_HOME=/Library/Java/Home
@@ -95,17 +81,12 @@ $ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
95
81
  $ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.0
96
82
  }}}
97
83
 
98
- You can also use this script "to install Buildr on
99
- OS/X":scripts/install-osx.sh. This script will install Buildr or if already
100
- installed, upgrade to a more recent version. It will also install Ruby 1.8.6
101
- if not already installed (using MacPorts) and upgrage RubyGems to 1.0.1.
84
+ You can also use this script "to install Buildr on OS X":scripts/install-osx.sh. This script will install Buildr or if already installed, upgrade to a more recent version. It will also install Ruby 1.8.6 if not already installed (using MacPorts) and upgrage RubyGems to 1.0.1.
102
85
 
103
86
 
104
87
  h3. Windows
105
88
 
106
- If you don't already have Ruby installed, now is the time to do it. The
107
- easiest way to install Ruby is using the "one-click
108
- installer":http://rubyinstaller.rubyforge.org/.
89
+ If you don't already have Ruby installed, now is the time to do it. The easiest way to install Ruby is using the "one-click installer":http://rubyinstaller.rubyforge.org/.
109
90
 
110
91
  We recommend you first upgrade to the latest version of Ruby gems:
111
92
 
@@ -113,17 +94,13 @@ We recommend you first upgrade to the latest version of Ruby gems:
113
94
  > gem update --system
114
95
  }}}
115
96
 
116
- Before installing Buildr, please set the @JAVA_HOME@ environment variable to
117
- point to your JDK distribution. Next, use Ruby Gem to install Buildr:
97
+ Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
118
98
 
119
99
  {{{!sh
120
100
  > gem install buildr
121
101
  }}}
122
102
 
123
- Buildr uses several libraries that include native extensions. During
124
- installation it will ask you to pick a platform for these libraries. By
125
- selecting @mswin32@ it will download and install pre-compiled DLLs for these
126
- extensions.
103
+ Buildr uses several libraries that include native extensions. During installation it will ask you to pick a platform for these libraries. By selecting @mswin32@ it will download and install pre-compiled DLLs for these extensions.
127
104
 
128
105
  To upgrade to a new version or install a specific version:
129
106
 
@@ -135,13 +112,11 @@ To upgrade to a new version or install a specific version:
135
112
 
136
113
  h3. JRuby
137
114
 
138
- If you don't already have JRuby 1.1 or later installed, you can download it
139
- from the "JRuby site":http://dist.codehaus.org/jruby/.
115
+ If you don't already have JRuby 1.1 or later installed, you can download it from the "JRuby site":http://dist.codehaus.org/jruby/.
140
116
 
141
- After uncompressing JRuby, update your @PATH@ to include both @java@ and @jruby@
142
- executables.
117
+ After uncompressing JRuby, update your @PATH@ to include both @java@ and @jruby@ executables.
143
118
 
144
- For Linux and OS/X:
119
+ For Linux and OS X:
145
120
 
146
121
  {{{!sh
147
122
  $ export PATH=$PATH:[path to JRuby]/bin:$JAVA_HOME/bin
@@ -162,29 +137,17 @@ $ jruby -S gem update buildr
162
137
  $ jruby -S gem install buildr -v 1.3.0
163
138
  }}}
164
139
 
165
- You can also use this script "to install Buildr on
166
- JRuby":scripts/install-jruby.sh. This script will install Buildr or if already
167
- installed, upgrade to a more recent version. If necessary, it will also
168
- install JRuby 1.1 in @/opt/jruby@ and update the @PATH@ variable in
169
- @~/.bash_profile@ or @~/.profile@.
140
+ You can also use this script "to install Buildr on JRuby":scripts/install-jruby.sh. This script will install Buildr or if already installed, upgrade to a more recent version. If necessary, it will also install JRuby 1.1 in @/opt/jruby@ and update the @PATH@ variable in @~/.bash_profile@ or @~/.profile@.
170
141
 
171
142
  *Important: Running JRuby and Ruby side by side*
172
143
 
173
- Ruby and JRuby maintain separate Gem repositories, and in fact install
174
- slightly different versions of the Buildr Gem (same functionality, different
175
- dependencies). Installing Buildr for Ruby does not install it for JRuby and
176
- vice versa.
144
+ Ruby and JRuby maintain separate Gem repositories, and in fact install slightly different versions of the Buildr Gem (same functionality, different dependencies). Installing Buildr for Ruby does not install it for JRuby and vice versa.
177
145
 
178
- If you have JRuby installed but not Ruby, the @gem@ and @buildr@ commands will
179
- use JRuby. If you have both JRuby and Ruby installed, follow the instructions
180
- below. To find out if you have Ruby installed (some operating systems include
181
- it by default), run @ruby --version@ from the command line.
146
+ If you have JRuby installed but not Ruby, the @gem@ and @buildr@ commands will use JRuby. If you have both JRuby and Ruby installed, follow the instructions below. To find out if you have Ruby installed (some operating systems include it by default), run @ruby --version@ from the command line.
182
147
 
183
- To work exclusively with JRuby, make sure it shows first on the path, for example,
184
- by setting @PATH=/opt/jruby/bin:$PATH@.
148
+ To work exclusively with JRuby, make sure it shows first on the path, for example, by setting @PATH=/opt/jruby/bin:$PATH@.
185
149
 
186
- You can use JRuby and Ruby side by side, by running scripts with the @-S@
187
- command line argument. For example:
150
+ You can use JRuby and Ruby side by side, by running scripts with the @-S@ command line argument. For example:
188
151
 
189
152
  {{{!
190
153
  $ # with Ruby
@@ -195,12 +158,10 @@ $ jruby -S gem install buildr
195
158
  $ jruby -S buildr
196
159
  }}}
197
160
 
198
- Run @buildr --version@ from the command line to find which version of Buildr
199
- you are using by default. If you see @(JRuby ...)@, Buildr is running on that
200
- version of JRuby.
161
+ Run @buildr --version@ from the command line to find which version of Buildr you are using by default. If you see @(JRuby ...)@, Buildr is running on that version of JRuby.
201
162
 
202
163
 
203
- h2. Conventions
164
+ h2. Document Conventions
204
165
 
205
166
  Lines that start with @$@ are command lines, for example:
206
167
 
@@ -209,35 +170,26 @@ $ # Run Buildr
209
170
  $ buildr
210
171
  }}}
211
172
 
212
- Lines that start with @=>@ show output from the console or the result of a
213
- method, for example:
173
+ Lines that start with @=>@ show output from the console or the result of a method, for example:
214
174
 
215
175
  {{{!sh
216
176
  puts 'Hello world'
217
177
  => "Hello world"
218
178
  }}}
219
179
 
220
- And as you guessed, everything else is Buildfile Ruby or Java code. You can
221
- figure out which language is which.
180
+ And as you guessed, everything else is Buildfile Ruby or Java code. You can figure out which language is which.
222
181
 
223
182
 
224
183
 
225
184
  h2. Running Buildr
226
185
 
227
- You need a *Buildfile*, a build script that tells Buildr all about the projects
228
- it's building, what they contain, what to produce, and so on. The Buildfile
229
- resides in the root directory of your project. We'll talk more about it in
230
- "the next chapter":projects.html. If you don't already have one, ask Buildr to
231
- create it:
186
+ You need a *Buildfile*, a build script that tells Buildr all about the projects it's building, what they contain, what to produce, and so on. The Buildfile resides in the root directory of your project. We'll talk more about it in "the next chapter":projects.html. If you don't already have one, ask Buildr to create it:
232
187
 
233
188
  {{{!sh
234
189
  $ buildr
235
190
  }}}
236
191
 
237
- p(tip). You'll notice that Buildr creates a file called @buildfile@. It's
238
- case sensitive, but Buildr will look for either @buildfile@ or @Buildfile@.
239
- You can also use @Rakefile@ or @rakefile@ for compatibility with previous
240
- versions of Buildr.
192
+ p(tip). You'll notice that Buildr creates a file called @buildfile@. It's case sensitive, but Buildr will look for either @buildfile@ or @Buildfile@.
241
193
 
242
194
  You use Buildr by running the @buildr@ command:
243
195
 
@@ -260,9 +212,9 @@ $ buildr --help
260
212
  | @-r/--require [file]@ | Require MODULE before executing buildfile. |
261
213
  | @-t/--trace@ | Turn on invoke/execute tracing, enable full backtrace. |
262
214
  | @-v/--version@ | Display the program version. |
215
+ | @-P/--prereqs@ | Display tasks and dependencies, then exit. |
263
216
 
264
- You can tell Buildr to run specific tasks and the order to run them. For
265
- example:
217
+ You can tell Buildr to run specific tasks and the order to run them. For example:
266
218
 
267
219
  {{{!sh
268
220
  # Clean and rebuild
@@ -271,15 +223,9 @@ buildr clean build
271
223
  buildr install
272
224
  }}}
273
225
 
274
- If you don't specify a task, Buildr will run the "@build@ task":building.html,
275
- compiling source code and running test cases. Running a task may run other
276
- tasks as well, for example, running the @install@ task will also run @package@.
226
+ If you don't specify a task, Buildr will run the "@build@ task":building.html, compiling source code and running test cases. Running a task may run other tasks as well, for example, running the @install@ task will also run @package@.
277
227
 
278
- There are several "environment
279
- variables":settings_profiles.html#environment_variables that let you control
280
- how Buildr works, for example, to skip test cases during a build, or specify
281
- options for the JVM. Depending on the variable, you may want to set it once in
282
- your environment, or set a different value each time you run Buildr.
228
+ There are several "environment variables":settings_profiles.html#environment_variables that let you control how Buildr works, for example, to skip test cases during a build, or specify options for the JVM. Depending on the variable, you may want to set it once in your environment, or set a different value each time you run Buildr.
283
229
 
284
230
  For example:
285
231
 
@@ -291,10 +237,7 @@ $ buildr TEST=no
291
237
 
292
238
  h2. Help Tasks
293
239
 
294
- Buildr includes a number of informative tasks. Currently that number stands at
295
- two, but we'll be adding more tasks in future releases. These tasks report
296
- information from the Buildfile, so you need one to run them. For more general
297
- help (version number, command line arguments, etc) use @buildr --help@.
240
+ Buildr includes a number of informative tasks. Currently that number stands at two, but we'll be adding more tasks in future releases. These tasks report information from the Buildfile, so you need one to run them. For more general help (version number, command line arguments, etc) use @buildr --help@.
298
241
 
299
242
  To start with, type:
300
243
 
@@ -302,8 +245,7 @@ To start with, type:
302
245
  $ buildr help
303
246
  }}}
304
247
 
305
- You can list the name and description of all your projects using the
306
- @help:projects@ task. For example:
248
+ You can list the name and description of all your projects using the @help:projects@ task. For example:
307
249
 
308
250
  {{{!sh
309
251
  $ buildr help:projects
@@ -313,25 +255,19 @@ killer-app:teh-impl # All those implementation details
313
255
  killer-app:la-web # What our users see
314
256
  }}}
315
257
 
316
- You are, of course, describing your projects for the sake of those who will
317
- maintain your code, right? To describe a project, or a task, call the @desc@
318
- method before the project or task definition.
258
+ You are, of course, describing your projects for the sake of those who will maintain your code, right? To describe a project, or a task, call the @desc@ method before the project or task definition.
319
259
 
320
260
  So next let's talk about "projects":projects.html.
321
261
 
322
262
 
323
- h2. More Info
263
+ h2. Learning More
264
+
265
+ *Ruby* It pays to pick up Ruby as a second (or first) programming language. It's fun, powerful and slightly addictive. If you're interested in learning Ruby the language, a good place to start is "Programming Ruby: The Pragmatic Programmer's Guide":http://www.pragprog.com/titles/ruby/programming-ruby, fondly known as the _Pickaxe book_.
324
266
 
325
- *API* The "Buildr API":http://incubator.apache.org/buildr/rdoc/index.html
326
- documentation.
267
+ For a quicker read (and much more humor), "Why’s (Poignant) Guide to Ruby":http://poignantguide.net/ruby/ is available online. More resources are listed on the "ruby-lang web site":http://www.ruby-lang.org/en/documentation/.
327
268
 
328
- *Rake* Buildr is based on Rake, a Ruby build system that handles tasks and
329
- dependencies. Check out the "Rake documentation":http://docs.rubyrake.org/ for
330
- more information.
269
+ *Rake* Buildr is based on Rake, a Ruby build system that handles tasks and dependencies. Check out the "Rake documentation":http://docs.rubyrake.org/ for more information.
331
270
 
332
- *AntWrap* Buildr uses AntWrap, for configuring and running Ant tasks. You can
333
- learn more from the "Antwrap documentation":http://antwrap.rubyforge.org/.
271
+ *AntWrap* Buildr uses AntWrap, for configuring and running Ant tasks. You can learn more from the "Antwrap documentation":http://antwrap.rubyforge.org/.
334
272
 
335
- *YAML* Buildr uses YAML for its profiles. You can "learn more about YAML
336
- here":http://www.yaml.org, and use this handy "YAML quick
337
- reference":http://www.yaml.org/refcard.html.
273
+ *YAML* Buildr uses YAML for its profiles. You can "learn more about YAML here":http://www.yaml.org, and use this handy "YAML quick reference":http://www.yaml.org/refcard.html.
@@ -1,36 +1,28 @@
1
1
  h1. Welcome
2
2
 
3
- Buildr is a build system for Java applications. We wanted something that's
4
- simple and intuitive to use, so we only need to tell it what to do, and it
5
- takes care of the rest. But also something we can easily extend for those
6
- one-off tasks, with a language that's a joy to use. And of course, we wanted
7
- it to be fast, reliable and have outstanding dependency management.
3
+ h2. What is Buildr?
4
+
5
+ Buildr is a build system for Java applications. We wanted something that's simple and intuitive to use, so we only need to tell it what to do, and it takes care of the rest. But also something we can easily extend for those one-off tasks, with a language that's a joy to use. And of course, we wanted it to be fast, reliable and have outstanding dependency management.
8
6
 
9
7
  Here's what we got:
10
8
 
11
- * A simple way to specify projects, and build large projects out of smaller
12
- sub-projects.
13
- * Pre-canned tasks that require the least amount of configuration, keeping the
14
- build script DRY and simple.
15
- * Compiling, copying and filtering resources, JUnit/TestNG test cases, APT
16
- source code generation, Javadoc and more.
17
- * A dependency mechanism that only builds what has changed since the last
18
- release.
19
- * A drop-in replacement for Maven 2.0, Buildr uses the same file layout,
20
- artifact specifications, local and remote repositories.
21
- * All your Ant tasks belong to us! Anything you can do with Ant, you can do
22
- with Buildr.
23
- * No overhead for building "plugins" or configuration. Just write new tasks or
24
- functions.
25
- * Buildr is Ruby all the way down. No one-off task is too demanding when you
26
- write code using variables, functions and objects.
9
+ * A simple way to specify projects, and build large projects out of smaller sub-projects.
10
+ * Pre-canned tasks that require the least amount of configuration, keeping the build script DRY and simple.
11
+ * Compiling, copying and filtering resources, JUnit/TestNG test cases, APT source code generation, Javadoc and more.
12
+ * A dependency mechanism that only builds what has changed since the last release.
13
+ * A drop-in replacement for Maven 2.0, Buildr uses the same file layout, artifact specifications, local and remote repositories.
14
+ * All your Ant tasks belong to us! Anything you can do with Ant, you can do with Buildr.
15
+ * No overhead for building "plugins" or configuration. Just write new tasks or functions.
16
+ * Buildr is Ruby all the way down. No one-off task is too demanding when you write code using variables, functions and objects.
27
17
  * Simple way to upgrade to new versions.
28
18
  * Did we mention fast?
29
19
 
20
+ So let's get started. You can "read the documentation online":getting_started.html, or "download the PDF":buildr.pdf.
21
+
30
22
 
31
23
  h2. News
32
24
 
33
- Check out "all that's new in Buildr 1.3.1":whats_new.html.
25
+ Check out "all that's new in Buildr 1.3.2":whats_new.html.
34
26
 
35
27
  * Buildr 1.3 now runs on JRuby 1.1
36
28
  * Support for building Scala projects
@@ -46,18 +38,8 @@ Check out "all that's new in Buildr 1.3.1":whats_new.html.
46
38
 
47
39
  h2. Notices
48
40
 
49
- The Apache Software Foundation is a non-profit organization, consider
50
- "sponsoring":http://www.apache.org/foundation/sponsorship.html and check the
51
- "thanks":http://www.apache.org/foundation/thanks.html page.
52
-
53
- Apache Buildr is an effort undergoing incubation at The Apache Software
54
- Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of
55
- all newly accepted projects until a further review indicates that the
56
- infrastructure, communications, and decision making process have stabilized in
57
- a manner consistent with other successful ASF projects. While incubation status
58
- is not necessarily a reflection of the completeness or stability of the code,
59
- it does indicate that the project has yet to be fully endorsed by the ASF.
60
-
61
- "ColorCons":http://www.mouserunner.com/Spheres_ColoCons1_Free_Icons.html,
62
- copyright of Ken Saunders. "DejaVu fonts":http://dejavu.sourceforge.net,
63
- copyright of Bitstream, Inc.
41
+ The Apache Software Foundation is a non-profit organization, consider "sponsoring":http://www.apache.org/foundation/sponsorship.html and check the "thanks":http://www.apache.org/foundation/thanks.html page.
42
+
43
+ Apache Buildr is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
44
+
45
+ "ColorCons":http://www.mouserunner.com/Spheres_ColoCons1_Free_Icons.html, copyright of Ken Saunders. "DejaVu fonts":http://dejavu.sourceforge.net, copyright of Bitstream, Inc.
@@ -0,0 +1,407 @@
1
+ h1. Languages
2
+
3
+
4
+ h2. Java
5
+
6
+
7
+ h3. Compiling Java
8
+
9
+ The Java compiler looks for source files in the project's @src/main/java@ directory, and defaults to compiling them into the @target/classes@ directory. It looks for test cases in the project's @src/test/java@ and defaults to compile them into the @target/test/classes@ directory.
10
+
11
+ If you point the @compile@ task at any other source directory, it will use the Java compiler if any of these directories contains files with the extension @.java@.
12
+
13
+ When using the Java compiler, if you don't specify the packaging type, it defaults to JAR. If you don't specify the test framework, it defaults to JUnit.
14
+
15
+ The Java compiler supports the following options:
16
+
17
+ |_. Option |_. Usage |
18
+ | @:debug@ | Generates bytecode with debugging information. You can also override this by setting the environment variable @debug@ to @off@. |
19
+ | @:deprecation@ | If true, shows deprecation messages. False by default. |
20
+ | @:lint@ | Defaults to false. Set this option to true to use all lint options, or specify a specific lint option (e.g. @:lint=>'cast'@). |
21
+ | @:other@ | Array of options passed to the compiler (e.g. @:other=>'-implicit:none'@). |
22
+ | @:source@ | Source code compatibility (e.g. '1.5'). |
23
+ | @:target@ | Bytecode compatibility (e.g. '1.4'). |
24
+ | @:warnings@ | Issue warnings when compiling. True when running in verbose mode. |
25
+
26
+
27
+ h3. Testing with Java
28
+
29
+ h4. JUnit
30
+
31
+ The default test framework for Java projects is "JUnit 4":http://www.junit.org.
32
+
33
+ When you use JUnit, the dependencies includes JUnit and "JMock":http://www.jmock.org, and Buildr picks up all test classes from the project by looking for classes that either subclass @junit.framework.TestCase@, include methods annotated with @org.junit.Test@, or test suites annotated with @org.org.junit.runner.RunWith@.
34
+
35
+ The JUnit test framework supports the following options:
36
+
37
+ |_. Option |_. Value |
38
+ | @:fork@ | VM forking, defaults to true. |
39
+ | @:clonevm@ | If true clone the VM each time it is forked. |
40
+ | @:properties@ | Hash of system properties available to the test case. |
41
+ | @:environment@ | Hash of environment variables available to the test case. |
42
+ | @:java_args@ | Arguments passed as is to the JVM. |
43
+
44
+ For example, to pass properties to the test case:
45
+
46
+ {{{!ruby
47
+ test.using :properties=>{ :currency=>'USD' }
48
+ }}}
49
+
50
+ There are benefits to running test cases in separate VMs. The default forking mode is @:once@, and you can change it by setting the @:fork@ option.
51
+
52
+ |_. :fork=> |_. Behavior |
53
+ | @:once@ | Create one VM to run all test classes in the project, separate VMs for each project. |
54
+ | @:each@ | Create one VM for each test case class. Slow but provides the best isolation between test classes. |
55
+ | @false@ | Without forking, Buildr runs all test cases in a single VM. This option runs fastest, but at the risk of running out of memory and causing test cases to interfere with each other. |
56
+
57
+ You can see your tests running in the console, and if any tests fail, Buildr will show a list of the failed test classes. In addition, JUnit produces text and XML report files in the project's @reports/junit@ directory. You can use that to get around too-much-stuff-in-my-console, or when using an automated test system.
58
+
59
+ In addition, you can get a consolidated XML or HTML report by running the @junit:report@ task. For example:
60
+
61
+ {{{!sh
62
+ $ buildr test junit:report test=all
63
+ $ firefox report/junit/html/index.html
64
+ }}}
65
+
66
+ The @junit:report@ task generates a report from all tests run so far. If you run tests in a couple of projects, it will generate a report only for these two projects. The example above runs tests in all the projects before generating the reports.
67
+
68
+ You can use the @build.yaml@ settings file to specify a particular version of JUnit or JMock. For example, to force your build to use JUnit version 4.4 and JMock 2.0:
69
+
70
+ {{{!yaml
71
+ junit: 4.4
72
+ jmock: 2.0
73
+ }}}
74
+
75
+
76
+ h4. TestNG
77
+
78
+ You can use "TestNG":http://testng.org instead of JUnit. To select TestNG as the test framework, add this to your project:
79
+
80
+ {{{!ruby
81
+ test.using :testng
82
+ }}}
83
+
84
+ Like all other options you can set with @test.using@, it affects the projects and all its sub-projects, so you only need to do this once at the top-most project to use TestNG throughout. You can also mix TestNG and JUnit by setting different projects to use different frameworks, but you can't mix both frameworks in the same project. (And yes, @test.using :junit@ will switch a project back to using JUnit)
85
+
86
+ TestNG works much like JUnit, it gets included in the dependency list along with JMock, Buildr picks test classes that contain methods annotated with @org.testng.annotations.Test@, and generates test reports in the @reports/testng@ directory. At the moment we don't have consolidated HTML reports for TestNG.
87
+
88
+ The TestNG test framework supports the following options:
89
+
90
+ |_. Option |_. Value |
91
+ | @:properties@ | Hash of system properties available to the test case. |
92
+ | @:java_args@ | Arguments passed as is to the JVM. |
93
+
94
+ You can use the @build.yaml@ settings file to specify a particular version of TestNG, for example, to force your build to use TestNG 5.7:
95
+
96
+ {{{!yaml
97
+ testng: 5.7
98
+ }}}
99
+
100
+
101
+ h4. JBehave
102
+
103
+ "JBehave":http://jbehave.org/ is a pure Java BDD framework, stories and behaviour specifications are written in the Java language.
104
+
105
+ To use JBehave in your project you can select it with @test.using :jbehave@.
106
+
107
+ This framework will search for the following patterns under your project:
108
+
109
+ {{{
110
+ src/spec/java/**/*Behaviour.java
111
+ }}}
112
+
113
+ Supports the following options:
114
+
115
+ |_. Option |_. Value |
116
+ | @:properties@ | Hash of system properties available to the test case. |
117
+ | @:java_args@ | Arguments passed as is to the JVM. |
118
+
119
+ You can use the @build.yaml@ settings file to specify a particular version of JBehave, for example, to force your build to use JBehave 1.0.1:
120
+
121
+ {{{!yaml
122
+ jbehave: 1.0.1
123
+ }}}
124
+
125
+
126
+ h2. Scala
127
+
128
+ Before using Scala features, you must first set the @SCALA_HOME@ environment variable to point to the root of your Scala distribution.
129
+
130
+ On Windows:
131
+
132
+ {{{!sh
133
+ > set SCALA_HOME=C:\Path\To\Scala-2.7.1
134
+ }}}
135
+
136
+ On Linux and other Unix variants,
137
+
138
+ {{{!sh
139
+ > export SCALA_HOME=/path/to/scala-2.7.1
140
+ }}}
141
+
142
+ The @SCALA_HOME@ base directory should be such that Scala core libraries are located directly under the "lib" subdirectory, and Scala scripts are under the "bin" directory.
143
+
144
+ h3. Compiling Scala
145
+
146
+ The Scala compiler looks for source files in the project's @src/main/scala@ directory, and defaults to compiling them into the @target/classes@ directory. It looks for test cases in the project's @src/test/scala@ and defaults to compile them into the @target/test/classes@ directory.
147
+
148
+ If you point the @compile@ task at any other source directory, it will use the Scala compiler if any of these directories contains files with the extension @.scala@.
149
+
150
+ When using the Scala compiler, if you don't specify the packaging type, it defaults to JAR.
151
+
152
+ The Scala compiler supports the following options:
153
+
154
+ |_. Option |_. Usage |
155
+ | @:debug@ | Generates bytecode with debugging information. You can also override this by setting the environment variable @debug@ to @off@. |
156
+ | @:deprecation@ | If true, shows deprecation messages. False by default. |
157
+ | @:optimise@ | Generates faster bytecode by applying optimisations to the program. |
158
+ | @:other@ | Array of options passed to the compiler (e.g. @:other=>'-Xprint-types'@). |
159
+ | @:target@ | Bytecode compatibility (e.g. '1.4'). |
160
+ | @:warnings@ | Issue warnings when compiling. True when running in verbose mode. |
161
+
162
+ h4. Fast Scala Compiler
163
+
164
+ You may use @fsc@, the Fast Scala Compiler, which submits compilation jobs to a compilation daemon, by setting the environment variable @USE_FSC@ to @yes@. Note that @fsc@ _may_ cache class libraries -- don't forget to run @fsc -reset@ if you upgrade a library.
165
+
166
+ h4. Rebuild detection
167
+
168
+ The Scala compiler task assumes that each @.scala@ source file generates a corresponding @.class@ file under @target/classes@ (or @target/test/classses@ for tests). The source may generate more @.class@ files if it contains more than one class, object, trait or for anonymous functions and closures.
169
+
170
+ For example, @src/main/scala/com/example/MyClass.scala@ should generate at least @target/classes/com/example/MyClass.class@. If that it not the case, Buildr will always recompile your sources because it will assume this is a new source file that has never been compiled before.
171
+
172
+ h3. Testing with Scala
173
+
174
+ Buildr supports three Scala testing frameworks: "ScalaTest":http://www.artima.com/scalatest, "ScalaCheck":http://code.google.com/p/scalacheck/ and "Specs":http://code.google.com/p/specs/.
175
+
176
+ Scala testing is automatically enabled if you have any @.scala@ source files under @src/test/scala@. If you are not using this convention, you can explicit set the test framework by doing,
177
+
178
+ {{{!ruby
179
+ test.using(:scalatest)
180
+ }}}
181
+
182
+ The @:scalatest@ test framework handles ScalaTest, Specs and ScalaCheck therefore all 3 frameworks may be used within the same project.
183
+
184
+ h4. ScalaTest
185
+
186
+ Buildr automatically detects and runs tests that extend the @org.scalatest.Suite@ interface.
187
+
188
+ A very simplistic test class might look like,
189
+
190
+ {{{!scala
191
+ class MySuite extends org.scalatest.FunSuite {
192
+ test("addition") {
193
+ val sum = 1 + 1
194
+ assert(sum === 2)
195
+ }
196
+ }
197
+ }}}
198
+
199
+ You can also pass properties to your tests by doing @test.using :properties => { 'name'=>'value' }@, and by overriding the @Suite.runTests@ method in a manner similar to:
200
+
201
+ {{{!scala
202
+ import org.scalatest._
203
+
204
+ class PropertyTestSuite extends FunSuite {
205
+ var properties = Map[String, Any]()
206
+
207
+ test("testProperty") {
208
+ assert(properties("name") === "value")
209
+ }
210
+
211
+ protected override def runTests(testName: Option[String],
212
+ reporter: Reporter, stopper: Stopper, includes: Set[String],
213
+ excludes: Set[String], properties: Map[String, Any])
214
+ {
215
+ this.properties = properties;
216
+ super.runTests(testName, reporter, stopper,
217
+ includes, excludes, properties)
218
+ }
219
+ }
220
+ }}}
221
+
222
+ h4. Specs
223
+
224
+ The @:scalatest@ framework currently recognizes specifications with class names ending with "Specs", e.g., org.example.StringSpecs.
225
+
226
+ A simple specification might look like this:
227
+
228
+ {{{!scala
229
+ import org.specs._
230
+ import org.specs.runner._
231
+
232
+ object StringSpecs extends Specification {
233
+ "empty string" should {
234
+ "have a zero length" in {
235
+ ("".length) mustEqual(0)
236
+ }
237
+ }
238
+ }
239
+ }}}
240
+
241
+ h4. ScalaCheck
242
+
243
+ You may use ScalaCheck inside ScalaTest- and Specs-inherited classes. Here is an example illustrating checks inside a ScalaTest suite,
244
+
245
+ {{{!scala
246
+ import org.scalatest.prop.PropSuite
247
+ import org.scalacheck.Arbitrary._
248
+ import org.scalacheck.Prop._
249
+
250
+ class MySuite extends PropSuite {
251
+
252
+ test("list concatenation") {
253
+ val x = List(1, 2, 3)
254
+ val y = List(4, 5, 6)
255
+ assert(x ::: y === List(1, 2, 3, 4, 5, 6))
256
+ check((a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size)
257
+ }
258
+
259
+ test(
260
+ "list concatenation using a test method",
261
+ (a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size
262
+ )
263
+ }
264
+ }}}
265
+
266
+
267
+ h2. Groovy
268
+
269
+ h3. Compiling Groovy
270
+
271
+ Before using the Groovy compiler, you must first require it on your buildfile:
272
+
273
+ {{{!ruby
274
+ require 'buildr/java/groovyc'
275
+ }}}
276
+
277
+ Once loaded, the groovyc compiler will be automatically selected if any .groovy source files are found under @src/main/groovy@ directory, compiling them by default into the @target/classes@ directory.
278
+
279
+ If the project has java sources in @src/main/java@ they will get compiled using the groovyc joint compiler.
280
+
281
+ Sources found in @src/test/groovy@ are compiled into the @target/test/classes@.
282
+
283
+ If you don't specify the packaging type, it defaults to JAR.
284
+
285
+ The Groovy compiler supports the following options:
286
+
287
+ |_. Option |_. Usage |
288
+ | @encoding@ | Encoding of source files. |
289
+ | @verbose@ | Asks the compiler for verbose output, true when running in verbose mode. |
290
+ | @fork@ | Whether to execute groovyc using a spawned instance of the JVM. Defaults to no. |
291
+ | @memoryInitialSize@ | The initial size of the memory for the underlying VM, if using fork mode, ignored otherwise. Defaults to the standard VM memory setting. (Examples: @83886080@, @81920k@, or @80m@) |
292
+ | @memoryMaximumSize@ | The maximum size of the memory for the underlying VM, if using fork mode, ignored otherwise. Defaults to the standard VM memory setting. (Examples: @83886080@, @81920k@, or @80m@) |
293
+ | @listfiles@ | Indicates whether the source files to be compiled will be listed. Defaults to no. |
294
+ | @stacktrace@ | If true each compile error message will contain a stacktrace. |
295
+ | @warnings@ | Issue warnings when compiling. True when running in verbose mode. |
296
+ | @debug@ | Generates bytecode with debugging information. Set from the debug environment variable/global option. |
297
+ | @deprecation@ | If true, shows deprecation messages. False by default. |
298
+ | @optimise@ | Generates faster bytecode by applying optimisations to the program. |
299
+ | @source@ | Source code compatibility. |
300
+ | @target@ | Bytecode compatibility. |
301
+ | @javac@ | Hash of options passed to the ant javac task. |
302
+
303
+
304
+ h3. Testing with Groovy
305
+
306
+ h4. EasyB
307
+
308
+ "EasyB":http://www.easyb.org/ is a BDD framework using "Groovy":http://groovy.codehaus.org/.
309
+
310
+ Specifications are written in the Groovy language, of course you get seamless Java integration as with all things groovy.
311
+
312
+ To use this framework in your project you can select it with @test.using :easyb@.
313
+
314
+ This framework will search for the following patterns under your project:
315
+
316
+ {{{
317
+ src/spec/groovy/**/*Behavior.groovy
318
+ src/spec/groovy/**/*Story.groovy
319
+ }}}
320
+
321
+ Supports the following options:
322
+
323
+ |_. Option |_. Value |
324
+ | @:properties@ | Hash of system properties available to the test case. |
325
+ | @:java_args@ | Arguments passed as is to the JVM. |
326
+ | @:format@ | Report format, either @:txt@ or @:xml@ |
327
+
328
+
329
+ h2. Ruby
330
+
331
+ h3. Testing with Ruby
332
+
333
+ Buildr provides integration with some ruby testing frameworks, allowing you to test your Java code with state of the art tools.
334
+
335
+ Testing code is written in "Ruby":http://www.ruby-lang.org/en/ language, and is run by using "JRuby":http://jruby.codehaus.org/.That means you have access to all your Java classes and any Java or Ruby tool out there.
336
+
337
+ Because of the use of JRuby, you will notice that running ruby tests is faster when running Buildr on JRuby, as in this case there's no need to run another JVM.
338
+
339
+ p(tip). When not running on JRuby, Buildr will use the @JRUBY_HOME@ environment variable to find the JRuby installation directory. If no @JRUBY_HOME@ is set or it points to an empty directory, Buildr will prompt you to either install JRuby manually or let it extract it for you.
340
+
341
+ You can use the @build.yaml@ settings file to specify a particular version of JRuby (defaults to @1.1.4@). For example:
342
+
343
+ {{{!yaml
344
+ jruby: 1.1.3
345
+ }}}
346
+
347
+ h4. RSpec
348
+
349
+ "RSpec":http://rspec.info/ is the de-facto BDD framework for ruby. It's the framework used to test Buildr itself.
350
+
351
+ To use this framework in your project you can select it with @test.using :rspec@.
352
+
353
+ This framework will search for the following patterns under your project:
354
+
355
+ {{{
356
+ src/spec/ruby/**/*_spec.rb
357
+ }}}
358
+
359
+ Supports the following options:
360
+
361
+ |_. Option |_. Value |
362
+ | @:gems@ | Hash of gems needed before running the tests. Keys are gem names, values are the required gem version. An example use of this option would be to require the ci_reporter gem to generate xml reports |
363
+ | @:requires@ | Array of ruby files to require before running the specs |
364
+ | @:format@ | Array of valid RSpec @--format@ option values. Defaults to html report on the @reports@ directory and text progress |
365
+ | @:output@ | File path to output dump. @false@ to supress output |
366
+ | @:fork@ | Run the tests on a new java vm. (enabled unless running on JRuby) |
367
+ | @:properties@ | Hash of system properties available to the test case. |
368
+ | @:java_args@ | Arguments passed as is to the JVM. (only when fork is enabled) |
369
+
370
+ h4. JtestR
371
+
372
+ "JtestR":http://jtestr.codehaus.org is a tool that makes it easier to test Java code with state of the art Ruby tools. Using JtestR you can describe your application behaviour using many testing frameworks at the same time.
373
+
374
+ To use this framework in your project you can select it with @test.using :jtestr@.
375
+
376
+ You can use the @build.yaml@ settings file to specify a particular version of JtestR (defaults to @0.3.1@). For example:
377
+
378
+ {{{!yaml
379
+ jtestr: 0.3.1
380
+ }}}
381
+
382
+ To customize TestNG/JUnit versions refer to their respective section.
383
+
384
+ When selected, Buildr will configure JtestR to use your project/testing classpath and will search for the following test patterns for each framework supported by JtestR:
385
+
386
+ |_. Framework |_. Patterns |
387
+ | "RSpec":http://rspec.info | Files in @src/spec/ruby@ ending with @*_spec.rb@ or @*_story.rb@ |
388
+ | "TestUnit":http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html | Files in @src/spec/ruby@ ending with @*_test.rb@, @*Test.rb@ |
389
+ | "Expectations":http://expectations.rubyforge.org/ | Files in @src/spec/ruby@ ending with @*_expect.rb@ |
390
+ | "JUnit":http://www.junit.org | Classes from @src/test/java@ that either subclass @junit.framework.TestCase@, include methods annotated with @org.junit.Test@, or test suites annotated with @org.org.junit.runner.RunWith@. |
391
+ | "TestNG":http://testng.org | Classes from @src/test/java@ annotated with @org.testng.annotations.Test@ |
392
+
393
+ If you create a @src/spec/ruby/jtestr_config.rb@ file, it will be loaded by JtestR, just after being configured by Buildr, this way you can configure as described on "JtestR guide":http://jtestr.codehaus.org/Configuration.
394
+
395
+ p(tip). If you have a @jtestr_config.rb@ file, don't set @JtestR::result_handler@. Buildr uses its (@RSpecResultHandler@) so that it can know which tests succeeded/failed, this handler is capable of using RSpec formatter classes, so that you can obtain an html report or use a custom rspec formatter with @JtestR@. See the @format@ option.
396
+
397
+ Supports the following options:
398
+
399
+ |_. Option |_. Value |
400
+ | @:config@ | The JtestR config file to be loaded after being configured by Buildr. Defaults to @src/spec/ruby/jtestr_config.rb@. |
401
+ | @:gems@ | Hash of gems needed before running the tests. Keys are gem names, values are the required gem version. An example use of this option would be to require the ci_reporter gem to generate xml reports |
402
+ | @:requires@ | Array of ruby files to require before running the specs |
403
+ | @:format@ | Array of valid RSpec @--format@ option values. Defaults to html report on the @reports@ directory and text progress |
404
+ | @:output@ | File path to output dump. @false@ to supress output |
405
+ | @:fork@ | Run the tests on a new java vm. (enabled unless running on JRuby) |
406
+ | @:properties@ | Hash of system properties available to the test case. (only when fork is enabled) |
407
+ | @:java_args@ | Arguments passed as is to the JVM. (only when fork is enabled) |