buildr 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/CHANGELOG +76 -0
  2. data/NOTICE +1 -1
  3. data/README.rdoc +9 -21
  4. data/Rakefile +20 -37
  5. data/_buildr +3 -12
  6. data/{doc/print.toc.yaml → _jbuildr} +14 -14
  7. data/addon/buildr/cobertura.rb +5 -219
  8. data/addon/buildr/drb.rb +281 -0
  9. data/addon/buildr/emma.rb +5 -221
  10. data/addon/buildr/nailgun.rb +93 -689
  11. data/bin/buildr +0 -9
  12. data/buildr.buildfile +4 -4
  13. data/buildr.gemspec +27 -21
  14. data/doc/_layouts/default.html +82 -0
  15. data/doc/_layouts/preface.html +22 -0
  16. data/doc/{pages/artifacts.textile → artifacts.textile} +82 -42
  17. data/doc/{pages/building.textile → building.textile} +89 -47
  18. data/doc/{pages/contributing.textile → contributing.textile} +53 -45
  19. data/doc/css/default.css +6 -5
  20. data/doc/css/print.css +17 -24
  21. data/doc/css/syntax.css +7 -36
  22. data/doc/download.textile +78 -0
  23. data/doc/{pages/extending.textile → extending.textile} +45 -24
  24. data/doc/{pages/getting_started.textile → getting_started.textile} +146 -88
  25. data/doc/images/asf-logo.gif +0 -0
  26. data/doc/images/note.png +0 -0
  27. data/doc/index.textile +47 -0
  28. data/doc/{pages/languages.textile → languages.textile} +108 -54
  29. data/doc/mailing_lists.textile +25 -0
  30. data/doc/{pages/more_stuff.textile → more_stuff.textile} +152 -73
  31. data/doc/{pages/packaging.textile → packaging.textile} +181 -96
  32. data/doc/preface.textile +28 -0
  33. data/doc/{pages/projects.textile → projects.textile} +55 -40
  34. data/doc/scripts/buildr-git.rb +364 -264
  35. data/doc/scripts/gitflow.rb +296 -0
  36. data/doc/scripts/install-jruby.sh +2 -2
  37. data/doc/scripts/install-linux.sh +6 -6
  38. data/doc/scripts/install-osx.sh +2 -2
  39. data/doc/{pages/settings_profiles.textile → settings_profiles.textile} +83 -45
  40. data/doc/{pages/testing.textile → testing.textile} +77 -41
  41. data/lib/buildr.rb +5 -5
  42. data/lib/buildr/core.rb +2 -0
  43. data/lib/buildr/core/application.rb +321 -151
  44. data/lib/buildr/core/build.rb +298 -167
  45. data/lib/buildr/core/checks.rb +4 -132
  46. data/lib/buildr/core/common.rb +1 -5
  47. data/lib/buildr/core/compile.rb +3 -9
  48. data/lib/buildr/core/environment.rb +12 -3
  49. data/lib/buildr/core/filter.rb +20 -18
  50. data/lib/buildr/core/generate.rb +36 -36
  51. data/lib/buildr/core/help.rb +2 -1
  52. data/lib/buildr/core/osx.rb +46 -0
  53. data/lib/buildr/core/progressbar.rb +1 -1
  54. data/lib/buildr/core/project.rb +7 -34
  55. data/lib/buildr/core/test.rb +12 -6
  56. data/lib/buildr/core/transports.rb +13 -11
  57. data/lib/buildr/core/util.rb +14 -23
  58. data/lib/buildr/groovy/bdd.rb +3 -2
  59. data/lib/buildr/groovy/compiler.rb +1 -1
  60. data/lib/buildr/ide/eclipse.rb +31 -21
  61. data/lib/buildr/ide/idea.rb +3 -2
  62. data/lib/buildr/ide/idea7x.rb +6 -4
  63. data/lib/buildr/java/ant.rb +3 -1
  64. data/lib/buildr/java/bdd.rb +9 -7
  65. data/lib/buildr/java/cobertura.rb +243 -0
  66. data/lib/buildr/java/compiler.rb +5 -4
  67. data/lib/buildr/java/emma.rb +244 -0
  68. data/lib/buildr/java/packaging.rb +11 -8
  69. data/lib/buildr/java/pom.rb +0 -4
  70. data/lib/buildr/java/rjb.rb +1 -1
  71. data/lib/buildr/java/test_result.rb +5 -7
  72. data/lib/buildr/java/tests.rb +17 -11
  73. data/lib/buildr/packaging.rb +5 -2
  74. data/lib/buildr/packaging/archive.rb +488 -0
  75. data/lib/buildr/packaging/artifact.rb +48 -29
  76. data/lib/buildr/packaging/artifact_namespace.rb +6 -6
  77. data/lib/buildr/packaging/gems.rb +4 -4
  78. data/lib/buildr/packaging/package.rb +3 -2
  79. data/lib/buildr/packaging/tar.rb +85 -3
  80. data/lib/buildr/packaging/version_requirement.rb +172 -0
  81. data/lib/buildr/packaging/zip.rb +24 -682
  82. data/lib/buildr/packaging/ziptask.rb +313 -0
  83. data/lib/buildr/scala.rb +5 -0
  84. data/lib/buildr/scala/bdd.rb +100 -0
  85. data/lib/buildr/scala/compiler.rb +45 -4
  86. data/lib/buildr/scala/tests.rb +12 -59
  87. data/rakelib/checks.rake +57 -0
  88. data/rakelib/doc.rake +58 -68
  89. data/rakelib/jekylltask.rb +110 -0
  90. data/rakelib/package.rake +35 -37
  91. data/rakelib/release.rake +119 -35
  92. data/rakelib/rspec.rake +29 -39
  93. data/rakelib/setup.rake +21 -59
  94. data/rakelib/stage.rake +184 -26
  95. data/spec/addon/drb_spec.rb +328 -0
  96. data/spec/core/application_spec.rb +32 -25
  97. data/spec/core/build_spec.rb +336 -126
  98. data/spec/core/checks_spec.rb +292 -310
  99. data/spec/core/common_spec.rb +8 -2
  100. data/spec/core/compile_spec.rb +17 -1
  101. data/spec/core/generate_spec.rb +3 -3
  102. data/spec/core/project_spec.rb +18 -10
  103. data/spec/core/test_spec.rb +8 -1
  104. data/spec/core/transport_spec.rb +40 -3
  105. data/spec/core/util_spec.rb +67 -0
  106. data/spec/ide/eclipse_spec.rb +96 -28
  107. data/spec/ide/idea7x_spec.rb +84 -0
  108. data/spec/java/ant.rb +5 -0
  109. data/spec/java/bdd_spec.rb +12 -3
  110. data/spec/{addon → java}/cobertura_spec.rb +6 -6
  111. data/spec/{addon → java}/emma_spec.rb +5 -6
  112. data/spec/java/java_spec.rb +12 -2
  113. data/spec/java/packaging_spec.rb +31 -2
  114. data/spec/{addon → java}/test_coverage_spec.rb +3 -3
  115. data/spec/java/tests_spec.rb +5 -0
  116. data/spec/packaging/archive_spec.rb +11 -1
  117. data/spec/{core → packaging}/artifact_namespace_spec.rb +10 -2
  118. data/spec/packaging/artifact_spec.rb +44 -3
  119. data/spec/packaging/packaging_spec.rb +1 -1
  120. data/spec/sandbox.rb +17 -14
  121. data/spec/scala/bdd_spec.rb +150 -0
  122. data/spec/scala/compiler_spec.rb +27 -0
  123. data/spec/scala/scala.rb +38 -0
  124. data/spec/scala/tests_spec.rb +78 -33
  125. data/spec/spec_helpers.rb +29 -5
  126. data/spec/version_requirement_spec.rb +6 -0
  127. metadata +175 -171
  128. data/DISCLAIMER +0 -7
  129. data/doc/images/apache-incubator-logo.png +0 -0
  130. data/doc/pages/download.textile +0 -51
  131. data/doc/pages/index.textile +0 -42
  132. data/doc/pages/mailing_lists.textile +0 -17
  133. data/doc/pages/recipes.textile +0 -103
  134. data/doc/pages/troubleshooting.textile +0 -103
  135. data/doc/pages/whats_new.textile +0 -323
  136. data/doc/print.haml +0 -51
  137. data/doc/site.haml +0 -56
  138. data/doc/site.toc.yaml +0 -47
  139. data/etc/git-svn-authors +0 -16
  140. data/lib/buildr/core/application_cli.rb +0 -139
  141. data/rakelib/apache.rake +0 -191
  142. data/rakelib/changelog.rake +0 -57
  143. data/rakelib/rubyforge.rake +0 -53
  144. data/rakelib/scm.rake +0 -49
data/DISCLAIMER DELETED
@@ -1,7 +0,0 @@
1
- Apache Buildr is an effort undergoing incubation at The Apache Software
2
- Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of
3
- all newly accepted projects until a further review indicates that the
4
- infrastructure, communications, and decision making process have stabilized in
5
- a manner consistent with other successful ASF projects. While incubation status
6
- is not necessarily a reflection of the completeness or stability of the code,
7
- it does indicate that the project has yet to be fully endorsed by the ASF.
@@ -1,51 +0,0 @@
1
- h1. Download
2
-
3
-
4
- h2. Installing Buildr
5
-
6
- The easiest way to install Buildr is using the fabulous RubyGems package manager. Of course, you will need either Ruby or JRuby, and we recommend upgrading to the most recent version of RubyGems. If this sounds foreign to you, don't worry. We'll show you how to install Buildr on Linux, OS X, Windows and JRuby in the "Getting Started guide":getting_started.html, we even provide automated installation scripts.
7
-
8
- The *official Apache distribution* consists of the digitally signed binaries (gems) and source packages "available below":#binaries_and_source_code. To install these binaries, you must first download them to disk and then install them using the @gem install@ command (or @rake install@ for a source distribution).
9
-
10
- In addition, contributors to this project maintain a separate distribution over on "RubyForge":http://rubyforge.org/projects/buildr. Using this distribution, you're able to install Buildr directly from the remote gem repository and to automatically upgrade when a new release comes out. The RubyForge distribution is *not* an official Apache distribution.
11
-
12
- The source code is included in both source and binary distribution, the Gem distribution expands the source code into your local Gem repository. That's in addition to getting the source code directly from "SVN":http://svn.apache.org/repos/asf/incubator/buildr or "GitHub":http://github.com/vic/buildr/tree/master. Learn more about working with source code and "living on the edge":contributing.html#living_on_the_edge.
13
-
14
-
15
- h2. Binaries and Source Code
16
-
17
- h3. buildr 1.3.2-incubating (2008-07-18)
18
-
19
- |_. Package |_. MD5 Checksum |_. PGP |
20
- | "buildr-1.3.2-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem | "225504bc195334c4eb9d6dec814d9db1":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.asc |
21
- | "buildr-1.3.2-java-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem | "d7d8394c7aed887987be0e813e1e4cee":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.asc |
22
- | "buildr-1.3.2-incubating.tgz":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz | "611e97df1bc76382ecbe6b60e9340f2b":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.asc |
23
- | "buildr-1.3.2-incubating.zip":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip | "d65d20005f603338c0aedd4f17d0bc90":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.asc |
24
-
25
- p>. ("Release signing keys":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/KEYS)
26
-
27
-
28
-
29
- h3. buildr 1.3.1-incubating (2008-05-19)
30
-
31
- |_. Package |_. MD5 Checksum |_. PGP |
32
- | "buildr-1.3.1-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem | "476436429b9a6c4ed178009ba17dd724":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem.asc |
33
- | "buildr-1.3.1-java-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem | "7af37acc10621b18d4b870119c36d998":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem.asc |
34
- | "buildr-1.3.1-incubating.tgz":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz | "ad6694416fc2e6eb22ab1042dcc41411":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz.asc |
35
- | "buildr-1.3.1-incubating.zip":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip | "0470349978b93e645ca2e9607e304ed1":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip.asc |
36
-
37
- p>. ("Release signing keys":http://www.apache.org/dist/incubator/buildr/1.3.1-incubating/KEYS)
38
-
39
-
40
- h3. buildr 1.3.0-incubating (2008-05-01)
41
-
42
- |_. Package |_. MD5 Checksum |_. PGP |
43
- | "buildr-1.3.0-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem | "37758d0a8dabc570799b0a58d23d19f0":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem.asc |
44
- | "buildr-1.3.0-java-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem | "6a3a86740077f739c111514e0e2b9e06":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem.asc |
45
- | "buildr-1.3.0-incubating.tgz":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz | "acd84ad8c5031962e65b0036f3bc2e76":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz.asc |
46
- | "buildr-1.3.0-incubating.zip":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip | "d85945f05efd0e512e6d769e3dd1cc98":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip.asc |
47
-
48
- p>. ("Release signing keys":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/KEYS)
49
-
50
-
51
- p(note). When downloading from files please check the "md5sum":http://www.apache.org/dev/release-signing#md5 and verify the "OpenPGP":http://www.apache.org/dev/release-signing#openpgp compatible signature from the main Apache site. This "KEYS":http://www.apache.org/dist/incubator/buildr/KEYS file contains the public keys used for signing releases. It is recommended that (when possible) a web of trust is used to confirm the identity of these keys. For more information, please see the "Apache Release FAQ":http://www.apache.org/dev/release.html.
@@ -1,42 +0,0 @@
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.
@@ -1,17 +0,0 @@
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/ |
@@ -1,103 +0,0 @@
1
- h1. Recipes
2
-
3
- Commond recipes for Buildr, collected from the mailing list.
4
-
5
-
6
- h2. Creating a classpath
7
-
8
- For Java, the classpath argument is simply a list of paths joined with an OS-specific path separator:
9
-
10
- {{{!ruby
11
- cp = paths.join(File::PATH_SEPARATOR)
12
- }}}
13
-
14
- This assumes @paths@ points to files and/or directories, but what if you have a list of artifact specifications? You can turn those into file names in two steps. First, use @artifacts@ to return a list of file tasks that point to the local repository:
15
-
16
- {{{!ruby
17
- tasks = Buildr.artifacts(specs)
18
- }}}
19
-
20
- Next, map that list of tasks into list of file names (essentially calling @name@ on each task):
21
-
22
- {{{!ruby
23
- paths = tasks.map(&:name)
24
- }}}
25
-
26
- This works as long as the artifacts are already in your local repository, otherwise they can't be found, but you can ask Buildr to download them by calling @invoke@ on each of these tasks:
27
-
28
- {{{!ruby
29
- tasks = Buildr.artifacts(specs).each(&:invoke)
30
- }}}
31
-
32
- So let's roll this all into a single line:
33
-
34
- {{{!ruby
35
- cp = Buildr.artifacts(specs).each(&:invoke).map(&:name).join(File::PATH_SEPARATOR)
36
- }}}
37
-
38
-
39
- h2. Keeping your Profiles.yaml file DRY
40
-
41
- YAML allows you to use anchors (@&@), similar to ID attributes in XML, and reference them later on (@*@). For example, if you have two profiles that are identical, you can tell YAML that one is an alias for the other:
42
-
43
- {{{!yaml
44
- development: &common
45
- db: oracle
46
- port: 8080
47
- test: *common
48
- production: *common
49
- }}}
50
-
51
- If you have two elements that are almost identical, you can merge the values of one element into another (@<<@), for example:
52
-
53
- {{{!yaml
54
- development: &common
55
- db: hsql
56
- jdbc: hsqldb:mem:devdb
57
- test:
58
- <<: *common
59
- jdbc: hsqldb:file:testdb
60
- }}}
61
-
62
-
63
- h2. Speeding JRuby
64
-
65
- When using JRuby you will notice that Buildr takes a few seconds to start up. To speed it up, we recommend switching to Java 1.6 and running the JVM in client mode:
66
-
67
- {{{!
68
- $ export JAVA_OPTS=-client
69
- }}}
70
-
71
-
72
- h2. Continuous Integration with Atlassian Bamboo
73
-
74
- This recipe outlines how to configure a new Bamboo project to use Buildr. The following steps assume that you have logged-on to Bamboo as an Administrator.
75
-
76
- *1. Configure a Builder*
77
-
78
- * Select the Administration tab from the Bamboo toolbar.
79
- * Select the Builders area (first option) from the Administration menu.
80
- * Using the Add Builder dialog, configure a custom builder for Buildr with the following options:
81
- ** Label: @buildr@
82
- ** Type: @Custom Command@
83
- ** Path: @/path/to/buildr@ (typically "/usr/bin/buildr")
84
-
85
- *2. Create a Plan*
86
-
87
- * Select the Create Plan tab from the Bamboo toolbar to enter the Create Plan wizard.
88
- * In "1. Plan Details", define your build plan including project name, project key, build plan name and build plan key.
89
- * In "2. Source Repository", specify your source code repository settings (CVS or SVN).
90
- * In "3. Builder Configuration", specify the "buildr" builder that you defined above, along with the following:
91
- ** Argument: @"test=all"@ (ensures that all tests are run through even if failures are encountered)
92
- ** Test Results Directory: @"**/reports/junit/*.xml"@ (or your path to test results, if different).
93
- * The remaining wizard sections may be either skipped or configured with your preferred settings.
94
-
95
- *3. Trigger a Build*
96
-
97
- A build should occur automatically at the point of project creation. It can also be manually triggered at any time
98
-
99
- * Navigate to the project summary page (located at: @http://YOUR_BAMBOO_URL/browse/PROJECTKEY-YOURPLAN@).
100
- * Click on the small arrow to the left of the label "Build Actions"
101
- * Select "Checkout and Build" from the pop-up menu to force a build.
102
-
103
- The project page will contain full status information for previous builds and the results tabs will integrate the results from your JUnit tests.
@@ -1,103 +0,0 @@
1
- h1. Troubleshooting
2
-
3
- Common troubleshooting tips collected from the mailing list.
4
-
5
-
6
- h2. Running out of heap space
7
-
8
- You can give the JVM more heap space by setting the @JAVA_OPTS@ environment variables. This environment variable provides arguments for staring the JVM. For example, to set the heap space to 1GB:
9
-
10
- {{{!sh
11
- $ export "JAVA_OPTS=-Xms1g -Xmx1g"
12
- $ buildr compile
13
- }}}
14
-
15
- If you're sharing the build with other developers, you'll want to specify these options in the Buildfile itself. You can set the environment variable within the Buildfile, but make sure to do so at the very top of the Buildfile.
16
-
17
- For example:
18
-
19
- {{{!ruby
20
- ENV['JAVA_OPTS'] = '-Xms1g -Xmx1g'
21
- }}}
22
-
23
-
24
- h2. RJB fails to compile
25
-
26
- On Linux, BSD and Cygwin, RJB locates the JDK headers files -- which it uses to compile a native C extension -- based on the @JAVA_HOME@ environment variable. Make sure @JAVA_HOME@ points to the JDK, not JRE.
27
-
28
- If you are using @sudo gem install@, note that some environments do not pass the @JAVA_HOME@ environment variable over to @sudo@. To get around this, run @gem@ with the @env JAVA_HOME=$JAVA_HOME@ option:
29
-
30
- {{{!sh
31
- $ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
32
- }}}
33
-
34
-
35
- h2. Segmentation Fault when running Java code
36
-
37
- This is most likely a JVM inconsistency, for example, when part of the RJB library uses JDK 1.6, the other part uses JDK 1.5.
38
-
39
- During installation RJB builds a native C extension using header files supplied by the JVM, and compiles a Java bridge class using the Javac. It is possible for RJB to use two different versions of the JVM, for example, if @JAVA_HOME@ points to JDK 1.5, but @/usr/bin/javac@ points to JDK 1.6.
40
-
41
- Make sure @JAVA_HOME@ and @/usr/bin/javac@ both point to the same JDK:
42
-
43
- {{{!sh
44
- echo $JAVA_HOME
45
- ls -l /usr/bin/javac
46
- }}}
47
-
48
- *Note:* It seems that RJB works with Java 6, except when it doesn't, and for a few people it doesn't. In that case, either switch to Java 1.5, or simply run Buildr on JRuby using Java 6.
49
-
50
-
51
- h2. Bugs resulting from a dangling comma or period
52
-
53
- Ruby statements don't need a delimiter and can span multiple lines, which can lead to bugs resulting from dangling commas and periods left at the end of the line. For example:
54
-
55
- {{{!ruby
56
- compile.with 'org.apache.axis2:axis2:jar:1.2',
57
- test.with 'log4j:log4j:jar:1.1'
58
- }}}
59
-
60
- This is actually a single method call with two arguments, separated by a comma. The second argument is the result of calling @test.with@, and makes the test task a pre-requisite of the compile task, leading to a circular dependency.
61
-
62
- As you can imagine this happens usually after editing, specifically for commas and periods which are small enough that you won't notice them from a cursory glance at the code, so if all else fails, search for lines that end with one of these characters.
63
-
64
-
65
- h2. Missing POM breaks transitive dependencies
66
-
67
- Occasionally, artifacts are deployed to remote repositories with missing or broken POMs. Buildr will fail when attempting to resolve transitive dependencies with broken or missing POMs.
68
-
69
- In this particular case, failing is doing the right thing. There's no way for Buildr to tell whether the POM is nowhere to be found, or just a temporary problem accessing the remote server.
70
-
71
- If you can determine that the POM file is missing you can work around the problem in three ways. If you published the artifact, make the release again, getting it to upload the missing files.
72
-
73
- If the source repository is not under your control, but you are also using your own repository for the project, you can always create a dummy POM in your own repository. Buildr will attempt to download the file from either repository, using the first file it finds.
74
-
75
- Alternatively, you can make Buildr create a dummy POM file in the local repository, instead of downloading it from a remote repository. This example creates a dummy POM for Axis JAX-RPC:
76
-
77
- {{{!ruby
78
- artifact 'axis:axis-jaxrpc:pom:1.3' do |task|
79
- write task.name, <<-POM
80
- <project>
81
- <modelVersion>4.0.0</modelVersion>
82
- <groupId>axis</groupId>
83
- <artifactId>axis-jaxrpc</artifactId>
84
- <version>1.4</version>
85
- </project>
86
- POM
87
- end
88
- }}}
89
-
90
-
91
- h2. Buildr fails to run after install with a "stack level too deep (SystemStackError)" error
92
-
93
- A particular quirk of an existing Ruby setup can cause problems when running Buildr. If a system already has several Ruby directories that are in the @PATH@, it is often nice (appropriate?) to have them in @RUBYLIB@ as well (to be able to require them). If there are several of them a user may decide that @RUBYLIB=$PATH@ is a good way to handle this (or some less automated method that has the same effect).
94
-
95
- The culprit is having the Gem's binary directory show up in @RUBYLIB@. For example, Buildr's @bin/buildr@ includes this line:
96
-
97
- {{{!sh
98
- require 'buildr'
99
- }}}
100
-
101
- Under normal circumstances, this tells RubyGems to load @buildr.rb@ from the Gem's library directory. When @RUBYLIB@ points to the Gem's @bin@ directory, it ends up loading itself repeatedly.
102
-
103
- To solve this, remove Buildr's @bin@ directory from @RUBYLIB@. Removing all directories that you don't actually need is better (other Gems may have the same problem).
@@ -1,323 +0,0 @@
1
- h1. What's New
2
-
3
- h2. Buildr 1.3.3
4
-
5
- * Support for "JtestR":http://jtestr.codehaus.org/ test framework.
6
- * Support for "Emma":http://emma.sourceforge.net/ code coverage tool.
7
- * Growl notifications (OS X only).
8
- * Starting with this release you can use the @build.yml@ file to control versions of various 3rd party libraries, e.g. Ant, JUnit, ScalaCheck.
9
- * The _release_ task now supports alternative SVN repository layouts. Releases are tagged in SVN using the version number, but you can customize the tag name (see @Releases.tag_name@). The @NEXT_VERSION@ constant is no longer used during the release process.
10
- * This release is tested against JRuby 1.1.3 and JRuby 1.1.4. There are also some improvements towards Ruby 1.9 support.
11
- * 27 other bug fixes and minor changes, see the "CHANGELOG":changelog.html for full details.
12
-
13
-
14
- h2. Buildr 1.3.2
15
-
16
- * New @--prereqs@ command line argument lists all the tasks and their dependencies. You can also filter specific tasks by following with a regular expression, for example, @--prereqs foo@.
17
- * Upgraded to latest release of Net::SSH, Net::SFTP, RubyForge and RubyGems.
18
- * Upgraded to JUnit 4.4 and fixed case where abstract classes extending TestCase would lead to tests failing.
19
- * The target/test/class and /resources directories now come first in the classpath, ahead of any code compiled code and resources copied over from src/main.
20
- * Fixed: BUILDR-90 Installing from source doesn't work with JRuby.
21
- * Fixed: BUILDR-91 When doing a release, buildr should spawn the same version of buildr
22
- * Fixed: BUILDR-92 IDEA 7x: add resources directories to classpath.
23
- * Fixed: BUILDR-95: Only download Scala test framework artifacts when required
24
- * Fixed: BUILDR-100 Directory structure documentation needs updating.
25
- * Fixed: Installation instructions updated for RubyGems 1.2.0.
26
-
27
-
28
- h2. Buildr 1.3.1
29
-
30
- * Fixed to specific Gem dependencies, so should install cleanly on Windows.
31
- * Buildr now supports publishing files to HTTP server for remote repositories that support HTTP uploads (PUT).
32
- * Buildr now supports reading files from SFTP server and upgrades to Net::SSH 2.0 and Net::SFTP 2.0.
33
- * HTTP downloads now accept URLs with query parameters (Tommy Knowlton).
34
- * On OS X if you are not using the default JDK, you can set the JAVA_HOME environment variable to point to any other JDK (Nathan Hamblen).
35
- * JUnit properly passes options[:environment] as environment variables to the test case. In addition options[:java_args] are now passed as arguments to the JVM, for example to set heap size, only applicable when forking (the default mode when running JUnit).
36
- * Fixed BUILDR-75: Filter now runs if there's a target directory, even if there are no source files to copy over, and creates an empty target directory. The previous behavior caused some problems with code that checked if resource.target was nil, but didn't check if there are any resource.sources to process.
37
- * Added the jibx_bind method to use JiBX for Java<=>XML binding (by David Peterson).
38
-
39
-
40
- h2. Buildr 1.3
41
-
42
- h3. Multiple Languages
43
-
44
- The main focus of this release is supporting multiple languages for compiling and testing.
45
-
46
- For each project, Buildr will attempt to infer which compiler to use based on the source files it finds, for example, if it finds @.java@ files in the @src/main/java@ directory, it will switch to the javac compiler, if it finds @.scala@ files in the @src/main/scala@ directory, to the scalac compiler and so forth.
47
-
48
- Different compilers may use different target directory, @target/classes@ is picked for JVM compilers (Java, Scala, Groovy, etc), so resources are not copied to their own directory, @target/resources@. The prepare task has been removed.
49
-
50
- Not all languages have classpaths, so @compile.classpath@ is now known as @compile.dependencies@, but the old attribute still exists for backward compatibility.
51
-
52
- Also, for consistency, the test target directories have changed to @target/test/classes@ and @target/test/resources@, respectively.
53
-
54
- Speaking of tests, you can compile code in one language and use a different language to test it, say, if you're interested in compiling Java code and testing it with Ruby, or compiling Flash and running a Java test suite.
55
-
56
- As before, you can pick the test framework by calling @test.using(<framework>)@. Buildr will attempt to pick one by default, for example, if the tests are written in Java, it will default to JUnit.
57
-
58
- And, since not all languages package to JARs, the default packaging is either inferred from the compiler (so @:jar@ when compiling Java code), otherwise to @:zip@. All this defaulting means that @package()@ with no arguments does the right thing in more cases, and most probably won't break anyone's buildfiles.
59
-
60
- I've tried to keep the compiler API as simple as possible, making it easy to add new compilers; however, I had to change the test framework API to accommodate the new features, so old test frameworks will not work on 1.3.
61
-
62
-
63
- h3. Scala Support
64
-
65
- Buildr now supports "Scala":http://www.scala-lang.org/, using both native and fast Scala compiler.
66
-
67
- Read more about "using Scala":languages.html#scala.
68
-
69
-
70
- h3. Groovy Support
71
-
72
- Buildr now supports Groovy, using the Groovyc Ant task.
73
-
74
- Read more about "using Groovy":languages.html#groovy.
75
-
76
-
77
- h3. Packaging Files
78
-
79
- The @package@ method is convenient enough that you can now use it to generate artifacts, an in addition to generate regular file tasks, specifying the file name using the @:file@ attribute. For example:
80
-
81
- {{{!ruby
82
- package :zip, :file=>_('target/interesting.zip')
83
- }}}
84
-
85
- Since this package is not an artifact and does not have a specification, it will not automatically install itself in the local repository or upload to a remote repository. For these, use the @package@ method as before.
86
-
87
- Read more about "the package method":packaging.html#specifying_and_referencing_packages.
88
-
89
-
90
- h3. Packaging EARs
91
-
92
- EAR packages support four component types:
93
-
94
- |_. Argument |_. Component |
95
- | @:war@ | J2EE Web Application (WAR). |
96
- | @:ejb@ | Enterprise Java Bean (JAR). |
97
- | @:jar@ | J2EE Application Client (JAR). |
98
- | @:lib@ | Shared library (JAR). |
99
-
100
- This example shows two ways for adding components built by other projects:
101
-
102
- {{{!ruby
103
- package(:ear) << project('coolWebService').package(:war)
104
- package(:ear).add project('commonLib') # By default, the JAR package
105
- }}}
106
-
107
- EAR packages include an @application.xml@ file in the @META-INF@ directory that describes the application and its component. This file is created for you during packaging, by referencing all the components added to the EAR. There are a couple of things you will typically want to change.
108
-
109
- * *display-name* -- The application's display name defaults to the project's identifier. You can change that by setting the @display_name@ attribute.
110
-
111
- * *context-root* -- WAR components specify a context root, based on the package identifier, for example, "cool-web-1.0.war" will have the context root "cool-web". To specify a different context root, add the WAR package with the @context_root@ option.
112
-
113
- "Read more ...":packaging.html#packaging_ears
114
-
115
-
116
- h3. JRuby Support
117
-
118
- We now offer two versions of Buildr, one for Ruby and one for JRuby. They're exactly the same, except the Ruby version will also install RJB (Ruby Java Bridge), the JRuby version obviously can do well without it.
119
-
120
- "Read more ...":download.html#jruby
121
-
122
- Buildr provides a "Nailgun":http://www.martiansoftware.com/nailgun/index.html server when running on JRuby. Using the integrated BuildrServer allows for faster task execution and avoid frequent JVM startup overhead.
123
-
124
- "Read more ...":more_stuff.html#nailgun
125
-
126
-
127
- h3. Behaviour-Driven Development
128
-
129
- Given that many languages are now supported by Buildr, the same is true for testing, the convention is to store BDD files under the @src/spec/{lang}@ directory. The following table shows the framework's name you can use to select them for your projects. Buildr follows each framework's naming convention.
130
-
131
- |_. test.using |_. Test file name convention |
132
- | @:jbehave@ | @src/spec/java/**/*Behaviour.java@ |
133
- | @:rspec@ | @src/spec/ruby/**/*_spec.rb@ |
134
- | @:easyb@ | @src/spec/groovy/**/*{Story,Behavior}.groovy@ |
135
-
136
- "Read more ...":testing.html#bdd
137
-
138
-
139
- h3. Profiles
140
-
141
- Different environments may require different configurations, some you will want to control with code, others you will want to specify in the profiles file.
142
-
143
- The profiles file is a YAML file called @profiles.yaml@ that you place in the same directory as the Buildfile. We selected YAML because it's easier to read and edit than XML.
144
-
145
- For example, to support three different database configurations, we could write:
146
-
147
- {{{!yaml
148
- # HSQL, don't bother storing to disk.
149
- development:
150
- db: hsql
151
- jdbc: hsqldb:mem:devdb
152
-
153
- # Make sure we're not messing with bigstrong.
154
- test:
155
- db: oracle
156
- jdbc: oracle:thin:@localhost:1521:test
157
-
158
- # The real deal.
159
- production:
160
- db: oracle
161
- jdbc: oracle:thin:@bigstrong:1521:mighty
162
- }}}
163
-
164
- You can also use profiles to specify default filters for the "@resources@ task":building.html#resources.
165
-
166
- "Read more ...":settings_profiles.html#profiles
167
-
168
-
169
- h3. Settings and build YAML files
170
-
171
- In addition to profiles, we also allow you to specify personal and build settings using two YAML files.
172
-
173
- Personal settings are placed in the @.buildr/settings.yaml@ file under your home directory. Settings stored there will be applied the same across all builds.
174
-
175
- For example:
176
-
177
- {{{!yaml
178
- # The repositories hash is read automatically by buildr.
179
- repositories:
180
-
181
- # customize user local maven2 repository location
182
- local: some/path/to/my_repo
183
-
184
- relase_to:
185
- url: http://intra.net/maven2
186
- username: john
187
- password: secret
188
-
189
- # You can place settings of your own, and reference them
190
- # on buildfiles.
191
- im:
192
- server: jabber.company.com
193
- usr: notifier@company-jabber.com
194
- pwd: secret
195
- }}}
196
-
197
- "Read more ...":settings_profiles.html#personal_settings
198
-
199
- Build settings are placed in the @build.yaml@ file located in the same directory that the @buildfile@. Normally this file would be managed by the project revision control system, so settings here are shared between developers.
200
-
201
- For example:
202
-
203
- {{{!yaml
204
- # This project requires the following ruby gems, buildr addons
205
- gems:
206
- # Suppose we want to notify developers when testcases fail.
207
- - buildr-twitter-notifier-addon >=1
208
- # we test with ruby mock objects
209
- - mocha
210
- - ci_reporter
211
-
212
- # The artifact declarations will be automatically loaded by buildr, so that
213
- # you can reference artifacts by name (a ruby-symbol) on your buildfile.
214
- artifacts:
215
- spring: org.springframework:spring:jar:2.0
216
- log4j: log4j:log4j:jar:1.0
217
- j2ee: geronimo-spec:geronimo-spec:j2ee:jar:1.4-rc4
218
-
219
- # Of course project settings can be defined here
220
- jira:
221
- uri: https://jira.corp.org
222
- }}}
223
-
224
- "Read more ...":settings_profiles.html#build_settings
225
-
226
-
227
- h3. Using Gems for extensions and 3rd party libraries
228
-
229
- "RubyGems":http://rubygems.rubyforge.org provides the @gem@ command line tool that you can use to search, install, upgrade, package and distribute gems. It installs all gems into a local repository that is shared across your builds and all other Ruby applications you may have running. You can install a gem from a local file, or download and install it from any number of remote repositories.
230
-
231
- If your build depends on other gems, you will want to specify these dependencies as part of your build and check that configuration into source control. That way you can have a specific environment that will guarantee repeatable builds, whether you're building a particular version, moving between branches, or joining an existing project. Buildr will take care of installing all the necessary dependencies, which you can then manage with the @gem@ command.
232
-
233
- Use the @build.yaml@ file to specify these dependencies (see "Build Settings":settings_profiles.html#build_settings for more information), for example:
234
-
235
- {{{!yaml
236
- # This project requires the following gems
237
- gems:
238
- # Suppose we want to notify developers when testcases fail.
239
- - buildr-twitter-notifier-addon >=1
240
- # we test with ruby mock objects
241
- - mocha
242
- - ci_reporter
243
- }}}
244
-
245
- "Read more ...":more_stuff.html#using_gems
246
-
247
-
248
- h3. New API for accessing Java libraries
249
-
250
- Java classes are accessed as static methods on the @Java@ module, for example:
251
-
252
- {{{!ruby
253
- str = Java.java.lang.String.new('hai!')
254
- str.toUpperCase
255
- => 'HAI!'
256
- Java.java.lang.String.isInstance(str)
257
- => true
258
- Java.com.sun.tools.javac.Main.compile(args)
259
- }}}
260
-
261
- The @classpath@ attribute allows Buildr to add JARs and directories to the classpath, for example, we use it to load Ant and various Ant tasks, code generators, test frameworks, and so forth.
262
-
263
- For example, Ant is loaded as follows:
264
-
265
- {{{!ruby
266
- Java.classpath << 'org.apache.ant:ant:jar:1.7.0'
267
- }}}
268
-
269
- Artifacts can only be downloaded after the Buildfile has loaded, giving it a chance to specify which remote repositories to use, so adding to classpath does not by itself load any libraries. You must call @Java.load@ before accessing any Java classes to give Buildr a chance to load the libraries specified in the classpath.
270
-
271
- "Read more ...":more_stuff.html#using_java_libraries
272
-
273
-
274
- h3. Creating Extensions
275
-
276
- A module defines instance methods that are then mixed into the project and become instance methods of the project. There are two general ways for extending projects. You can extend all projects by including the module in Project:
277
-
278
- {{{!ruby
279
- class Project
280
- include MyExtension
281
- end
282
- }}}
283
-
284
- You can also extend a given project instance and only that instance by extending it with the module:
285
-
286
- {{{!ruby
287
- define 'foo' do
288
- extend MyExtension
289
- end
290
- }}}
291
-
292
- Some extensions require tighter integration with the project, specifically for setting up tasks and properties, or for configuring tasks based on the project definition. You can do that by adding callbacks to the process.
293
-
294
- "Read more ...":extending.html#creating_extensions
295
-
296
-
297
- h3. Using Alternative Layouts
298
-
299
- Buildr follows a common convention for project layouts: Java source files appear in @src/main/java@ and compile to @target/classes@, resources are copied over from @src/main/resources@ and so forth. Not all projects follow this convention, so it's now possible to specify an alternative project layout.
300
-
301
- A layout is an object that implements the @expand@ method. The easiest way to define a custom layout is to create a new @Layout@ object and specify mapping between names used by Buildr and actual paths within the project.
302
-
303
- "Read more ...":extending.html#using_alternative_layouts
304
-
305
-
306
- h3. Other
307
-
308
- * Buildr 1.3 upgrades to Rake 0.8, RSpec 1.1, RJB 1.1 and OpenJPA 1.0.1. Buildr no longer includes or uses Facets.
309
- * JUnit tests now operate on all compiled test classes that extend @junit.framework.TestCase@ or use the @Test@ annotation; TestNG test cases are filtered by annotation. Test cases no longer have to use a specific file name.
310
- * Remote repositories now support HTTP Basic Authentication.
311
- * The prepare task has been removed, if you need to, simply add a prerequisite to the compile task.
312
-
313
-
314
- h3. Documentation
315
-
316
- * The "What's new?":whats_new.html page (this one, actually), summarizes all the important new features and changes in each release.
317
- * The "Recipes":recipes.html page (also available in the PDF) lists recipes for using Buildr, collected from the mailing list. Feel free to contribute tips, tricks and techniques.
318
- * The "Troubleshooting":troubleshooting.html page (also available in the PDF) collects troubleshooting ideas from the mailing list.
319
- * The "Getting Started":getting_started.html has been rewritten to cover all you need to know about downloading and installing Buildr on Linux, OS X, Windows and with JRuby (1.1 or later).
320
- * A new "Contributing":contributing.html page has more details on how to file bugs, policy for submitting patches, running Buildr test cases, and helping with the documentation.
321
- * A new page for "Settings and Profiles":settings_profiles.html.
322
- * The "Extending Buildr":extending.html page that deals with writing your own tasks, creating extensions and specifying alternative layouts.
323
- * The site also includes "RSpec report":specs.html which provides the official specification against which we test each release.