buildr 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/CHANGELOG +35 -0
  2. data/README.rdoc +1 -1
  3. data/Rakefile +1 -1
  4. data/buildr.buildfile +6 -1
  5. data/buildr.gemspec +10 -9
  6. data/doc/_config.yml +1 -0
  7. data/doc/_layouts/default.html +25 -19
  8. data/doc/artifacts.textile +0 -36
  9. data/doc/building.textile +0 -38
  10. data/doc/contributing.textile +51 -15
  11. data/doc/css/default.css +11 -4
  12. data/doc/css/print.css +32 -24
  13. data/doc/download.textile +2 -1
  14. data/doc/extending.textile +10 -20
  15. data/doc/images/1442160941-frontcover.jpg +0 -0
  16. data/doc/images/asf-logo.png +0 -0
  17. data/doc/images/note.png +0 -0
  18. data/doc/images/project-structure.png +0 -0
  19. data/doc/images/tip.png +0 -0
  20. data/doc/images/zbuildr.png +0 -0
  21. data/doc/index.textile +39 -17
  22. data/doc/{getting_started.textile → installing.textile} +2 -67
  23. data/doc/languages.textile +50 -52
  24. data/doc/more_stuff.textile +154 -62
  25. data/doc/packaging.textile +0 -82
  26. data/doc/preface.textile +41 -15
  27. data/doc/projects.textile +0 -18
  28. data/doc/quick_start.textile +210 -0
  29. data/doc/scripts/install-linux.sh +10 -2
  30. data/doc/settings_profiles.textile +1 -33
  31. data/doc/testing.textile +6 -32
  32. data/lib/buildr.rb +2 -1
  33. data/lib/buildr/core.rb +6 -0
  34. data/lib/buildr/core/application.rb +2 -5
  35. data/lib/buildr/core/build.rb +29 -19
  36. data/lib/buildr/core/compile.rb +22 -4
  37. data/lib/buildr/core/filter.rb +2 -4
  38. data/lib/buildr/core/project.rb +5 -4
  39. data/lib/buildr/core/shell.rb +198 -0
  40. data/lib/buildr/core/test.rb +2 -0
  41. data/lib/buildr/core/transports.rb +18 -19
  42. data/lib/buildr/core/util.rb +178 -9
  43. data/lib/buildr/groovy.rb +1 -0
  44. data/lib/buildr/groovy/bdd.rb +5 -5
  45. data/lib/buildr/groovy/shell.rb +48 -0
  46. data/lib/buildr/ide/eclipse.rb +148 -36
  47. data/lib/buildr/ide/eclipse/java.rb +53 -0
  48. data/lib/buildr/ide/eclipse/plugin.rb +68 -0
  49. data/lib/buildr/ide/eclipse/scala.rb +66 -0
  50. data/lib/buildr/java/bdd.rb +16 -8
  51. data/lib/buildr/java/cobertura.rb +44 -13
  52. data/lib/buildr/java/commands.rb +5 -3
  53. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  54. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +18 -0
  55. data/lib/buildr/java/packaging.rb +2 -2
  56. data/lib/buildr/java/rjb.rb +1 -1
  57. data/lib/buildr/java/test_result.rb +48 -1
  58. data/lib/buildr/java/tests.rb +8 -5
  59. data/lib/buildr/packaging/artifact_namespace.rb +1 -1
  60. data/lib/buildr/packaging/package.rb +6 -2
  61. data/lib/buildr/packaging/zip.rb +10 -1
  62. data/lib/buildr/packaging/ziptask.rb +5 -2
  63. data/lib/buildr/scala.rb +1 -0
  64. data/lib/buildr/scala/bdd.rb +17 -8
  65. data/lib/buildr/scala/compiler.rb +66 -21
  66. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
  67. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  68. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +35 -0
  69. data/lib/buildr/scala/shell.rb +55 -0
  70. data/lib/buildr/scala/tests.rb +6 -5
  71. data/lib/buildr/shell.rb +180 -0
  72. data/rakelib/doc.rake +2 -3
  73. data/rakelib/jekylltask.rb +42 -32
  74. data/rakelib/package.rake +4 -2
  75. data/rakelib/rspec.rake +3 -3
  76. data/rakelib/setup.rake +7 -1
  77. data/rakelib/stage.rake +9 -2
  78. data/rakelib/stage.rake~ +213 -0
  79. data/spec/core/application_spec.rb +84 -1
  80. data/spec/core/build_spec.rb +54 -2
  81. data/spec/core/common_spec.rb +1 -1
  82. data/spec/core/compile_spec.rb +2 -1
  83. data/spec/core/extension_spec.rb +93 -0
  84. data/spec/core/test_spec.rb +2 -2
  85. data/spec/core/transport_spec.rb +1 -1
  86. data/spec/groovy/bdd_spec.rb +6 -6
  87. data/spec/groovy/compiler_spec.rb +1 -0
  88. data/spec/ide/eclipse_spec.rb +262 -72
  89. data/spec/java/{ant.rb → ant_spec.rb} +0 -0
  90. data/spec/java/bdd_spec.rb +15 -0
  91. data/spec/java/cobertura_spec.rb +9 -1
  92. data/spec/java/emma_spec.rb +1 -1
  93. data/spec/java/java_spec.rb +26 -0
  94. data/spec/java/packaging_spec.rb +9 -7
  95. data/spec/java/{test_coverage_spec.rb → test_coverage_helper.rb} +6 -4
  96. data/spec/java/tests_spec.rb +22 -0
  97. data/spec/packaging/archive_spec.rb +14 -0
  98. data/spec/packaging/artifact_spec.rb +2 -2
  99. data/spec/packaging/packaging_spec.rb +97 -2
  100. data/spec/sandbox.rb +3 -1
  101. data/spec/scala/bdd_spec.rb +17 -48
  102. data/spec/scala/compiler_spec.rb +31 -2
  103. data/spec/scala/tests_spec.rb +1 -0
  104. data/spec/spec_helpers.rb +12 -0
  105. metadata +145 -148
@@ -27,18 +27,16 @@ If it needs more attention, start a discussion over on the mailing list. We wil
27
27
 
28
28
  When reporting a bug, please tell us which version of Ruby, Buildr and Java you are using, and also which operating system you are on:
29
29
 
30
- <notextile>
31
30
  {% highlight sh %}
32
31
  $ ruby --version
33
32
  $ buildr --version
34
33
  $ java --version
35
34
  {% endhighlight %}
36
- </notextile>
37
35
 
38
36
 
39
37
  h2(#wiki). Community Wiki
40
38
 
41
- Our community Wiki is available at "http://cwiki.apache.org/confluence/display/BUILDR/Index":http://cwiki.apache.org/confluence/display/BUILDR/Index.
39
+ "Our community Wiki":http://cwiki.apache.org/confluence/display/BUILDR/Index.
42
40
 
43
41
 
44
42
  h2(#code). Contributing Code
@@ -81,19 +79,25 @@ You can also browse the "Buildr repository":http://svn.apache.org/repos/asf/buil
81
79
 
82
80
  h3(#git). Git
83
81
 
84
- Not a fan SVN? We understand. You can also grab a copy of "Buildr from GitHub":http://github.com/buildr/buildr/tree/master:
82
+ Not a fan of SVN? We understand. You can also use the "official Apache Git clone.":http://git.apache.org This clone is maintained by the ASF and kept in sync with the SVN repository (though, in practice there may be some delay in cloning recent commits). Apache's Git hosting supports both git:// and http:// protocols (you should use git:// if at all possible as it is faster than http://):
85
83
 
86
- <notextile>
87
84
  {% highlight sh %}
88
- $ git clone git://github.com/buildr/buildr.git
85
+ $ git clone git://git.apache.org/buildr.git
86
+ # or...
87
+ $ git clone http://git.apache.org/buildr.git
89
88
  {% endhighlight %}
90
- </notextile>
91
89
 
92
90
  If you want to learn more about Git, you can start by watching Scott Chacon’s "Git presentation":http://en.oreilly.com/rails2008/public/asset/attachment/2816 (PDF), or any of the "Git screencasts":http://www.gitcasts.com/. For more, there's also the "Git Internals book":http://peepcode.com/products/git-internals-pdf.
93
91
 
94
92
  And keep this "Git cheat sheet":http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png close at hand. Very useful.
95
93
 
96
- *Note:* The GitHub repository is maintained by contributors to this project, but is *not* an official Apache repository. To obtain Buildr from the official Apache repository, consider using @git-svn@ instead.
94
+ h4. GitHub
95
+
96
+ You are also welcome to fork or clone the "Buildr repository on GitHub":http://github.com/apache/buildr. This repository is just an exact mirror of the official Apache Git clone referenced above (updated every 30 minutes). Some of the core committers also maintain their own forks of Buildr on GitHub, often containing experimental and in-progress development slated for eventual inclusion into the SVN. For reference, they are listed below:
97
+
98
+ * "Assaf Arkin":http://github.com/assaf/buildr
99
+ * "Victor Hugo Borja":http://github.com/vic/buildr
100
+ * "Daniel Spiewak":http://github.com/djspiewak/buildr
97
101
 
98
102
  h3. Working with Source Code
99
103
 
@@ -130,12 +134,10 @@ Since Ruby Gems uses version numbers to detect new releases, if you installed Bu
130
134
 
131
135
  If you want to go back to using the RubyForge releases:
132
136
 
133
- <notextile>
134
137
  {% highlight sh %}
135
138
  gem source --remove http://people.apache.org/~assaf/buildr/snapshot/
136
139
  gem install buildr
137
140
  {% endhighlight %}
138
- </notextile>
139
141
 
140
142
 
141
143
  h2(#testing). Tested and Documented
@@ -182,17 +184,45 @@ Yes, we do make typos, spelling errors and sometimes we write things that don't
182
184
 
183
185
  For simple typos and quick fixes, just send a message to the mailing list or log an issue in JIRA.
184
186
 
185
- If you end up rewriting a significant piece of text, or add new documentation (you rock!), send a patch. Making documentation patches is fairly easy. All the documentation is generated from text files in the @doc/pages@ directory, so all you need to do is check it out from SVN, edit, and @svn diff@ to create a patch.
187
+ If you end up rewriting a significant piece of text, or add new documentation (you rock!), send a patch. Making documentation patches is fairly easy. All the documentation is generated from text files in the @doc/pages@ directory, so all you need to do is check it out from Git/SVN, edit, and @svn diff@ to create a patch.
186
188
 
187
189
  We use "Textile":http://www.textism.com/tools/textile/ as the markup language, it takes all of a few minutes to learn, it's intuitive to use, and produces clean HTML. You can learn it all in a few minutes from the "Textile Reference Manual":http://redcloth.org/textile. Also check out the "Textile Quick Reference":http://hobix.com/textile/quick.html.
188
190
 
189
- You can always check the documentation to see which conventions we use, and also a couple of extensions we have for styling source code (with syntax highlighting!) and handling footnotes. The table of contents is auto-generated form H1/H2 headers.
191
+ Syntax highlighting handled by "Pygments":http://pygments.org. Use the special @highlight@ tag to separate code sample from the rest of the text and to tell Pygments which language to use. For example:
192
+
193
+ <notextile><pre>
194
+ &#123;&#37; highlight ruby &#37;&#125;
195
+ define 'project' do
196
+ # Just a sample
197
+ end
198
+ &#123;&#37; endhighlight &#37;&#125;
199
+ </pre></notextile>
200
+
201
+ Have a look at existing documentation to see writing conventions, specifically:
202
+
203
+ * Separate paragraphs with two newlines.
204
+ * Use one newline only if you need a &lt;br&gt; tag, otherwise, no newlines inside the paragraph.
205
+ * When creating a new page, don't forget the YAML premable at the top (Jekyll needs the page title and layout).
206
+ * The layout uses H1 to render the page title; only use H2 through H4 for the page content.
207
+ * Use H2 headers for the major page sections. Give each H2 header a unique ID so the table of contents can link to it.
208
+ * Separating sentences with two spaces, just a convenience when editing in a text editor using monospaced fonts.
209
+ * If in doubt, ask.
210
+
211
+ To go from Textile to HTML we use "Jekyll":http://github.com/mojombo/jekyll. You can use the @jekyll@ rake task to transform the files under @doc@ and create a copy of the Web site in the directory @_site@. For example:
212
+
213
+ {% highlight sh %}
214
+ $ rake jekyll
215
+ $ open _site/index.html
216
+ {% endhighlight %}
190
217
 
191
- The tool we use for this is called Docter, which we developed specifically for Buildr, and use to create the Web site and printable PDF. If you want to try it out you'll need to first @gem install docter@. To generate a copy of the Web site, simple run @rake html@ .
218
+ There is no live editing, but you can run @rake jekyll auto=true@, and when you update and save a Textile page it will regenerate the corresponding HTML page.
192
219
 
193
- If you're thinking of editing the docs, and using @rake html@ to see what the HTML looks like, you may want to try something simpler. Start by running the Docter Web server with @rake docter@ and then point your browser at @http://localhost:3000@. To see your edits, simply refresh the page.
220
+ To go from HTML to PDF we use "PrinceXML":http://www.princexml.com/. The target file @buildr.pdf@ is generated by first running Jekyll and then merging the generated HTML pages into a single PDF document. For example:
194
221
 
195
- Generating the PDF is a bit more tricky, we use the HTML in combination with print media CSS stylesheets and run them through the wonderful "PrinceXML":http://www.princexml.com/, so you'll need to install PrinceXML first before you can @rake pdf@.
222
+ {% highlight sh %}
223
+ $ rake buildr.pdf
224
+ $ open buildr.pdf
225
+ {% endhighlight %}
196
226
 
197
227
 
198
228
  h2(#contributors). Contributors
@@ -201,6 +231,8 @@ Here is the list of people who are actively working and committing on Buildr:
201
231
 
202
232
  *"Assaf Arkin":http://labnotes.org* (assaf at apache.org)
203
233
 
234
+ Started working on Buildr because Maven was too much pain and Rake wasn't enough. Assaf has been hanging around Apache since 1999, as founding contributor to XML Apache, Ode and Buildr. Assaf is also co-author of "Ruby In Practice":http://manning.com/mcanally/.
235
+
204
236
  *Alex Boisvert*
205
237
 
206
238
  Came to Buildr as a refuge from the Maven Uncertainty Principle. Alex has been working mostly on the Scala integration and believes Ruby scripting is a great complement to statically typed languages.
@@ -214,3 +246,7 @@ Currently a Java Developer at "http://jwmsolutions.com":http://jwmsolutions.com,
214
246
  *Lacton* (lacton at apache.org)
215
247
 
216
248
  A test-infected developer since 2001, Lacton yearns for a development infrastructure that would shorten feedback loops so much that testing, building, refactoring and committing would feel as easy and natural as breathing air.
249
+
250
+ *"Daniel Spiewak":http://www.codecommit.com/blog* (djspiewak at apache.org)
251
+
252
+ Daniel originally came to Buildr in search of a Scala build tool which was better than Ant. He got more than he bargained for. Now, he works to advance Buildr as the absolute best tool for supporting Scala development.
@@ -79,7 +79,7 @@ blockquote {
79
79
  padding-right: 2em;
80
80
  margin-left: 0.3em;
81
81
  margin-right: 0;
82
- border-left: 1px solid #3c78b5;
82
+ font-style: italic;
83
83
  }
84
84
 
85
85
  ul {
@@ -121,14 +121,16 @@ th, thead td {
121
121
 
122
122
  #header {
123
123
  margin: 0 0 3em 18em;
124
+ position: relative;
124
125
  }
125
126
 
126
127
  #header .tagline {
127
128
  float: right;
128
- font-size: 1.5em;
129
+ font-size: 1.2em;
129
130
  font-weight: bold;
130
- position: relative;
131
- bottom: 4.5em;
131
+ position: absolute;
132
+ top: 0.6em;
133
+ right: 0;
132
134
  }
133
135
 
134
136
 
@@ -168,6 +170,11 @@ th, thead td {
168
170
  margin-top: 2em;
169
171
  padding: 0.3em 0 0.5em 0.5em;
170
172
  }
173
+ #pages ol li p {
174
+ font-weight: normal;
175
+ color: #000;
176
+ vertical-align: center;
177
+ }
171
178
 
172
179
 
173
180
  #content { /* Parent Wrapper for inside boxes */
@@ -15,34 +15,33 @@
15
15
  */
16
16
 
17
17
 
18
- @page {
19
- margin: 1in 0.75in 1in 0.75in;
20
- @top-left, @top-right {
21
- font-family: "Gill Sans";
22
- font-weight: normal;
18
+ @media print {
19
+ @page { size: letter; }
20
+ @page:first {
21
+ @top-left { content: normal }
22
+ @top-right { content: normal }
23
+ }
24
+ @page:right {
25
+ margin: 1.25in 1in 1.5in 1.5in;
26
+ font: normal 10pt "Gill Sans" !important;
27
+ @top-left { content: string(pagetitle); }
28
+ @top-right { content: counter(page); }
29
+ }
30
+ @page:left {
31
+ margin: 1.25in 1.5in 1.5in 1in;
32
+ font: normal 10pt "Gill Sans" !important;
33
+ @top-left { content: counter(page); }
34
+ @top-right { content: string(pagetitle); }
23
35
  }
24
- }
25
- @page:left {
26
- @top-left { content: counter(page); }
27
- @top-right { content: string(pagetitle); }
28
- }
29
- @page:right {
30
- @top-left { content: string(pagetitle); }
31
- @top-right { content: counter(page); }
32
- }
33
- @page:first {
34
- @top-left { content: normal }
35
- @top-right { content: normal }
36
- }
37
36
 
38
- @media print {
39
37
  title { string-set: doctitle content(); }
40
38
 
41
39
  body {
42
- font-family: "Helvetica Neue", "DejaVu Sans", "Verdana";
40
+ font-family: "Palatino";
43
41
  margin: 0;
44
42
  color: black;
45
43
  background: white;
44
+ font-size: 11pt;
46
45
  }
47
46
 
48
47
  h1 {
@@ -56,12 +55,16 @@
56
55
  pre, p, blockquote { page-break-inside: avoid; }
57
56
  pre, code {
58
57
  font-family: "Monaco", "DejaVu Sans Mono", "Courier New", "Courier";
59
- font-size: 10pt;
58
+ font-size: 9pt;
59
+ }
60
+ pre br {
61
+ display: none;
60
62
  }
61
63
  a:link, a:visited {
62
64
  background: transparent;
63
65
  text-decoration: none;
64
66
  }
67
+
65
68
 
66
69
  #header, #pages, #footer { display: none }
67
70
  #wrap, #content {
@@ -82,12 +85,17 @@
82
85
  border: none;
83
86
  }
84
87
  .title img {
85
- width: 20em;
86
- margin: 2em auto 2em auto;
88
+ display: block;
89
+ width: 80%;
90
+ margin: 2em auto 4em auto;
87
91
  }
88
92
  p.preface {
89
93
  page-break-before: always;
90
- padding-top: 2.5in;
94
+ padding-top: 1.5in;
95
+ }
96
+ div.preface.quotes {
97
+ page-break-before: always;
98
+ padding-top: 1in;
91
99
  }
92
100
 
93
101
  }
@@ -6,7 +6,7 @@ title: Download
6
6
 
7
7
  h2(#install). Installing Buildr
8
8
 
9
- *The easy way:* The "Getting Started guide":getting_started.html will show you how to install Buildr in a matter of minutes.
9
+ *The easy way:* Follow the "quick installation instructions":installing.html to get Buildr up and running in a matter of minutes.
10
10
 
11
11
 
12
12
  h2(#dists). Official & Unofficial Distributions
@@ -23,6 +23,7 @@ h2(#dist). Binaries and Source Code
23
23
  h3. buildr 1.3.4 (2009-04-21)
24
24
 
25
25
  |_. Package |_. MD5 Checksum |_. PGP |
26
+ | "buildr-1.3.4.gem":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.gem | "34247286f910be1724f63b9e795e75ed":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.gem.asc |
26
27
  | "buildr-1.3.4-java.gem":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4-java.gem | "44ed67bf835cf2abdc2b6723b5eceadb":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4-java.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4-java.gem.asc |
27
28
  | "buildr-1.3.4.tgz":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.tgz | "7d918b88a3bb8139f28f6ff0b39d003c":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.tgz.md5 | "Sig":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.tgz.asc |
28
29
  | "buildr-1.3.4.zip":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.zip | "8f4cf84dc6e293aac5fba7e2a9cc0776":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.zip.md5 | "Sig":http://www.apache.org/dist/buildr/1.3.4/buildr-1.3.4.zip.asc |
@@ -11,7 +11,6 @@ For example, we use OpenJPA in several projects. It's a very short task, but ea
11
11
 
12
12
  Compare this:
13
13
 
14
- <notextile>
15
14
  {% highlight ruby %}
16
15
  file('derby.sql') do
17
16
  REQUIRES = [
@@ -32,11 +31,9 @@ file('derby.sql') do
32
31
  end
33
32
  end
34
33
  {% endhighlight %}
35
- </notextile>
36
34
 
37
35
  To this:
38
36
 
39
- <notextile>
40
37
  {% highlight ruby %}
41
38
  file('derby.sql') do
42
39
  mapping_tool :action=>'build', :sql=>task.name,
@@ -44,16 +41,22 @@ file('derby.sql') do
44
41
  :classpath=>projects('store', 'utils')
45
42
  end
46
43
  {% endhighlight %}
47
- </notextile>
48
44
 
49
45
  I prefer the second. It's easier to look at the Buildfile and understand what it does. It's easier to maintain when you only have to look at the important information.
50
46
 
51
47
  But just using functions is not always enough. You end up with a Buildfile containing a lot of code that clearly doesn't belong there. For starters, I recommend putting it in the @tasks@ directory. Write it into a file with a @.rake@ extension and place that in the @tasks@ directory next to the Buildfile. Buildr will automatically pick it up and load it for you.
52
48
 
53
- If you want to share these pre-canned definitions between projects, you have a few more options. You can share the @tasks@ directory using SVN externals. Another mechanism with better version control is to package all these tasks, functions and modules into a "Gem":http://rubygems.org/ and require it from your Buildfile. You can run your own internal Gem server for that.
49
+ If you want to share these pre-canned definitions between projects, you have a few more options. You can share the @tasks@ directory using SVN externals, Git modules, or whichever cross-repository feature your source control system supports. Another mechanism with better version control is to package all these tasks, functions and modules into a "Gem":http://rubygems.org/ and require it from your Buildfile. You can run your own internal Gem server for that.
54
50
 
55
- For individual task files, you can also use "Sake":http://errtheblog.com/post/6069 for system-wide Rake tasks deployment.
51
+ To summarize, there are several common ways to distribute extensions:
52
+ * Put them in the same place (e.g. @~/.buildr@) and require them from your
53
+ @buildfile@
54
+ * Put them directly in the project, typically under the @tasks@ directory.
55
+ * Put them in a shared code repository, and link to them from your project's @tasks@ directory
56
+ * As Ruby gems and specify which gems are used in the settings file
56
57
 
58
+ You can also get creative and devise your own way to distribute extensions.
59
+ "Sake":http://errtheblog.com/post/6069 is a good example of such initiative that lets you deploy Rake tasks on a system-wide basis.
57
60
 
58
61
  h2(#extensions). Creating Extensions
59
62
 
@@ -61,23 +64,19 @@ The basic mechanism for extending projects in Buildr are Ruby modules. In fact,
61
64
 
62
65
  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:
63
66
 
64
- <notextile>
65
67
  {% highlight ruby %}
66
68
  class Project
67
69
  include MyExtension
68
70
  end
69
71
  {% endhighlight %}
70
- </notextile>
71
72
 
72
73
  You can also extend a given project instance and only that instance by extending it with the module:
73
74
 
74
- <notextile>
75
75
  {% highlight ruby %}
76
76
  define 'foo' do
77
77
  extend MyExtension
78
78
  end
79
79
  {% endhighlight %}
80
- </notextile>
81
80
 
82
81
  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.
83
82
 
@@ -90,7 +89,6 @@ The easiest way to add callbacks is by incorporating the Extension module in you
90
89
 
91
90
  This example illustrates how to write a simple extension:
92
91
 
93
- <notextile>
94
92
  {% highlight ruby %}
95
93
  module LinesOfCode
96
94
  include Extension
@@ -127,8 +125,8 @@ class Buildr::Project
127
125
  include LinesOfCode
128
126
  end
129
127
  {% endhighlight %}
130
- </notextile>
131
128
 
129
+ You may find interesting that this Extension API is used pervasively inside Buildr itself. Many of the standard tasks such as @compile@, @test@, @package@ are extensions to a very small core.
132
130
 
133
131
  h2(#layouts). Using Alternative Layouts
134
132
 
@@ -136,32 +134,26 @@ Buildr follows a common convention for project layouts: Java source files appear
136
134
 
137
135
  The default layout is available in @Layout.default@, and all projects inherit it. You can set @Layout.default@ to your own layout, or define a project with a given layout (recommended) by setting the @:layout@ property. Projects inherit the layout from their parent projects. For example:
138
136
 
139
- <notextile>
140
137
  {% highlight ruby %}
141
138
  define 'foo', :layout=>my_layout do
142
139
  ...
143
140
  end
144
141
  {% endhighlight %}
145
- </notextile>
146
142
 
147
143
  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. For example:
148
144
 
149
- <notextile>
150
145
  {% highlight ruby %}
151
146
  my_layout = Layout.new
152
147
  my_layout[:source, :main, :java] = 'java'
153
148
  my_layout[:source, :main, :resources] = 'resources'
154
149
  {% endhighlight %}
155
- </notextile>
156
150
 
157
151
  Partial expansion also works, so you can specify the above layout using:
158
152
 
159
- <notextile>
160
153
  {% highlight ruby %}
161
154
  my_layout = Layout.new
162
155
  my_layout[:source, :main] = ''
163
156
  {% endhighlight %}
164
- </notextile>
165
157
 
166
158
  If you need anything more complex, you can always subclass @Layout@ and add special handling in the @expand@ method, you'll find one such example in the API documentation.
167
159
 
@@ -177,7 +169,6 @@ The built-in tasks expand lists of symbols into relative paths, using the follow
177
169
 
178
170
  All tasks are encouraged to use the same convention, and whenever possible, we recommend using the project's @path_to@ method to expand a list of symbols into a path, or use the appropriate path when available. For example:
179
171
 
180
- <notextile>
181
172
  {% highlight ruby %}
182
173
  define 'bad' do
183
174
  # This may not be the real target.
@@ -193,4 +184,3 @@ define 'good' do
193
184
  package(:jar).include path_to(:source, :main, :etc, '*')
194
185
  end
195
186
  {% endhighlight %}
196
- </notextile>
Binary file
Binary file
Binary file
Binary file
@@ -1,13 +1,34 @@
1
1
  ---
2
2
  layout: default
3
- title: Welcome
3
+ title: Apache Buildr
4
4
  ---
5
5
 
6
- h2(#what_is_apache_buildr). What is Apache Buildr?
7
-
8
6
  Apache Buildr is a build system for Java-based applications, including support for Scala, Groovy and a growing number of JVM languages and tools. 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.
9
7
 
10
- Here's what we got:
8
+
9
+ h2(#why). Why Buildr Rocks
10
+
11
+ "Daniel Spiewak":http://www.codecommit.com/blog:
12
+
13
+ bq. If you think about it, the question isn’t “Why use Buildr?”, it’s really “Why use anything else?” The advantages afforded by Buildr are so substantial, I really can’t see myself going with any other tool, at least not when I have a choice.
14
+
15
+ "Tristan Juricek":http://tristanhunt.com/:
16
+
17
+ bq. That’s still the strongest sell: it builds everything I need, and as I’ve needed more, I just got things working without a lot of fuss.
18
+
19
+ "Matthieu Riou":http://offthelip.org/:
20
+
21
+ bq. We used to rely on Ant, with a fairly extensive set of scripts. It worked but was expensive to maintain. The biggest mistake afterward was to migrate to Maven2. I could write pages of rants explaining all the problems we ran into and we still ended up with thousands of lines of XML.
22
+
23
+ "Martin Grotzke":http://www.javakaffee.de/blog/:
24
+
25
+ bq. The positive side effect for me as a java user is that I learn a little ruby, and that’s easy but lots of fun… :-)
26
+
27
+ "Ijonas Kisselbach":http://twitter.com/ijonas/statuses/4134103928:
28
+
29
+ bq. I've cleaned up & migrated the Vamosa build process from 768 lines of Ant build.xml to 28 lines of Buildr.
30
+
31
+ h2(#what). What You Get
11
32
 
12
33
  * A simple way to specify projects, and build large projects out of smaller sub-projects.
13
34
  * Pre-canned tasks that require the least amount of configuration, keeping the build script DRY and simple.
@@ -20,28 +41,29 @@ Here's what we got:
20
41
  * Simple way to upgrade to new versions.
21
42
  * Did we mention fast?
22
43
 
23
- So let's get started. You can "read the documentation online":getting_started.html, or "download the PDF":buildr.pdf.
44
+ So let's get started. You can "read the documentation online":quick_start.html, or "download the PDF":buildr.pdf.
24
45
 
25
46
 
26
- h2(#news). Project News
47
+ h2(#news). What's New
27
48
 
28
- New in Buildr 1.3.4:
49
+ New in Buildr 1.3.5:
29
50
 
30
- * We graduated from the Apache Incubator! This is our first release as a top-level Apache project: http://buildr.apache.org. New site, new mailing lists, SVN, Git, etc.
31
- * Support for Git version control system
32
- * Improved all-around Scala support, including joint Java-Scala compilation and upgraded to Scala 2.7.3 dependencies: ScalaSpecs 1.4.3, ScalaCheck 1.5 and ScalaTest 0.9.5
33
- * New 'artifacts:sources' task to download source code for artifact jars
34
- * Source code attachments for external dependencies in Eclipse and IDEA projects
35
- * Dependency upgrades such as Rake 0.8.4, Net-SSH 2.0.11, RSpec 1.2.2, JRuby 1.1.6.
36
- * Documentation now uses "Jekyll":http://github.com/mojombo/jekyll/ to generate web site and PDF document. This replaces Docter so less code to
37
- maintain and the same Textile/Liquid mechanism as when using Github pages.
38
- * And 20 or so bug fixes.
51
+ * Interactive shell (REPL) support, including BeanShell for Java projects
52
+ * Scala libraries are automatically downloaded if not availabe locally
53
+ * New 'cobertura:check' allows you to check for code coverage levels in your projects
54
+ * Eclipse task is configurable to support various types of natures, builders, etc.
55
+ * Dependency upgrades such as Net-SSH 2.0.15, JRuby 1.3.1, Rake 0.8.7, RSpec 1.2.8, easyb 0.9, TestNG 5.10
56
+ * And 15+ bug fixes.
39
57
 
40
58
  See the "CHANGELOG":CHANGELOG for full details.
41
59
 
42
60
 
43
- h2(#legal). Legal Notices
61
+ h2(#notices). Credits & Notices
62
+
63
+ !http://www.apache.org/images/asf-logo.gif(A project of the Apache Software Foundation)!:http://www.apache.org
44
64
 
45
65
  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.
46
66
 
47
67
  "ColorCons":http://www.mouserunner.com/Spheres_ColoCons1_Free_Icons.html, copyright of Ken Saunders. "DejaVu fonts":http://dejavu.sourceforge.net, copyright of Bitstream, Inc.
68
+
69
+ Community member quotes from a thread on "Stack Overflow":http://stackoverflow.com/questions/1015525/why-use-buildr-instead-of-ant-or-maven/1055864.