buildr-gemjar 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. data/.braids +8 -0
  2. data/.gitignore +5 -0
  3. data/.rvmrc +1 -0
  4. data/CHANGELOG.md +4 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +20 -0
  7. data/README.md +98 -0
  8. data/Rakefile +8 -0
  9. data/buildr-gemjar.gemspec +42 -0
  10. data/lib/buildr-gemjar.rb +162 -0
  11. data/lib/buildr-gemjar/version.rb +3 -0
  12. data/meta.rakefile +30 -0
  13. data/spec/buildr-gemjar/version_spec.rb +11 -0
  14. data/spec/buildr-gemjar_spec.rb +179 -0
  15. data/spec/repo_builder.rb +59 -0
  16. data/spec/spec_helper.rb +44 -0
  17. data/vendor/buildr/.gitignore +17 -0
  18. data/vendor/buildr/CHANGELOG +1283 -0
  19. data/vendor/buildr/Gemfile +4 -0
  20. data/vendor/buildr/LICENSE +176 -0
  21. data/vendor/buildr/NOTICE +26 -0
  22. data/vendor/buildr/README.rdoc +134 -0
  23. data/vendor/buildr/Rakefile +44 -0
  24. data/vendor/buildr/_buildr +35 -0
  25. data/vendor/buildr/_jbuildr +35 -0
  26. data/vendor/buildr/addon/buildr/antlr.rb +65 -0
  27. data/vendor/buildr/addon/buildr/bnd.rb +147 -0
  28. data/vendor/buildr/addon/buildr/cobertura.rb +22 -0
  29. data/vendor/buildr/addon/buildr/drb.rb +281 -0
  30. data/vendor/buildr/addon/buildr/emma.rb +22 -0
  31. data/vendor/buildr/addon/buildr/hibernate.rb +149 -0
  32. data/vendor/buildr/addon/buildr/javacc.rb +85 -0
  33. data/vendor/buildr/addon/buildr/jaxb_xjc.rb +72 -0
  34. data/vendor/buildr/addon/buildr/jdepend.rb +60 -0
  35. data/vendor/buildr/addon/buildr/jetty.rb +248 -0
  36. data/vendor/buildr/addon/buildr/jibx.rb +86 -0
  37. data/vendor/buildr/addon/buildr/nailgun.rb +221 -0
  38. data/vendor/buildr/addon/buildr/openjpa.rb +88 -0
  39. data/vendor/buildr/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  40. data/vendor/buildr/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  41. data/vendor/buildr/addon/buildr/org/apache/buildr/BuildrNail.java +41 -0
  42. data/vendor/buildr/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  43. data/vendor/buildr/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  44. data/vendor/buildr/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  45. data/vendor/buildr/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  46. data/vendor/buildr/addon/buildr/protobuf.rb +88 -0
  47. data/vendor/buildr/addon/buildr/xmlbeans.rb +93 -0
  48. data/vendor/buildr/all-in-one/_buildr +19 -0
  49. data/vendor/buildr/all-in-one/buildr +368 -0
  50. data/vendor/buildr/all-in-one/buildr.cmd +1 -0
  51. data/vendor/buildr/bin/buildr +19 -0
  52. data/vendor/buildr/buildr.buildfile +58 -0
  53. data/vendor/buildr/buildr.gemspec +74 -0
  54. data/vendor/buildr/doc/_config.yml +1 -0
  55. data/vendor/buildr/doc/_layouts/default.html +90 -0
  56. data/vendor/buildr/doc/_layouts/preface.html +22 -0
  57. data/vendor/buildr/doc/artifacts.textile +217 -0
  58. data/vendor/buildr/doc/building.textile +276 -0
  59. data/vendor/buildr/doc/contributing.textile +268 -0
  60. data/vendor/buildr/doc/css/default.css +236 -0
  61. data/vendor/buildr/doc/css/print.css +101 -0
  62. data/vendor/buildr/doc/css/syntax.css +23 -0
  63. data/vendor/buildr/doc/download.textile +138 -0
  64. data/vendor/buildr/doc/extending.textile +212 -0
  65. data/vendor/buildr/doc/images/1442160941-frontcover.jpg +0 -0
  66. data/vendor/buildr/doc/images/asf-logo.gif +0 -0
  67. data/vendor/buildr/doc/images/asf-logo.png +0 -0
  68. data/vendor/buildr/doc/images/buildr-hires.png +0 -0
  69. data/vendor/buildr/doc/images/buildr.png +0 -0
  70. data/vendor/buildr/doc/images/favicon.png +0 -0
  71. data/vendor/buildr/doc/images/growl-icon.tiff +0 -0
  72. data/vendor/buildr/doc/images/note.png +0 -0
  73. data/vendor/buildr/doc/images/project-structure.png +0 -0
  74. data/vendor/buildr/doc/images/tip.png +0 -0
  75. data/vendor/buildr/doc/images/zbuildr.png +0 -0
  76. data/vendor/buildr/doc/images/zbuildr.tif +0 -0
  77. data/vendor/buildr/doc/index.textile +69 -0
  78. data/vendor/buildr/doc/installing.textile +284 -0
  79. data/vendor/buildr/doc/languages.textile +599 -0
  80. data/vendor/buildr/doc/mailing_lists.textile +29 -0
  81. data/vendor/buildr/doc/more_stuff.textile +845 -0
  82. data/vendor/buildr/doc/packaging.textile +618 -0
  83. data/vendor/buildr/doc/preface.textile +54 -0
  84. data/vendor/buildr/doc/projects.textile +276 -0
  85. data/vendor/buildr/doc/quick_start.textile +210 -0
  86. data/vendor/buildr/doc/releasing.textile +117 -0
  87. data/vendor/buildr/doc/scripts/buildr-git.rb +512 -0
  88. data/vendor/buildr/doc/scripts/gitflow.rb +296 -0
  89. data/vendor/buildr/doc/scripts/install-jruby.sh +44 -0
  90. data/vendor/buildr/doc/scripts/install-linux.sh +73 -0
  91. data/vendor/buildr/doc/scripts/install-osx.sh +52 -0
  92. data/vendor/buildr/doc/settings_profiles.textile +287 -0
  93. data/vendor/buildr/doc/testing.textile +247 -0
  94. data/vendor/buildr/etc/KEYS +189 -0
  95. data/vendor/buildr/lib/buildr.rb +44 -0
  96. data/vendor/buildr/lib/buildr/clojure.rb +34 -0
  97. data/vendor/buildr/lib/buildr/clojure/shell.rb +52 -0
  98. data/vendor/buildr/lib/buildr/core.rb +34 -0
  99. data/vendor/buildr/lib/buildr/core/application.rb +700 -0
  100. data/vendor/buildr/lib/buildr/core/build.rb +516 -0
  101. data/vendor/buildr/lib/buildr/core/cc.rb +166 -0
  102. data/vendor/buildr/lib/buildr/core/checks.rb +253 -0
  103. data/vendor/buildr/lib/buildr/core/common.rb +151 -0
  104. data/vendor/buildr/lib/buildr/core/compile.rb +622 -0
  105. data/vendor/buildr/lib/buildr/core/doc.rb +276 -0
  106. data/vendor/buildr/lib/buildr/core/environment.rb +129 -0
  107. data/vendor/buildr/lib/buildr/core/filter.rb +404 -0
  108. data/vendor/buildr/lib/buildr/core/generate.rb +197 -0
  109. data/vendor/buildr/lib/buildr/core/help.rb +119 -0
  110. data/vendor/buildr/lib/buildr/core/jrebel.rb +42 -0
  111. data/vendor/buildr/lib/buildr/core/linux.rb +30 -0
  112. data/vendor/buildr/lib/buildr/core/osx.rb +46 -0
  113. data/vendor/buildr/lib/buildr/core/progressbar.rb +161 -0
  114. data/vendor/buildr/lib/buildr/core/project.rb +975 -0
  115. data/vendor/buildr/lib/buildr/core/run.rb +43 -0
  116. data/vendor/buildr/lib/buildr/core/shell.rb +137 -0
  117. data/vendor/buildr/lib/buildr/core/test.rb +843 -0
  118. data/vendor/buildr/lib/buildr/core/transports.rb +565 -0
  119. data/vendor/buildr/lib/buildr/core/util.rb +537 -0
  120. data/vendor/buildr/lib/buildr/groovy.rb +20 -0
  121. data/vendor/buildr/lib/buildr/groovy/bdd.rb +106 -0
  122. data/vendor/buildr/lib/buildr/groovy/compiler.rb +153 -0
  123. data/vendor/buildr/lib/buildr/groovy/doc.rb +76 -0
  124. data/vendor/buildr/lib/buildr/groovy/shell.rb +57 -0
  125. data/vendor/buildr/lib/buildr/ide.rb +19 -0
  126. data/vendor/buildr/lib/buildr/ide/eclipse.rb +427 -0
  127. data/vendor/buildr/lib/buildr/ide/eclipse/java.rb +53 -0
  128. data/vendor/buildr/lib/buildr/ide/eclipse/plugin.rb +71 -0
  129. data/vendor/buildr/lib/buildr/ide/eclipse/scala.rb +68 -0
  130. data/vendor/buildr/lib/buildr/ide/idea.rb +576 -0
  131. data/vendor/buildr/lib/buildr/java.rb +25 -0
  132. data/vendor/buildr/lib/buildr/java/ant.rb +94 -0
  133. data/vendor/buildr/lib/buildr/java/bdd.rb +460 -0
  134. data/vendor/buildr/lib/buildr/java/cobertura.rb +297 -0
  135. data/vendor/buildr/lib/buildr/java/commands.rb +223 -0
  136. data/vendor/buildr/lib/buildr/java/compiler.rb +135 -0
  137. data/vendor/buildr/lib/buildr/java/deprecated.rb +141 -0
  138. data/vendor/buildr/lib/buildr/java/doc.rb +86 -0
  139. data/vendor/buildr/lib/buildr/java/ecj.rb +69 -0
  140. data/vendor/buildr/lib/buildr/java/emma.rb +244 -0
  141. data/vendor/buildr/lib/buildr/java/external.rb +73 -0
  142. data/vendor/buildr/lib/buildr/java/jruby.rb +122 -0
  143. data/vendor/buildr/lib/buildr/java/jtestr_result.rb +295 -0
  144. data/vendor/buildr/lib/buildr/java/jtestr_runner.rb.erb +116 -0
  145. data/vendor/buildr/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  146. data/vendor/buildr/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +142 -0
  147. data/vendor/buildr/lib/buildr/java/packaging.rb +734 -0
  148. data/vendor/buildr/lib/buildr/java/pom.rb +178 -0
  149. data/vendor/buildr/lib/buildr/java/rjb.rb +154 -0
  150. data/vendor/buildr/lib/buildr/java/test_result.rb +101 -0
  151. data/vendor/buildr/lib/buildr/java/tests.rb +362 -0
  152. data/vendor/buildr/lib/buildr/java/version_requirement.rb +172 -0
  153. data/vendor/buildr/lib/buildr/packaging.rb +25 -0
  154. data/vendor/buildr/lib/buildr/packaging/archive.rb +535 -0
  155. data/vendor/buildr/lib/buildr/packaging/artifact.rb +903 -0
  156. data/vendor/buildr/lib/buildr/packaging/artifact_namespace.rb +984 -0
  157. data/vendor/buildr/lib/buildr/packaging/artifact_search.rb +140 -0
  158. data/vendor/buildr/lib/buildr/packaging/gems.rb +105 -0
  159. data/vendor/buildr/lib/buildr/packaging/package.rb +249 -0
  160. data/vendor/buildr/lib/buildr/packaging/tar.rb +189 -0
  161. data/vendor/buildr/lib/buildr/packaging/version_requirement.rb +192 -0
  162. data/vendor/buildr/lib/buildr/packaging/zip.rb +178 -0
  163. data/vendor/buildr/lib/buildr/packaging/ziptask.rb +356 -0
  164. data/vendor/buildr/lib/buildr/resources/buildr.icns +0 -0
  165. data/vendor/buildr/lib/buildr/resources/completed.png +0 -0
  166. data/vendor/buildr/lib/buildr/resources/failed.png +0 -0
  167. data/vendor/buildr/lib/buildr/resources/icons-license.txt +17 -0
  168. data/vendor/buildr/lib/buildr/run.rb +195 -0
  169. data/vendor/buildr/lib/buildr/scala.rb +26 -0
  170. data/vendor/buildr/lib/buildr/scala/bdd.rb +118 -0
  171. data/vendor/buildr/lib/buildr/scala/compiler.rb +242 -0
  172. data/vendor/buildr/lib/buildr/scala/doc.rb +142 -0
  173. data/vendor/buildr/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  174. data/vendor/buildr/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  175. data/vendor/buildr/lib/buildr/scala/shell.rb +52 -0
  176. data/vendor/buildr/lib/buildr/scala/tests.rb +171 -0
  177. data/vendor/buildr/lib/buildr/shell.rb +185 -0
  178. data/vendor/buildr/lib/buildr/version.rb +18 -0
  179. data/vendor/buildr/rakelib/all-in-one.rake +113 -0
  180. data/vendor/buildr/rakelib/checks.rake +57 -0
  181. data/vendor/buildr/rakelib/doc.rake +137 -0
  182. data/vendor/buildr/rakelib/metrics.rake +39 -0
  183. data/vendor/buildr/rakelib/package.rake +73 -0
  184. data/vendor/buildr/rakelib/release.rake +161 -0
  185. data/vendor/buildr/rakelib/rspec.rake +101 -0
  186. data/vendor/buildr/rakelib/setup.rake +66 -0
  187. data/vendor/buildr/rakelib/stage.rake +220 -0
  188. data/vendor/buildr/spec/addon/bnd_spec.rb +330 -0
  189. data/vendor/buildr/spec/addon/drb_spec.rb +328 -0
  190. data/vendor/buildr/spec/addon/jaxb_xjc_spec.rb +125 -0
  191. data/vendor/buildr/spec/core/application_spec.rb +631 -0
  192. data/vendor/buildr/spec/core/build_spec.rb +837 -0
  193. data/vendor/buildr/spec/core/cc_spec.rb +224 -0
  194. data/vendor/buildr/spec/core/checks_spec.rb +519 -0
  195. data/vendor/buildr/spec/core/common_spec.rb +725 -0
  196. data/vendor/buildr/spec/core/compile_spec.rb +658 -0
  197. data/vendor/buildr/spec/core/doc_spec.rb +195 -0
  198. data/vendor/buildr/spec/core/extension_spec.rb +201 -0
  199. data/vendor/buildr/spec/core/generate_spec.rb +33 -0
  200. data/vendor/buildr/spec/core/project_spec.rb +772 -0
  201. data/vendor/buildr/spec/core/run_spec.rb +93 -0
  202. data/vendor/buildr/spec/core/shell_spec.rb +146 -0
  203. data/vendor/buildr/spec/core/test_spec.rb +1320 -0
  204. data/vendor/buildr/spec/core/transport_spec.rb +544 -0
  205. data/vendor/buildr/spec/core/util_spec.rb +141 -0
  206. data/vendor/buildr/spec/groovy/bdd_spec.rb +80 -0
  207. data/vendor/buildr/spec/groovy/compiler_spec.rb +251 -0
  208. data/vendor/buildr/spec/groovy/doc_spec.rb +65 -0
  209. data/vendor/buildr/spec/ide/eclipse_spec.rb +739 -0
  210. data/vendor/buildr/spec/ide/idea_spec.rb +1144 -0
  211. data/vendor/buildr/spec/java/ant_spec.rb +37 -0
  212. data/vendor/buildr/spec/java/bdd_spec.rb +374 -0
  213. data/vendor/buildr/spec/java/cobertura_spec.rb +112 -0
  214. data/vendor/buildr/spec/java/commands_spec.rb +93 -0
  215. data/vendor/buildr/spec/java/compiler_spec.rb +252 -0
  216. data/vendor/buildr/spec/java/doc_spec.rb +56 -0
  217. data/vendor/buildr/spec/java/ecj_spec.rb +115 -0
  218. data/vendor/buildr/spec/java/emma_spec.rb +121 -0
  219. data/vendor/buildr/spec/java/external_spec.rb +56 -0
  220. data/vendor/buildr/spec/java/java_spec.rb +132 -0
  221. data/vendor/buildr/spec/java/packaging_spec.rb +1270 -0
  222. data/vendor/buildr/spec/java/run_spec.rb +78 -0
  223. data/vendor/buildr/spec/java/test_coverage_helper.rb +257 -0
  224. data/vendor/buildr/spec/java/tests_spec.rb +497 -0
  225. data/vendor/buildr/spec/packaging/archive_spec.rb +775 -0
  226. data/vendor/buildr/spec/packaging/artifact_namespace_spec.rb +743 -0
  227. data/vendor/buildr/spec/packaging/artifact_spec.rb +1066 -0
  228. data/vendor/buildr/spec/packaging/packaging_helper.rb +63 -0
  229. data/vendor/buildr/spec/packaging/packaging_spec.rb +719 -0
  230. data/vendor/buildr/spec/sandbox.rb +165 -0
  231. data/vendor/buildr/spec/scala/bdd_spec.rb +124 -0
  232. data/vendor/buildr/spec/scala/compiler_spec.rb +289 -0
  233. data/vendor/buildr/spec/scala/doc_spec.rb +88 -0
  234. data/vendor/buildr/spec/scala/scala.rb +38 -0
  235. data/vendor/buildr/spec/scala/tests_spec.rb +283 -0
  236. data/vendor/buildr/spec/spec_helpers.rb +369 -0
  237. data/vendor/buildr/spec/version_requirement_spec.rb +143 -0
  238. data/vendor/buildr/spec/xpath_matchers.rb +121 -0
  239. data/vendor/buildr/tests/BUILDR-320/Buildfile +29 -0
  240. data/vendor/buildr/tests/JavaSystemProperty/Buildfile +18 -0
  241. data/vendor/buildr/tests/JavaSystemProperty/src/test/java/FooTest.java +24 -0
  242. data/vendor/buildr/tests/compile_with_parent/Buildfile +18 -0
  243. data/vendor/buildr/tests/compile_with_parent/child/src/main/java/Foo.java +23 -0
  244. data/vendor/buildr/tests/helloWorld/Buildfile +20 -0
  245. data/vendor/buildr/tests/helloWorld/src/main/java/HelloWorld.java +23 -0
  246. data/vendor/buildr/tests/integration_testing.rb +56 -0
  247. data/vendor/buildr/tests/junit3/Buildfile +9 -0
  248. data/vendor/buildr/tests/junit3/src/main/java/Foo.java +23 -0
  249. data/vendor/buildr/tests/junit3/src/test/java/FooTest.java +28 -0
  250. data/vendor/buildr/tests/package_war_as_jar/Buildfile +15 -0
  251. data/vendor/buildr/tests/package_war_as_jar/src/main/java/Foo.java +19 -0
  252. metadata +524 -0
@@ -0,0 +1,599 @@
1
+ ---
2
+ layout: default
3
+ title: Languages
4
+ ---
5
+
6
+
7
+ h2(#java). Java
8
+
9
+
10
+ h3. Compiling Java
11
+
12
+ 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.
13
+
14
+ 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@.
15
+
16
+ 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.
17
+
18
+ The Java compiler supports the following options:
19
+
20
+ |_. Option |_. Usage |
21
+ | @:debug@ | Generates bytecode with debugging information. You can also override this by setting the environment variable @debug@ to @off@. |
22
+ | @:deprecation@ | If true, shows deprecation messages. False by default. |
23
+ | @:lint@ | Defaults to false. Set this option to true to use all lint options, or specify a specific lint option (e.g. @:lint=>'cast'@). |
24
+ | @:other@ | Array of options passed to the compiler (e.g. @:other=>'-implicit:none'@). |
25
+ | @:source@ | Source code compatibility (e.g. '1.5'). |
26
+ | @:target@ | Bytecode compatibility (e.g. '1.4'). |
27
+ | @:warnings@ | Issue warnings when compiling. True when running in verbose mode. |
28
+
29
+
30
+ h3. Testing with Java
31
+
32
+ h4. JUnit
33
+
34
+ The default test framework for Java projects is "JUnit 4":http://www.junit.org.
35
+
36
+ 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@.
37
+
38
+ The JUnit test framework supports the following options:
39
+
40
+ |_. Option |_. Value |
41
+ | @:fork@ | VM forking, defaults to true. |
42
+ | @:clonevm@ | If true clone the VM each time it is forked. |
43
+ | @:properties@ | Hash of system properties available to the test case. |
44
+ | @:environment@ | Hash of environment variables available to the test case. |
45
+ | @:java_args@ | Arguments passed as is to the JVM. |
46
+
47
+ For example, to pass properties to the test case:
48
+
49
+ {% highlight ruby %}
50
+ test.using :properties=>{ :currency=>'USD' }
51
+ {% endhighlight %}
52
+
53
+ 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.
54
+
55
+ |_. :fork=> |_. Behavior |
56
+ | @:once@ | Create one VM to run all test classes in the project, separate VMs for each project. |
57
+ | @:each@ | Create one VM for each test case class. Slow but provides the best isolation between test classes. |
58
+ | @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. |
59
+
60
+ 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.
61
+
62
+ In addition, you can get a consolidated XML or HTML report by running the @junit:report@ task. For example:
63
+
64
+ {% highlight sh %}
65
+ $ buildr test junit:report test=all
66
+ $ firefox report/junit/html/index.html
67
+ {% endhighlight %}
68
+
69
+ 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.
70
+
71
+ 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:
72
+
73
+ {% highlight yaml %}
74
+ junit: 4.4
75
+ jmock: 2.0
76
+ {% endhighlight %}
77
+
78
+
79
+ h4. TestNG
80
+
81
+ You can use "TestNG":http://testng.org instead of JUnit. To select TestNG as the test framework, add this to your project:
82
+
83
+ {% highlight ruby %}
84
+ test.using :testng
85
+ {% endhighlight %}
86
+
87
+ 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)
88
+
89
+ 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.
90
+
91
+ The TestNG test framework supports the following options:
92
+
93
+ |_. Option |_. Value |
94
+ | @:properties@ | Hash of system properties available to the test case. |
95
+ | @:java_args@ | Arguments passed as is to the JVM. |
96
+
97
+ 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:
98
+
99
+ {% highlight yaml %}
100
+ testng: 5.7
101
+ {% endhighlight %}
102
+
103
+
104
+ h4. JBehave
105
+
106
+ "JBehave":http://jbehave.org/ is a pure Java BDD framework, stories and behaviour specifications are written in the Java language.
107
+
108
+ To use JBehave in your project you can select it with @test.using :jbehave@.
109
+
110
+ This framework will search for the following patterns under your project:
111
+
112
+ {% highlight text %}
113
+ src/spec/java/**/*Behaviour.java
114
+ {% endhighlight %}
115
+
116
+ Supports the following options:
117
+
118
+ |_. Option |_. Value |
119
+ | @:properties@ | Hash of system properties available to the test case. |
120
+ | @:java_args@ | Arguments passed as is to the JVM. |
121
+
122
+ 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:
123
+
124
+ {% highlight yaml %}
125
+ jbehave: 1.0.1
126
+ {% endhighlight %}
127
+
128
+
129
+ h3. Documentation
130
+
131
+ Buildr offers support for using JavaDoc to generate documentation from any Java sources in a project. This is done using the @doc@ task:
132
+
133
+ {% highlight sh %}
134
+ $ buildr doc
135
+ {% endhighlight %}
136
+
137
+ This will use the same @.java@ sources used by the @compile@ task to produce JavaDoc results in the @target/doc/@ directory. By default, these sources are chosen only from the current project. However, it is possible to override this and generate documentation from the sources in a sub-project (potentially more than one):
138
+
139
+ {% highlight ruby %}
140
+ define 'foo' do
141
+ # ...
142
+
143
+ doc.from projects('foo:bar', 'foo')
144
+
145
+ define 'bar' do
146
+ # ...
147
+ end
148
+ end
149
+ {% endhighlight %}
150
+
151
+ With this configuration, the @doc@ task will use sources from both @foo:bar@ and
152
+ @foo@.
153
+
154
+ The @doc@ task supports any option that the @javadoc@ command does (e.g. @-windowtitle@). To pass an option to the JavaDoc generator, simply specify it using the @doc@ method:
155
+
156
+ {% highlight ruby %}
157
+ define 'foo' do
158
+ # ...
159
+
160
+ doc :windowtitle => 'Abandon All Hope, Ye Who Enter Here', :private => true
161
+ end
162
+ {% endhighlight %}
163
+
164
+
165
+ h2(#scala). Scala
166
+
167
+ Before using Scala, you must first @require@ the Scala compiler:
168
+
169
+ {% highlight ruby %}
170
+ require 'buildr/scala'
171
+ {% endhighlight %}
172
+
173
+ By default, Buildr will attempt to use the latest stable release of Scala, which is currently Scala 2.8.0 as of July 2010. Of course you can configure a specific version of Scala for your project by adding the following entry in @build.yaml@:
174
+
175
+ {% highlight yaml %}
176
+ scala.version: 2.8.0.Beta1 # Pick your version
177
+ {% endhighlight %}
178
+
179
+ Or, you can do the same programmatically:
180
+
181
+ {% highlight yaml %}
182
+ # Must be placed before require 'buildr/scala'
183
+ Buildr.settings.build['scala.version'] = "2.8.0.Beta1"
184
+ {% endhighlight %}
185
+
186
+ You may also determine the version in use by querying the @Scala.version@ attribute:
187
+
188
+ {% highlight ruby %}
189
+ Scala.version # => '2.8.0'
190
+ {% endhighlight %}
191
+
192
+ Regardless of how the Scala version is determined, if you have the same Scala version installed on your system and the SCALA_HOME environment variable points to it, then your local installation will be used. Otherwise, Buildr will download it from the "Scala Tools repository":http://scala-tools.org/ which is automatically enlisted when you @require@ Scala. The only drawback if you don't have a local installation is the FSC compiler won't be available.
193
+
194
+ p(tip). For Mac users, if you have installed Scala via "MacPorts":http://www.macports.org/ Buildr will look in the
195
+ @/opt/local/share/scala/@ directory if you have not set @SCALA_HOME@.
196
+
197
+
198
+ h3. Compiling Scala
199
+
200
+ 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.
201
+
202
+ Any Java source files found in the @src/main/java@ directory will be compiled using the Scala/Java joint compiler into the @target/classes@ directory. Both the Java and the Scala sources are compiled with an inclusive classpath, meaning that you may have a Java class which depends upon a Scala class which depends upon a Java class, all within the same project. The Java sources will be compiled with the same dependencies as the Scala sources with the addition of the @scala-library.jar@ file as required for Scala interop.
203
+
204
+ Note that you cannot use the Groovy *and* the Scala joint compilers in the same project. If both are required, the Groovy joint compiler will take precedence.
205
+ +
206
+ 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@. The joint compilation of Java sources may only be pointed at an alternative directory using the feature to redefine the @_(:src, :main, :java)@ path.
207
+
208
+ When using the Scala compiler, if you don't specify the packaging type, it defaults to JAR.
209
+
210
+ The Scala compiler supports the following options:
211
+
212
+ |_. Option |_. Usage |
213
+ | @:debug@ | Generates bytecode with debugging information. You can also override this by setting the environment variable @debug@ to @off@. |
214
+ | @:deprecation@ | If true, shows deprecation messages. False by default. |
215
+ | @:optimise@ | Generates faster bytecode by applying optimisations to the program. |
216
+ | @:other@ | Array of options passed to the compiler (e.g. @:other=>'-Xprint-types'@). |
217
+ | @:make@ | Make strategy to be used by the compiler (e.g. @:make=>'transitive'@). *Scala 2.8 only* |
218
+ | @:target@ | Bytecode compatibility (e.g. '1.4'). |
219
+ | @:warnings@ | Issue warnings when compiling. True when running in verbose mode. |
220
+ | @:javac@ | A hash of options passed to the @javac@ compiler verbatim. |
221
+
222
+ h4. Fast Scala Compiler
223
+
224
+ 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.
225
+
226
+ h4. Rebuild detection
227
+
228
+ The Scala 2.7 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.
229
+
230
+ 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.
231
+
232
+ Fortunately, Scala 2.8 provides a substantially better interface for implementing change detection. Whenever you use Scala 2.8 (see below), Buildr will auto-detect the version and enable this feature dynamically. After the @compile@ task runs, the relevant target directory will contain a @.scala-deps@ file, generated by the Scala compiler. The manner in which this file is used can be configured using the @:make@ compiler option. The following values are available:
233
+
234
+ * @:all@ - Disables compiler-level change detection
235
+ * @:changed@ - Only build changed files without considering file dependencies
236
+ * @:immediate@ - *unknown*
237
+ * @:transitive@ - Build changed files as well as their transitive file dependencies
238
+ * @:transitivenocp@ - Build changed files as well as their transitive file dependencies (*default*)
239
+
240
+ Please note that there are limits to compiler-level change detection. Most notably, dependencies cannot be tracked across separate compilation targets. This would cause problems in the case where an API has been changed in a main source file. The test suite for the project will *not* be detected as requiring recompilation, potentially resulting in unexpected runtime exceptions. When in doubt, run @clean@ to remove all dependency information. In extreme cases, it is possible to completely disable compiler-level change detection by adding the following statement to your project definition:
241
+
242
+ {% highlight ruby %}
243
+ compile.using :make => :all
244
+ {% endhighlight %}
245
+
246
+ Effectively, this is telling the Scala compiler to ignore the information it has built up regarding source file dependencies. When in this mode, only Buildr's change detection semantics remain in play (as described above).
247
+
248
+ To avoid unusual behavior, compiler-level change detection is disabled whenever the joint Scala-Java compiler is used. Thus, any @.java@ files in a project handled by the Scala compiler will cause the @:make@ option to be ignored and revert to the exclusive use of Buildr's change detection mechanism (as described above).
249
+
250
+ h4. Scala 2.8
251
+
252
+ As of version 1.4, Buildr has *non-default* support for Scala 2.8. If your @SCALA_HOME@ environment variable is pointing to an installation of Scala 2.8, then Buildr will use that compiler and enable 2.8-specific features.
253
+
254
+ As Scala 2.8 is currently pre-release, it is often desirable to maintain an installation of Scala 2.7 concurrently with Scala 2.8, defaulting to the former with the option to select the latter on a project-by-project basis. This is most easily accomplished by setting @SCALA_HOME@ to point to the Scala 2.7 installation and @SCALA28_HOME@ to point to the Scala 2.8 installation. With this configuration in place, Scala 2.8 can be selected for a specific project by dynamically reassigning @SCALA_HOME@ at the top of the buildfile (*before* @require 'buildr/scala'@):
255
+
256
+ {% highlight ruby %}
257
+ ENV['SCALA_HOME'] = ENV['SCALA28_HOME']
258
+
259
+ require 'buildr/scala'
260
+ ...
261
+ {% endhighlight %}
262
+
263
+ h3. Testing with Scala
264
+
265
+ Buildr supports two main Scala testing frameworks: "ScalaTest":http://www.artima.com/scalatest and "Specs":http://code.google.com/p/specs/. "ScalaCheck":http://code.google.com/p/scalacheck/ is also supported within the confines of either of these two frameworks. Thus, your Specs may use ScalaCheck properties, as may your ScalaTest suites.
266
+
267
+ {% highlight ruby %}
268
+ test.using(:scalatest)
269
+ {% endhighlight %}
270
+
271
+ h4. ScalaTest
272
+
273
+ ScalaTest support is activated automatically when there are any @.scala@ source files contained in the @src/test/scala@ directory. If you are not using this directory convention, you may force the test framework by using the @test.using :scalatest@ directive.
274
+
275
+ Buildr automatically detects and runs tests that extend the @org.scalatest.Suite@ interface.
276
+
277
+ A very simplistic test class might look like,
278
+
279
+ {% highlight scala %}
280
+ class MySuite extends org.scalatest.FunSuite {
281
+ test("addition") {
282
+ val sum = 1 + 1
283
+ assert(sum === 2)
284
+ }
285
+ }
286
+ {% endhighlight %}
287
+
288
+ 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:
289
+
290
+ {% highlight scala %}
291
+ import org.scalatest._
292
+
293
+ class PropertyTestSuite extends FunSuite {
294
+ var properties = Map[String, Any]()
295
+
296
+ test("testProperty") {
297
+ assert(properties("name") === "value")
298
+ }
299
+
300
+ protected override def runTests(testName: Option[String],
301
+ reporter: Reporter, stopper: Stopper, includes: Set[String],
302
+ excludes: Set[String], properties: Map[String, Any])
303
+ {
304
+ this.properties = properties;
305
+ super.runTests(testName, reporter, stopper,
306
+ includes, excludes, properties)
307
+ }
308
+ }
309
+ {% endhighlight %}
310
+
311
+ h4. Specs
312
+
313
+ Specs is automatically selected whenever there are @.scala@ source files under the @src/spec/scala@ directory. It is also possible to force selection of the test framework by using the @test.using :specs@ directive. This can sometimes be useful when Scala sources may be found in *both* @src/test/scala@ and @src/spec/scala@. Normally in such cases, ScalaTest will have selection precedence, meaning that in case of a conflict between it and Specs, ScalaTest will be chosen.
314
+
315
+ Any objects which extend the @org.specs.Specification@ superclass will be automatically detected and run. Note that any *classes* which extend @Specification@ will also be invoked. As such classes will not have a @main@ method, such an invocation will raise an error.
316
+
317
+ A simple specification might look like this:
318
+
319
+ {% highlight scala %}
320
+ import org.specs._
321
+ import org.specs.runner._
322
+
323
+ object StringSpecs extends Specification {
324
+ "empty string" should {
325
+ "have a zero length" in {
326
+ "".length mustBe 0
327
+ }
328
+ }
329
+ }
330
+ {% endhighlight %}
331
+
332
+ ScalaCheck is automatically added to the classpath when Specs is used. However, JMock, Mockito, CGlib and similar are _not_. This is to avoid downloading extraneous artifacts which are only used by a small percentage of specifications. To use Specs with Mockito (or any other library) in a Buildr project, simply add the appropriate dependencies to @test.with@:
333
+
334
+ {% highlight ruby %}
335
+ MOCKITO = 'org.mockito:mockito-all:jar:1.7'
336
+ CGLIB = 'cglib:cglib:jar:2.1_3'
337
+ ASM = 'asm:asm:jar:1.5.3'
338
+ OBJENESIS = 'org.objenesis:objenesis:jar:1.1'
339
+
340
+ define 'killer-app' do
341
+ ...
342
+
343
+ test.with MOCKITO, CGLIB, ASM, OBJENESIS
344
+ end
345
+ {% endhighlight %}
346
+
347
+ The dependencies for Specs's optional features are defined "here":http://code.google.com/p/specs/wiki/RunningSpecs#Dependencies.
348
+
349
+ h4. ScalaCheck
350
+
351
+ You may use ScalaCheck inside ScalaTest- and Specs-inherited classes. Here is an example illustrating checks inside a ScalaTest suite,
352
+
353
+ {% highlight scala %}
354
+ import org.scalatest.prop.PropSuite
355
+ import org.scalacheck.Arbitrary._
356
+ import org.scalacheck.Prop._
357
+
358
+ class MySuite extends PropSuite {
359
+
360
+ test("list concatenation") {
361
+ val x = List(1, 2, 3)
362
+ val y = List(4, 5, 6)
363
+ assert(x ::: y === List(1, 2, 3, 4, 5, 6))
364
+ check((a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size)
365
+ }
366
+
367
+ test(
368
+ "list concatenation using a test method",
369
+ (a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size
370
+ )
371
+ }
372
+ {% endhighlight %}
373
+
374
+
375
+ h3. Documentation
376
+
377
+ Buildr offers support for using ScalaDoc or VScalaDoc to generate documentation from any Scala sources in a project. This is done using the @doc@ task:
378
+
379
+ {% highlight sh %}
380
+ $ buildr doc
381
+ {% endhighlight %}
382
+
383
+ This will use the same @.scala@ sources used by the @compile@ task to produce ScalaDoc results in the @target/doc/@ directory. By default, these sources are chosen only from the current project. However, it is possible to override this and generate documentation from the sources in a sub-project (potentially more than one):
384
+
385
+ {% highlight ruby %}
386
+ define 'foo' do
387
+ # ...
388
+
389
+ doc.from projects('foo:bar', 'foo')
390
+
391
+ define 'bar' do
392
+ # ...
393
+ end
394
+ end
395
+ {% endhighlight %}
396
+
397
+ With this configuration, the @doc@ task will use sources from both @foo:bar@ and
398
+ @foo@.
399
+
400
+ The @doc@ task supports any option that the @scaladoc@ command does (e.g. @-windowtitle@). To pass an option to the ScalaDoc (or VScalaDoc) generator, simply specify it using the @doc@ method:
401
+
402
+ {% highlight ruby %}
403
+ define 'foo' do
404
+ # ...
405
+
406
+ doc :windowtitle => 'Abandon All Hope, Ye Who Enter Here', :private => true
407
+ end
408
+ {% endhighlight %}
409
+
410
+ By default, the @doc@ task will use the ScalaDoc generator on Scala projects. To select the VScalaDoc generator, you must use the @doc.using@ invocation:
411
+
412
+ {% highlight ruby %}
413
+ define 'foo' do
414
+ doc.using :vscaladoc
415
+ end
416
+ {% endhighlight %}
417
+
418
+ The @doc@ task is *not* joint-compilation aware. Thus, it will only generate ScalaDoc for mixed-source projects, it will not attempt to generate both JavaDoc and ScalaDoc.
419
+
420
+
421
+ h2(#groovy). Groovy
422
+
423
+ h3. Compiling Groovy
424
+
425
+ Before using the Groovy compiler, you must first require it on your buildfile:
426
+
427
+ {% highlight ruby %}
428
+ require 'buildr/java/groovyc'
429
+ {% endhighlight %}
430
+
431
+ 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.
432
+
433
+ If the project has java sources in @src/main/java@ they will get compiled using the groovyc joint compiler.
434
+
435
+ Sources found in @src/test/groovy@ are compiled into the @target/test/classes@.
436
+
437
+ If you don't specify the packaging type, it defaults to JAR.
438
+
439
+ The Groovy compiler supports the following options:
440
+
441
+ |_. Option |_. Usage |
442
+ | @encoding@ | Encoding of source files. |
443
+ | @verbose@ | Asks the compiler for verbose output, true when running in verbose mode. |
444
+ | @fork@ | Whether to execute groovyc using a spawned instance of the JVM. Defaults to no. |
445
+ | @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@) |
446
+ | @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@) |
447
+ | @listfiles@ | Indicates whether the source files to be compiled will be listed. Defaults to no. |
448
+ | @stacktrace@ | If true each compile error message will contain a stacktrace. |
449
+ | @warnings@ | Issue warnings when compiling. True when running in verbose mode. |
450
+ | @debug@ | Generates bytecode with debugging information. Set from the debug environment variable/global option. |
451
+ | @deprecation@ | If true, shows deprecation messages. False by default. |
452
+ | @optimise@ | Generates faster bytecode by applying optimisations to the program. |
453
+ | @source@ | Source code compatibility. |
454
+ | @target@ | Bytecode compatibility. |
455
+ | @javac@ | Hash of options passed to the ant javac task. |
456
+
457
+
458
+ h3. Testing with Groovy
459
+
460
+ h4. EasyB
461
+
462
+ "EasyB":http://www.easyb.org/ is a BDD framework using "Groovy":http://groovy.codehaus.org/.
463
+
464
+ Specifications are written in the Groovy language, of course you get seamless Java integration as with all things groovy.
465
+
466
+ To use this framework in your project you can select it with @test.using :easyb@.
467
+
468
+ This framework will search for the following patterns under your project:
469
+
470
+ {% highlight text %}
471
+ src/spec/groovy/**/*Behavior.groovy
472
+ src/spec/groovy/**/*Story.groovy
473
+ {% endhighlight %}
474
+
475
+ Supports the following options:
476
+
477
+ |_. Option |_. Value |
478
+ | @:properties@ | Hash of system properties available to the test case. |
479
+ | @:java_args@ | Arguments passed as is to the JVM. |
480
+ | @:format@ | Report format, either @:txt@ or @:xml@ |
481
+
482
+
483
+ h3. Documentation
484
+
485
+ Buildr offers support for using GroovyDoc to generate documentation from any Groovy sources in a project. This is done using the @doc@ task:
486
+
487
+ {% highlight sh %}
488
+ $ buildr doc
489
+ {% endhighlight %}
490
+
491
+ This will use the same @.groovy@ sources used by the @compile@ task to produce GroovyDoc results in the @target/doc/@ directory. By default, these sources are chosen only from the current project. However, it is possible to override this and generate documentation from the sources in a sub-project (potentially more than one):
492
+
493
+ {% highlight ruby %}
494
+ define 'foo' do
495
+ # ...
496
+
497
+ doc.from projects('foo:bar', 'foo')
498
+
499
+ define 'bar' do
500
+ # ...
501
+ end
502
+ end
503
+ {% endhighlight %}
504
+
505
+ With this configuration, the @doc@ task will use sources from both @foo:bar@ and
506
+ @foo@.
507
+
508
+ The @doc@ task supports any option that the @groovydoc@ command does (e.g. @-windowtitle@). To pass an option to the GroovyDoc generator, simply specify it using the @doc@ method:
509
+
510
+ {% highlight ruby %}
511
+ define 'foo' do
512
+ # ...
513
+
514
+ doc :windowtitle => 'Abandon All Hope, Ye Who Enter Here', :private => true
515
+ end
516
+ {% endhighlight %}
517
+
518
+ The @doc@ task is *not* joint-compilation aware. Thus, it will only generate GroovyDoc for mixed-source projects, it will not attempt to generate both JavaDoc and GroovyDoc.
519
+
520
+
521
+ h2(#ruby). Ruby
522
+
523
+ h3. Testing with Ruby
524
+
525
+ Buildr provides integration with some ruby testing frameworks, allowing you to test your Java code with state of the art tools.
526
+
527
+ 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.
528
+
529
+ 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.
530
+
531
+ 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.
532
+
533
+ You can use the @build.yaml@ settings file to specify a particular version of JRuby (defaults to @1.4.0@ as of Buildr 1.3.5). For example:
534
+
535
+ {% highlight yaml %}
536
+ jruby: 1.3.1
537
+ {% endhighlight %}
538
+
539
+ h4. RSpec
540
+
541
+ "RSpec":http://rspec.info/ is the de-facto BDD framework for ruby. It's the framework used to test Buildr itself.
542
+
543
+ To use this framework in your project you can select it with @test.using :rspec@.
544
+
545
+ This framework will search for the following patterns under your project:
546
+
547
+ {% highlight text %}
548
+ src/spec/ruby/**/*_spec.rb
549
+ {% endhighlight %}
550
+
551
+ Supports the following options:
552
+
553
+ |_. Option |_. Value |
554
+ | @: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 |
555
+ | @:requires@ | Array of ruby files to require before running the specs |
556
+ | @:format@ | Array of valid RSpec @--format@ option values. Defaults to html report on the @reports@ directory and text progress |
557
+ | @:output@ | File path to output dump. @false@ to supress output |
558
+ | @:fork@ | Run the tests on a new java vm. (enabled unless running on JRuby) |
559
+ | @:properties@ | Hash of system properties available to the test case. |
560
+ | @:java_args@ | Arguments passed as is to the JVM. (only when fork is enabled) |
561
+
562
+ h4. JtestR
563
+
564
+ "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.
565
+
566
+ To use this framework in your project you can select it with @test.using :jtestr@.
567
+
568
+ You can use the @build.yaml@ settings file to specify a particular version of JtestR (defaults to @0.3.1@). For example:
569
+
570
+ {% highlight yaml %}
571
+ jtestr: 0.3.1
572
+ {% endhighlight %}
573
+
574
+ To customize TestNG/JUnit versions refer to their respective section.
575
+
576
+ 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:
577
+
578
+ |_. Framework |_. Patterns |
579
+ | "RSpec":http://rspec.info | Files in @src/spec/ruby@ ending with @*_spec.rb@ or @*_story.rb@ |
580
+ | "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@ |
581
+ | "Expectations":http://expectations.rubyforge.org/ | Files in @src/spec/ruby@ ending with @*_expect.rb@ |
582
+ | "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@. |
583
+ | "TestNG":http://testng.org | Classes from @src/test/java@ annotated with @org.testng.annotations.Test@ |
584
+
585
+ 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.
586
+
587
+ 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.
588
+
589
+ Supports the following options:
590
+
591
+ |_. Option |_. Value |
592
+ | @:config@ | The JtestR config file to be loaded after being configured by Buildr. Defaults to @src/spec/ruby/jtestr_config.rb@. |
593
+ | @: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 |
594
+ | @:requires@ | Array of ruby files to require before running the specs |
595
+ | @:format@ | Array of valid RSpec @--format@ option values. Defaults to html report on the @reports@ directory and text progress |
596
+ | @:output@ | File path to output dump. @false@ to supress output |
597
+ | @:fork@ | Run the tests on a new java vm. (enabled unless running on JRuby) |
598
+ | @:properties@ | Hash of system properties available to the test case. (only when fork is enabled) |
599
+ | @:java_args@ | Arguments passed as is to the JVM. (only when fork is enabled) |