assaf-buildr 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/CHANGELOG +887 -0
  2. data/DISCLAIMER +7 -0
  3. data/LICENSE +176 -0
  4. data/NOTICE +26 -0
  5. data/README.rdoc +146 -0
  6. data/Rakefile +62 -0
  7. data/_buildr +38 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/cobertura.rb +236 -0
  10. data/addon/buildr/emma.rb +238 -0
  11. data/addon/buildr/hibernate.rb +142 -0
  12. data/addon/buildr/javacc.rb +85 -0
  13. data/addon/buildr/jdepend.rb +60 -0
  14. data/addon/buildr/jetty.rb +248 -0
  15. data/addon/buildr/jibx.rb +86 -0
  16. data/addon/buildr/nailgun.rb +817 -0
  17. data/addon/buildr/openjpa.rb +90 -0
  18. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  19. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  20. data/addon/buildr/org/apache/buildr/BuildrNail.java +41 -0
  21. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  22. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  23. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  24. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  25. data/addon/buildr/xmlbeans.rb +93 -0
  26. data/bin/buildr +28 -0
  27. data/buildr.buildfile +53 -0
  28. data/buildr.gemspec +58 -0
  29. data/doc/css/default.css +228 -0
  30. data/doc/css/print.css +100 -0
  31. data/doc/css/syntax.css +52 -0
  32. data/doc/images/apache-incubator-logo.png +0 -0
  33. data/doc/images/buildr-hires.png +0 -0
  34. data/doc/images/buildr.png +0 -0
  35. data/doc/images/favicon.png +0 -0
  36. data/doc/images/growl-icon.tiff +0 -0
  37. data/doc/images/note.png +0 -0
  38. data/doc/images/project-structure.png +0 -0
  39. data/doc/images/tip.png +0 -0
  40. data/doc/images/zbuildr.tif +0 -0
  41. data/doc/pages/artifacts.textile +207 -0
  42. data/doc/pages/building.textile +240 -0
  43. data/doc/pages/contributing.textile +208 -0
  44. data/doc/pages/download.textile +62 -0
  45. data/doc/pages/extending.textile +175 -0
  46. data/doc/pages/getting_started.textile +273 -0
  47. data/doc/pages/index.textile +42 -0
  48. data/doc/pages/languages.textile +407 -0
  49. data/doc/pages/mailing_lists.textile +17 -0
  50. data/doc/pages/more_stuff.textile +286 -0
  51. data/doc/pages/packaging.textile +427 -0
  52. data/doc/pages/projects.textile +274 -0
  53. data/doc/pages/recipes.textile +103 -0
  54. data/doc/pages/settings_profiles.textile +274 -0
  55. data/doc/pages/testing.textile +212 -0
  56. data/doc/pages/troubleshooting.textile +103 -0
  57. data/doc/pages/whats_new.textile +323 -0
  58. data/doc/print.haml +51 -0
  59. data/doc/print.toc.yaml +29 -0
  60. data/doc/scripts/buildr-git.rb +412 -0
  61. data/doc/scripts/install-jruby.sh +44 -0
  62. data/doc/scripts/install-linux.sh +64 -0
  63. data/doc/scripts/install-osx.sh +52 -0
  64. data/doc/site.haml +56 -0
  65. data/doc/site.toc.yaml +47 -0
  66. data/etc/KEYS +151 -0
  67. data/etc/git-svn-authors +16 -0
  68. data/lib/buildr.rb +35 -0
  69. data/lib/buildr/core.rb +27 -0
  70. data/lib/buildr/core/application.rb +489 -0
  71. data/lib/buildr/core/application_cli.rb +139 -0
  72. data/lib/buildr/core/build.rb +311 -0
  73. data/lib/buildr/core/checks.rb +382 -0
  74. data/lib/buildr/core/common.rb +154 -0
  75. data/lib/buildr/core/compile.rb +596 -0
  76. data/lib/buildr/core/environment.rb +120 -0
  77. data/lib/buildr/core/filter.rb +362 -0
  78. data/lib/buildr/core/generate.rb +195 -0
  79. data/lib/buildr/core/help.rb +118 -0
  80. data/lib/buildr/core/progressbar.rb +156 -0
  81. data/lib/buildr/core/project.rb +892 -0
  82. data/lib/buildr/core/test.rb +715 -0
  83. data/lib/buildr/core/transports.rb +558 -0
  84. data/lib/buildr/core/util.rb +289 -0
  85. data/lib/buildr/groovy.rb +18 -0
  86. data/lib/buildr/groovy/bdd.rb +105 -0
  87. data/lib/buildr/groovy/compiler.rb +138 -0
  88. data/lib/buildr/ide.rb +19 -0
  89. data/lib/buildr/ide/eclipse.rb +212 -0
  90. data/lib/buildr/ide/idea.ipr.template +300 -0
  91. data/lib/buildr/ide/idea.rb +189 -0
  92. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  93. data/lib/buildr/ide/idea7x.rb +210 -0
  94. data/lib/buildr/java.rb +23 -0
  95. data/lib/buildr/java/ant.rb +92 -0
  96. data/lib/buildr/java/bdd.rb +449 -0
  97. data/lib/buildr/java/commands.rb +211 -0
  98. data/lib/buildr/java/compiler.rb +348 -0
  99. data/lib/buildr/java/deprecated.rb +141 -0
  100. data/lib/buildr/java/jruby.rb +117 -0
  101. data/lib/buildr/java/jtestr_runner.rb.erb +116 -0
  102. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  103. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +119 -0
  104. data/lib/buildr/java/packaging.rb +713 -0
  105. data/lib/buildr/java/pom.rb +178 -0
  106. data/lib/buildr/java/rjb.rb +155 -0
  107. data/lib/buildr/java/test_result.rb +308 -0
  108. data/lib/buildr/java/tests.rb +324 -0
  109. data/lib/buildr/java/version_requirement.rb +172 -0
  110. data/lib/buildr/packaging.rb +21 -0
  111. data/lib/buildr/packaging/artifact.rb +730 -0
  112. data/lib/buildr/packaging/artifact_namespace.rb +972 -0
  113. data/lib/buildr/packaging/artifact_search.rb +140 -0
  114. data/lib/buildr/packaging/gems.rb +102 -0
  115. data/lib/buildr/packaging/package.rb +233 -0
  116. data/lib/buildr/packaging/tar.rb +104 -0
  117. data/lib/buildr/packaging/zip.rb +722 -0
  118. data/lib/buildr/resources/buildr.icns +0 -0
  119. data/lib/buildr/scala.rb +19 -0
  120. data/lib/buildr/scala/compiler.rb +109 -0
  121. data/lib/buildr/scala/tests.rb +203 -0
  122. data/rakelib/apache.rake +191 -0
  123. data/rakelib/changelog.rake +57 -0
  124. data/rakelib/doc.rake +103 -0
  125. data/rakelib/package.rake +73 -0
  126. data/rakelib/release.rake +65 -0
  127. data/rakelib/rspec.rake +83 -0
  128. data/rakelib/rubyforge.rake +53 -0
  129. data/rakelib/scm.rake +49 -0
  130. data/rakelib/setup.rake +86 -0
  131. data/rakelib/stage.rake +48 -0
  132. data/spec/addon/cobertura_spec.rb +77 -0
  133. data/spec/addon/emma_spec.rb +120 -0
  134. data/spec/addon/test_coverage_spec.rb +255 -0
  135. data/spec/core/application_spec.rb +412 -0
  136. data/spec/core/artifact_namespace_spec.rb +646 -0
  137. data/spec/core/build_spec.rb +415 -0
  138. data/spec/core/checks_spec.rb +537 -0
  139. data/spec/core/common_spec.rb +664 -0
  140. data/spec/core/compile_spec.rb +566 -0
  141. data/spec/core/generate_spec.rb +33 -0
  142. data/spec/core/project_spec.rb +754 -0
  143. data/spec/core/test_spec.rb +1091 -0
  144. data/spec/core/transport_spec.rb +500 -0
  145. data/spec/groovy/bdd_spec.rb +80 -0
  146. data/spec/groovy/compiler_spec.rb +239 -0
  147. data/spec/ide/eclipse_spec.rb +243 -0
  148. data/spec/java/ant.rb +28 -0
  149. data/spec/java/bdd_spec.rb +358 -0
  150. data/spec/java/compiler_spec.rb +446 -0
  151. data/spec/java/java_spec.rb +88 -0
  152. data/spec/java/packaging_spec.rb +1103 -0
  153. data/spec/java/tests_spec.rb +466 -0
  154. data/spec/packaging/archive_spec.rb +503 -0
  155. data/spec/packaging/artifact_spec.rb +754 -0
  156. data/spec/packaging/packaging_helper.rb +63 -0
  157. data/spec/packaging/packaging_spec.rb +589 -0
  158. data/spec/sandbox.rb +137 -0
  159. data/spec/scala/compiler_spec.rb +228 -0
  160. data/spec/scala/tests_spec.rb +215 -0
  161. data/spec/spec_helpers.rb +304 -0
  162. data/spec/version_requirement_spec.rb +123 -0
  163. metadata +369 -0
@@ -0,0 +1,42 @@
1
+ h1. Welcome
2
+
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.
6
+
7
+ Here's what we got:
8
+
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.
17
+ * Simple way to upgrade to new versions.
18
+ * Did we mention fast?
19
+
20
+ So let's get started. You can "read the documentation online":getting_started.html, or "download the PDF":buildr.pdf.
21
+
22
+
23
+ h2. News
24
+
25
+ Check out "all that's new in Buildr 1.3.3":whats_new.html.
26
+
27
+ * Buildr 1.3 now runs on JRuby 1.1 and Ruby 1.8.6.
28
+ * Support for building Scala and Groovy projects.
29
+ * Behavior-Driven Development frameworks (RSpec, JBehave, etc).
30
+ * Profiles and build.yml settings file.
31
+ * New API for accessing Java libraries.
32
+ * More documentation.
33
+ * Other features and bug fixes.
34
+
35
+
36
+ h2. Notices
37
+
38
+ 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.
39
+
40
+ 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.
41
+
42
+ "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) |
@@ -0,0 +1,17 @@
1
+ h1. Mailing Lists
2
+
3
+
4
+ |_. buildr-user |_. For developers working with Buildr |
5
+ | Post | "buildr-user@incubator.apache.org":mailto:buildr-user@incubator.apache.org |
6
+ | Browse | "buildr-user archives":http://mail-archives.apache.org/mod_mbox/incubator-buildr-user/ |
7
+ | Subscribe | "buildr-user-subscribe@incubator.apache.org":mailto:buildr-user-subscribe@incubator.apache.org |
8
+ | Unsubscribe | "buildr-user-unsubscribe@incubator.apache.org":mailto:buildr-user-unsubscribe@incubator.apache.org |
9
+ |_. buildr-dev |_. For development of Buildr itself |
10
+ | Post | "buildr-dev@incubator.apache.org":mailto:buildr-dev@incubator.apache.org |
11
+ | Browse | "buildr-dev archives":http://mail-archives.apache.org/mod_mbox/incubator-buildr-dev/ |
12
+ | Subscribe | "buildr-dev-subscribe@incubator.apache.org":mailto:buildr-dev-subscribe@incubator.apache.org |
13
+ | Unsubscribe | "buildr-dev-unsubscribe@incubator.apache.org":mailto:buildr-dev-unsubscribe@incubator.apache.org |
14
+ |_. buildr-commits |_. Commit messages and JIRA status |
15
+ | Subscribe | "buildr-commits-subscribe@incubator.apache.org":mailto:buildr-commits-subscribe@incubator.apache.org |
16
+ | Unsubscribe | "buildr-commits-unsubscribe@incubator.apache.org":mailto:buildr-commits-unsubscribe@incubator.apache.org |
17
+ | Browse | "buildr-commits archives":http://mail-archives.apache.org/mod_mbox/incubator-buildr-commits/ |