buildr 1.3.5-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/CHANGELOG +998 -0
  2. data/LICENSE +176 -0
  3. data/NOTICE +26 -0
  4. data/README.rdoc +134 -0
  5. data/Rakefile +45 -0
  6. data/_buildr +29 -0
  7. data/_jbuildr +29 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/cobertura.rb +22 -0
  10. data/addon/buildr/drb.rb +281 -0
  11. data/addon/buildr/emma.rb +22 -0
  12. data/addon/buildr/hibernate.rb +142 -0
  13. data/addon/buildr/javacc.rb +85 -0
  14. data/addon/buildr/jdepend.rb +60 -0
  15. data/addon/buildr/jetty.rb +248 -0
  16. data/addon/buildr/jibx.rb +86 -0
  17. data/addon/buildr/nailgun.rb +221 -0
  18. data/addon/buildr/openjpa.rb +90 -0
  19. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  20. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  21. data/addon/buildr/org/apache/buildr/BuildrNail.java +41 -0
  22. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  23. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  24. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  25. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  26. data/addon/buildr/xmlbeans.rb +93 -0
  27. data/bin/buildr +19 -0
  28. data/buildr.buildfile +58 -0
  29. data/buildr.gemspec +65 -0
  30. data/doc/_config.yml +1 -0
  31. data/doc/_layouts/default.html +88 -0
  32. data/doc/_layouts/preface.html +22 -0
  33. data/doc/artifacts.textile +211 -0
  34. data/doc/building.textile +244 -0
  35. data/doc/contributing.textile +252 -0
  36. data/doc/css/default.css +236 -0
  37. data/doc/css/print.css +101 -0
  38. data/doc/css/syntax.css +23 -0
  39. data/doc/download.textile +79 -0
  40. data/doc/extending.textile +186 -0
  41. data/doc/images/1442160941-frontcover.jpg +0 -0
  42. data/doc/images/asf-logo.gif +0 -0
  43. data/doc/images/asf-logo.png +0 -0
  44. data/doc/images/buildr-hires.png +0 -0
  45. data/doc/images/buildr.png +0 -0
  46. data/doc/images/favicon.png +0 -0
  47. data/doc/images/growl-icon.tiff +0 -0
  48. data/doc/images/note.png +0 -0
  49. data/doc/images/project-structure.png +0 -0
  50. data/doc/images/tip.png +0 -0
  51. data/doc/images/zbuildr.png +0 -0
  52. data/doc/images/zbuildr.tif +0 -0
  53. data/doc/index.textile +69 -0
  54. data/doc/installing.textile +266 -0
  55. data/doc/languages.textile +459 -0
  56. data/doc/mailing_lists.textile +25 -0
  57. data/doc/more_stuff.textile +457 -0
  58. data/doc/packaging.textile +430 -0
  59. data/doc/preface.textile +54 -0
  60. data/doc/projects.textile +271 -0
  61. data/doc/quick_start.textile +210 -0
  62. data/doc/scripts/buildr-git.rb +512 -0
  63. data/doc/scripts/gitflow.rb +296 -0
  64. data/doc/scripts/install-jruby.sh +44 -0
  65. data/doc/scripts/install-linux.sh +72 -0
  66. data/doc/scripts/install-osx.sh +52 -0
  67. data/doc/settings_profiles.textile +280 -0
  68. data/doc/testing.textile +222 -0
  69. data/etc/KEYS +151 -0
  70. data/lib/buildr.rb +36 -0
  71. data/lib/buildr/core.rb +35 -0
  72. data/lib/buildr/core/application.rb +656 -0
  73. data/lib/buildr/core/build.rb +452 -0
  74. data/lib/buildr/core/checks.rb +254 -0
  75. data/lib/buildr/core/common.rb +150 -0
  76. data/lib/buildr/core/compile.rb +608 -0
  77. data/lib/buildr/core/environment.rb +129 -0
  78. data/lib/buildr/core/filter.rb +362 -0
  79. data/lib/buildr/core/generate.rb +195 -0
  80. data/lib/buildr/core/help.rb +119 -0
  81. data/lib/buildr/core/osx.rb +46 -0
  82. data/lib/buildr/core/progressbar.rb +156 -0
  83. data/lib/buildr/core/project.rb +866 -0
  84. data/lib/buildr/core/shell.rb +198 -0
  85. data/lib/buildr/core/test.rb +723 -0
  86. data/lib/buildr/core/transports.rb +559 -0
  87. data/lib/buildr/core/util.rb +449 -0
  88. data/lib/buildr/groovy.rb +19 -0
  89. data/lib/buildr/groovy/bdd.rb +106 -0
  90. data/lib/buildr/groovy/compiler.rb +138 -0
  91. data/lib/buildr/groovy/shell.rb +48 -0
  92. data/lib/buildr/ide.rb +19 -0
  93. data/lib/buildr/ide/eclipse.rb +334 -0
  94. data/lib/buildr/ide/eclipse/java.rb +53 -0
  95. data/lib/buildr/ide/eclipse/plugin.rb +68 -0
  96. data/lib/buildr/ide/eclipse/scala.rb +66 -0
  97. data/lib/buildr/ide/idea.ipr.template +300 -0
  98. data/lib/buildr/ide/idea.rb +190 -0
  99. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  100. data/lib/buildr/ide/idea7x.rb +212 -0
  101. data/lib/buildr/java.rb +23 -0
  102. data/lib/buildr/java/ant.rb +94 -0
  103. data/lib/buildr/java/bdd.rb +459 -0
  104. data/lib/buildr/java/cobertura.rb +274 -0
  105. data/lib/buildr/java/commands.rb +213 -0
  106. data/lib/buildr/java/compiler.rb +349 -0
  107. data/lib/buildr/java/deprecated.rb +141 -0
  108. data/lib/buildr/java/emma.rb +244 -0
  109. data/lib/buildr/java/jruby.rb +117 -0
  110. data/lib/buildr/java/jtestr_runner.rb.erb +116 -0
  111. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  112. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +137 -0
  113. data/lib/buildr/java/packaging.rb +716 -0
  114. data/lib/buildr/java/pom.rb +174 -0
  115. data/lib/buildr/java/rjb.rb +155 -0
  116. data/lib/buildr/java/test_result.rb +353 -0
  117. data/lib/buildr/java/tests.rb +333 -0
  118. data/lib/buildr/java/version_requirement.rb +172 -0
  119. data/lib/buildr/packaging.rb +24 -0
  120. data/lib/buildr/packaging/archive.rb +488 -0
  121. data/lib/buildr/packaging/artifact.rb +749 -0
  122. data/lib/buildr/packaging/artifact_namespace.rb +972 -0
  123. data/lib/buildr/packaging/artifact_search.rb +140 -0
  124. data/lib/buildr/packaging/gems.rb +102 -0
  125. data/lib/buildr/packaging/package.rb +238 -0
  126. data/lib/buildr/packaging/tar.rb +186 -0
  127. data/lib/buildr/packaging/version_requirement.rb +172 -0
  128. data/lib/buildr/packaging/zip.rb +73 -0
  129. data/lib/buildr/packaging/ziptask.rb +316 -0
  130. data/lib/buildr/resources/buildr.icns +0 -0
  131. data/lib/buildr/scala.rb +25 -0
  132. data/lib/buildr/scala/bdd.rb +109 -0
  133. data/lib/buildr/scala/compiler.rb +195 -0
  134. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
  135. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  136. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +35 -0
  137. data/lib/buildr/scala/shell.rb +55 -0
  138. data/lib/buildr/scala/tests.rb +157 -0
  139. data/lib/buildr/shell.rb +180 -0
  140. data/rakelib/checks.rake +57 -0
  141. data/rakelib/doc.rake +92 -0
  142. data/rakelib/jekylltask.rb +120 -0
  143. data/rakelib/package.rake +73 -0
  144. data/rakelib/release.rake +149 -0
  145. data/rakelib/rspec.rake +73 -0
  146. data/rakelib/setup.rake +54 -0
  147. data/rakelib/stage.rake +213 -0
  148. data/rakelib/stage.rake~ +213 -0
  149. data/spec/addon/drb_spec.rb +328 -0
  150. data/spec/core/application_spec.rb +502 -0
  151. data/spec/core/build_spec.rb +677 -0
  152. data/spec/core/checks_spec.rb +519 -0
  153. data/spec/core/common_spec.rb +670 -0
  154. data/spec/core/compile_spec.rb +583 -0
  155. data/spec/core/extension_spec.rb +93 -0
  156. data/spec/core/generate_spec.rb +33 -0
  157. data/spec/core/project_spec.rb +762 -0
  158. data/spec/core/test_spec.rb +1098 -0
  159. data/spec/core/transport_spec.rb +537 -0
  160. data/spec/core/util_spec.rb +67 -0
  161. data/spec/groovy/bdd_spec.rb +80 -0
  162. data/spec/groovy/compiler_spec.rb +240 -0
  163. data/spec/ide/eclipse_spec.rb +501 -0
  164. data/spec/ide/idea7x_spec.rb +84 -0
  165. data/spec/java/ant_spec.rb +33 -0
  166. data/spec/java/bdd_spec.rb +382 -0
  167. data/spec/java/cobertura_spec.rb +85 -0
  168. data/spec/java/compiler_spec.rb +446 -0
  169. data/spec/java/emma_spec.rb +119 -0
  170. data/spec/java/java_spec.rb +124 -0
  171. data/spec/java/packaging_spec.rb +1134 -0
  172. data/spec/java/test_coverage_helper.rb +257 -0
  173. data/spec/java/tests_spec.rb +493 -0
  174. data/spec/packaging/archive_spec.rb +527 -0
  175. data/spec/packaging/artifact_namespace_spec.rb +654 -0
  176. data/spec/packaging/artifact_spec.rb +795 -0
  177. data/spec/packaging/packaging_helper.rb +63 -0
  178. data/spec/packaging/packaging_spec.rb +684 -0
  179. data/spec/sandbox.rb +142 -0
  180. data/spec/scala/bdd_spec.rb +119 -0
  181. data/spec/scala/compiler_spec.rb +284 -0
  182. data/spec/scala/scala.rb +38 -0
  183. data/spec/scala/tests_spec.rb +261 -0
  184. data/spec/spec_helpers.rb +340 -0
  185. data/spec/version_requirement_spec.rb +129 -0
  186. metadata +383 -0
@@ -0,0 +1,236 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with this
3
+ * work for additional information regarding copyright ownership. The ASF
4
+ * licenses this file to you under the Apache License, Version 2.0 (the
5
+ * "License"); you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ * License for the specific language governing permissions and limitations
14
+ * under the License.
15
+ */
16
+
17
+
18
+ body {
19
+ background-color: #fff;
20
+ color: #000;
21
+ font-family: "Helvetica Neue", "DejaVu Sans", "Verdana";
22
+ text-align: center;
23
+ line-height: 150%;
24
+ }
25
+
26
+ a:link, a:visited{
27
+ color: #0044b3;
28
+ text-decoration: none;
29
+ }
30
+
31
+ a:hover{
32
+ text-decoration: underline;
33
+ }
34
+
35
+ img {
36
+ border: none;
37
+ }
38
+
39
+ pre, code {
40
+ font-family: "Monaco", "DejaVu Sans Mono", "Courier New", "Courier";
41
+ font-size: 11pt;
42
+ }
43
+ pre {
44
+ margin: 0.3em 0 0.3em 0.9em;
45
+ padding: 0;
46
+ line-height: 1.8em;
47
+ white-space: pre-wrap; /* css-3 */
48
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
49
+ }
50
+ pre br { display: none; }
51
+
52
+ h1, h2, h3 {
53
+ font-family: "Gill Sans";
54
+ padding: 0;
55
+ margin: 1.6em 0 0.6em -0.9em;
56
+ line-height: 1.25em;
57
+ letter-spacing: 0.03em;
58
+ }
59
+
60
+ h1 {
61
+ font-size: 2em;
62
+ margin-top: 0;
63
+ padding-bottom: 0.3em;
64
+ border-bottom: 1px solid #808080;
65
+ }
66
+
67
+ h2 {
68
+ font-size: 1.3em;
69
+ padding-bottom: 0.3em;
70
+ border-bottom: 1px solid #a0a0a0;
71
+ }
72
+
73
+ h3 {
74
+ font-size: 1.1em;
75
+ }
76
+
77
+ blockquote {
78
+ padding-left: 2em;
79
+ padding-right: 2em;
80
+ margin-left: 0.3em;
81
+ margin-right: 0;
82
+ font-style: italic;
83
+ }
84
+
85
+ ul {
86
+ list-style-type: disc;
87
+ }
88
+
89
+ ul ul {
90
+ list-style-type: disc;
91
+ padding-left: 1em;
92
+ }
93
+
94
+ table {
95
+ border-spacing: 0;
96
+ width: 100%;
97
+ margin: 0.3em 0 0.3em 0;
98
+ }
99
+
100
+ th, td {
101
+ padding: 0.3em 0.5em 0.3em 0.5em;
102
+ border-bottom: 1px solid #D8D8D8;
103
+ vertical-align: top;
104
+ background-color: #FFFFFF;
105
+ }
106
+
107
+ th, thead td {
108
+ border-bottom: none;
109
+ background-color: #669966;
110
+ color: #ffffff;
111
+ text-align: left;
112
+ }
113
+
114
+
115
+ #wrap{
116
+ margin: 1em auto 2em auto;
117
+ text-align: left;
118
+ width: 65em;
119
+ }
120
+
121
+
122
+ #header {
123
+ margin: 0 0 3em 18em;
124
+ position: relative;
125
+ }
126
+
127
+ #header .tagline {
128
+ float: right;
129
+ font-size: 1.2em;
130
+ font-weight: bold;
131
+ position: absolute;
132
+ top: 0.6em;
133
+ right: 0;
134
+ }
135
+
136
+
137
+ #pages { /* Parent Wrapper for inside boxes */
138
+ /* display: inline; */ /* IE Hack */
139
+ width: 12em;
140
+ float: left;
141
+ text-align: left;
142
+ margin-right: 2em;
143
+ font-family: "Gill Sans";
144
+ font-size: 11pt;
145
+ text-align: right;
146
+ border-right: 1px solid #ccc;
147
+ padding-right: 2em;
148
+ }
149
+ #pages ol {
150
+ list-style: none;
151
+ padding: 0;
152
+ margin: 0;
153
+ }
154
+ #pages ol li {
155
+ padding: 0.3em 0 0.6em 0em;
156
+ color: #669966;
157
+ font-weight: bold;
158
+ }
159
+ #pages ol li ol {
160
+ margin-top: 0.3em;
161
+ padding: 0.3em 0 0.9em 0.9em;
162
+ }
163
+ #pages ol li ol li {
164
+ padding: 0.3em 0 0.3em 0em;
165
+ }
166
+ #pages ol li a {
167
+ font-weight: normal;
168
+ }
169
+ #pages form {
170
+ margin-top: 2em;
171
+ padding: 0.3em 0 0.5em 0.5em;
172
+ }
173
+ #pages ol li p {
174
+ font-weight: normal;
175
+ color: #000;
176
+ vertical-align: center;
177
+ }
178
+
179
+
180
+ #content { /* Parent Wrapper for inside boxes */
181
+ /* display: inline; *//* IE Hack */
182
+ float: right;
183
+ width: 44em;
184
+ margin-left: 0.3em;
185
+ margin-bottom: 5em;
186
+ }
187
+
188
+ ol.toc {
189
+ list-style: none;
190
+ padding: 0;
191
+ margin: 0 0 2em 0;
192
+ }
193
+ ol.toc li {
194
+ padding: 0.3em 0 0.3em 0;
195
+ margin: 0;
196
+ }
197
+ ol.toc li ol.toc {
198
+ margin: 0;
199
+ padding-left: 0.9em;
200
+ }
201
+
202
+
203
+ #content p.tip, #content p.note {
204
+ margin: 0.9em 0 0 0;
205
+ padding: 0 0 2em 4em;
206
+ }
207
+ #content p.tip { background: url("../images/tip.png") 0 0 no-repeat; }
208
+ #content p.note { background: url("../images/note.png") 0 0 no-repeat; }
209
+
210
+ #content .footnote {
211
+ margin-top: 2.5em;
212
+ }
213
+ #content .footnote {
214
+ padding-top: 1.5em;
215
+ border-top: 1px solid #ccc;
216
+ }
217
+ #content .footnote + .footnote {
218
+ margin-top: 0.5em;
219
+ padding-top: 0;
220
+ border: none;
221
+ }
222
+ #content .footnote sup { font-weight: bold; }
223
+
224
+ #content .footnote-links dt { font-weight: bold; }
225
+ #content .footnote-links dt:after { content: ": " }
226
+ #content .footnote-links dd { }
227
+
228
+
229
+ #footer {
230
+ color: #888;
231
+ border-top: 1px solid #ccc;
232
+ font-size: 0.9em;
233
+ padding: 0.3em;
234
+ margin: 2em 0 3em 0em;
235
+ clear: both;
236
+ }
data/doc/css/print.css ADDED
@@ -0,0 +1,101 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with this
3
+ * work for additional information regarding copyright ownership. The ASF
4
+ * licenses this file to you under the Apache License, Version 2.0 (the
5
+ * "License"); you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ * License for the specific language governing permissions and limitations
14
+ * under the License.
15
+ */
16
+
17
+
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); }
35
+ }
36
+
37
+ title { string-set: doctitle content(); }
38
+
39
+ body {
40
+ font-family: "Palatino";
41
+ margin: 0;
42
+ color: black;
43
+ background: white;
44
+ font-size: 11pt;
45
+ }
46
+
47
+ h1 {
48
+ string-set: pagetitle content();
49
+ page-break-before: always;
50
+ }
51
+ h1:first-child { page-break-before: avoid; }
52
+ h1, h2, h3 {
53
+ font-family: "Gill Sans";
54
+ }
55
+ pre, p, blockquote { page-break-inside: avoid; }
56
+ pre, code {
57
+ font-family: "Monaco", "DejaVu Sans Mono", "Courier New", "Courier";
58
+ font-size: 9pt;
59
+ }
60
+ pre br {
61
+ display: none;
62
+ }
63
+ a:link, a:visited {
64
+ background: transparent;
65
+ text-decoration: none;
66
+ }
67
+
68
+
69
+ #header, #pages, #footer { display: none }
70
+ #wrap, #content {
71
+ float: none !important;
72
+ color: black;
73
+ background: transparent;
74
+ width: auto !important;
75
+ margin: 0;
76
+ padding: 0;
77
+ border: 0;
78
+ }
79
+
80
+ ol.toc a:link, ol.toc a:visited { text-decoration: none; }
81
+ ol.toc a:after { content: leader('.') target-counter(attr(href), page); }
82
+
83
+ .title {
84
+ page-break-before: always;
85
+ border: none;
86
+ }
87
+ .title img {
88
+ display: block;
89
+ width: 80%;
90
+ margin: 2em auto 4em auto;
91
+ }
92
+ p.preface {
93
+ page-break-before: always;
94
+ padding-top: 1.5in;
95
+ }
96
+ div.preface.quotes {
97
+ page-break-before: always;
98
+ padding-top: 1in;
99
+ }
100
+
101
+ }
@@ -0,0 +1,23 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with this
3
+ * work for additional information regarding copyright ownership. The ASF
4
+ * licenses this file to you under the Apache License, Version 2.0 (the
5
+ * "License"); you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ * License for the specific language governing permissions and limitations
14
+ * under the License.
15
+ */
16
+
17
+ .highlight .k, .highlight .kp { color: blue } /* keyword */
18
+ .highlight .no { color: darkblue } /* constant */
19
+ .highlight .s1 { color: green } /* string */
20
+ .highlight .n { color: black } /* identifier */
21
+ .highlight .o, .highlight .p { color: darkblue } /* = + */
22
+ .highlight .ss { color: darkblue } /* symbol */
23
+ .highlight .c1 { color: gray } /* comment */
@@ -0,0 +1,79 @@
1
+ ---
2
+ layout: default
3
+ title: Download
4
+ ---
5
+
6
+
7
+ h2(#install). Installing Buildr
8
+
9
+ *The easy way:* Follow the "quick installation instructions":installing.html to get Buildr up and running in a matter of minutes.
10
+
11
+
12
+ h2(#dists). Official & Unofficial Distributions
13
+
14
+ The official Apache distribution consists of the digitally signed binaries (gems) and source packages "available below":#dist. 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).
15
+
16
+ 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.
17
+
18
+ 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/buildr or "GitHub":http://github.com/buildr/buildr/tree/master. Learn more about working with source code and "living on the edge":contributing.html#edge.
19
+
20
+
21
+ h2(#dist). Binaries and Source Code
22
+
23
+ h3. buildr 1.3.4 (2009-04-21)
24
+
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 |
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 |
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 |
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 |
30
+
31
+ p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.3.4/KEYS)
32
+
33
+
34
+ h3. buildr 1.3.3-incubating (2008-10-08)
35
+
36
+ |_. Package |_. MD5 Checksum |_. PGP |
37
+ | "buildr-1.3.3-incubating.gem":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.gem | "7192dad45441630cbf07b85af5f9069a":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.gem.asc |
38
+ | "buildr-1.3.3-java-incubating.gem":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-java-incubating.gem | "71ad4f0f8bfa951fa129db67a06b608a":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-java-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-java-incubating.gem.asc |
39
+ | "buildr-1.3.3-incubating.tgz":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.tgz | "e5ee6fe5b86386520c91a9633d02814b":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.tgz.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.tgz.asc |
40
+ | "buildr-1.3.3-incubating.zip":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.zip | "baab601fd46a877ee8e408891d68c842":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.zip.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.3-incubating/buildr-1.3.3-incubating.zip.asc |
41
+
42
+ p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.3-incubating/KEYS)
43
+
44
+
45
+ h3. buildr 1.3.2-incubating (2008-07-18)
46
+
47
+ |_. Package |_. MD5 Checksum |_. PGP |
48
+ | "buildr-1.3.2-incubating.gem":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem | "225504bc195334c4eb9d6dec814d9db1":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.asc |
49
+ | "buildr-1.3.2-java-incubating.gem":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem | "d7d8394c7aed887987be0e813e1e4cee":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.asc |
50
+ | "buildr-1.3.2-incubating.tgz":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz | "611e97df1bc76382ecbe6b60e9340f2b":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.asc |
51
+ | "buildr-1.3.2-incubating.zip":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip | "d65d20005f603338c0aedd4f17d0bc90":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.asc |
52
+
53
+ p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.2-incubating/KEYS)
54
+
55
+
56
+
57
+ h3. buildr 1.3.1-incubating (2008-05-19)
58
+
59
+ |_. Package |_. MD5 Checksum |_. PGP |
60
+ | "buildr-1.3.1-incubating.gem":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem | "476436429b9a6c4ed178009ba17dd724":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.gem.asc |
61
+ | "buildr-1.3.1-java-incubating.gem":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem | "7af37acc10621b18d4b870119c36d998":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-java-incubating.gem.asc |
62
+ | "buildr-1.3.1-incubating.tgz":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz | "ad6694416fc2e6eb22ab1042dcc41411":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.tgz.asc |
63
+ | "buildr-1.3.1-incubating.zip":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip | "0470349978b93e645ca2e9607e304ed1":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.1-incubating/buildr-1.3.1-incubating.zip.asc |
64
+
65
+ p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.1-incubating/KEYS)
66
+
67
+
68
+ h3. buildr 1.3.0-incubating (2008-05-01)
69
+
70
+ |_. Package |_. MD5 Checksum |_. PGP |
71
+ | "buildr-1.3.0-incubating.gem":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem | "37758d0a8dabc570799b0a58d23d19f0":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.gem.asc |
72
+ | "buildr-1.3.0-java-incubating.gem":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem | "6a3a86740077f739c111514e0e2b9e06":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-java-incubating.gem.asc |
73
+ | "buildr-1.3.0-incubating.tgz":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz | "acd84ad8c5031962e65b0036f3bc2e76":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.tgz.asc |
74
+ | "buildr-1.3.0-incubating.zip":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip | "d85945f05efd0e512e6d769e3dd1cc98":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip.md5 | "Sig":http://archive.apache.org/dist/buildr/1.3.0-incubating/buildr-1.3.0-incubating.zip.asc |
75
+
76
+ p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.0-incubating/KEYS)
77
+
78
+
79
+ 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://archive.apache.org/dist/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.
@@ -0,0 +1,186 @@
1
+ ---
2
+ layout: default
3
+ title: Extending Buildr
4
+ ---
5
+
6
+ h2(#tasks). Organizing Tasks
7
+
8
+ A couple of things we learned while working on Buildr. Being able to write your own Rake tasks is a very powerful feature. But if you find yourself doing the same thing over and over, you might also want to consider functions. They give you a lot more power and easy abstractions.
9
+
10
+ For example, we use OpenJPA in several projects. It's a very short task, but each time I have to go back to the OpenJPA documentation to figure out how to set the Ant MappingTool task, tell Ant how to define it. After the second time, you're recognizing a pattern and it's just easier to write a function that does all that for you.
11
+
12
+ Compare this:
13
+
14
+ {% highlight ruby %}
15
+ file('derby.sql') do
16
+ REQUIRES = [
17
+ 'org.apache.openjpa:openjpa-all:jar:0.9.7-incubating',
18
+ 'commons-collections:commons-collections:jar:3.1',
19
+ . . .
20
+ 'net.sourceforge.serp:serp:jar:1.11.0' ]
21
+ ant('openjpa') do |ant|
22
+ ant.taskdef :name=>'mapping',
23
+ :classname=>'org.apache.openjpa.jdbc.ant.MappingToolTask',
24
+ :classpath=>REQUIRES.join(File::PATH_SEPARATOR)
25
+ ant.mapping :schemaAction=>'build', :sqlFile=>task.name,
26
+ :ignoreErrors=>true do
27
+ ant.config :propertiesFile=>_('src/main/sql/derby.xml')
28
+ ant.classpath :path=>projects('store', 'utils' ).
29
+ flatten.map(&:to_s).join(File::PATH_SEPARATOR)
30
+ end
31
+ end
32
+ end
33
+ {% endhighlight %}
34
+
35
+ To this:
36
+
37
+ {% highlight ruby %}
38
+ file('derby.sql') do
39
+ mapping_tool :action=>'build', :sql=>task.name,
40
+ :properties=>_('src/main/sql/derby.xml'),
41
+ :classpath=>projects('store', 'utils')
42
+ end
43
+ {% endhighlight %}
44
+
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.
46
+
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.
48
+
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.
50
+
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
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.
60
+
61
+ h2(#extensions). Creating Extensions
62
+
63
+ The basic mechanism for extending projects in Buildr are Ruby modules. In fact, base features like compiling and testing are all developed in the form of modules, and then added to the core Project class.
64
+
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:
66
+
67
+ {% highlight ruby %}
68
+ class Project
69
+ include MyExtension
70
+ end
71
+ {% endhighlight %}
72
+
73
+ You can also extend a given project instance and only that instance by extending it with the module:
74
+
75
+ {% highlight ruby %}
76
+ define 'foo' do
77
+ extend MyExtension
78
+ end
79
+ {% endhighlight %}
80
+
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.
82
+
83
+ The easiest way to add callbacks is by incorporating the Extension module in your own extension, and using the various class methods to define callback behavior.
84
+
85
+ |_. Method |_. Usage |
86
+ | @first_time@ | This block will be called once for any particular extension. You can use this to setup top-level and local tasks. |
87
+ | @before_define@ | This block is called once for the project with the project instance, right before running the project definition. You can use this to add tasks and set properties that will be used in the project definition. |
88
+ | @after_define@ | This block is called once for the project with the project instance, right after running the project definition. You can use this to do any post-processing that depends on the project definition. |
89
+
90
+ This example illustrates how to write a simple extension:
91
+
92
+ {% highlight ruby %}
93
+ module LinesOfCode
94
+ include Extension
95
+
96
+ first_time do
97
+ # Define task not specific to any projet.
98
+ desc 'Count lines of code in current project'
99
+ Project.local_task('loc')
100
+ end
101
+
102
+ before_define do |project|
103
+ # Define the loc task for this particular project.
104
+ define_task 'loc' do |task|
105
+ lines = task.prerequisites.map { |path| Dir["#{path}/**/*"] }.flatten.uniq.
106
+ inject(0) { |total, file| total + File.readlines(file).count }
107
+ puts "Project #{project.name} has #{lines} lines of code"
108
+ end
109
+ end
110
+
111
+ after_define do |project|
112
+ # Now that we know all the source directories, add them.
113
+ task('loc'=>compile.sources + compile.test.sources)
114
+ end
115
+
116
+ # To use this method in your project:
117
+ # loc path_1, path_2
118
+ def loc(*paths)
119
+ task('loc'=>paths)
120
+ end
121
+
122
+ end
123
+
124
+ class Buildr::Project
125
+ include LinesOfCode
126
+ end
127
+ {% endhighlight %}
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.
130
+
131
+ h2(#layouts). Using Alternative Layouts
132
+
133
+ 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.
134
+
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:
136
+
137
+ {% highlight ruby %}
138
+ define 'foo', :layout=>my_layout do
139
+ ...
140
+ end
141
+ {% endhighlight %}
142
+
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:
144
+
145
+ {% highlight ruby %}
146
+ my_layout = Layout.new
147
+ my_layout[:source, :main, :java] = 'java'
148
+ my_layout[:source, :main, :resources] = 'resources'
149
+ {% endhighlight %}
150
+
151
+ Partial expansion also works, so you can specify the above layout using:
152
+
153
+ {% highlight ruby %}
154
+ my_layout = Layout.new
155
+ my_layout[:source, :main] = ''
156
+ {% endhighlight %}
157
+
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.
159
+
160
+ The built-in tasks expand lists of symbols into relative paths, using the following convention:
161
+
162
+ |_. Path |_. Expands to |
163
+ | @:source, :main, <lang/usage>@ | Directory containing source files for a given language or usage, for example, @:java@, @:resources@, @:webapp@. |
164
+ | @:source, :test, <lang/usage>@ | Directory containing test files for a given language or usage, for example, @:java@, @:resources@. |
165
+ | @:target, :generated@ | Target directory for generated code (typically source code). |
166
+ | @:target, :main, <lang/usage>@ | Target directory for compiled code, for example, @:classes@, @:resources@. |
167
+ | @:target, :test, <lang/usage>@ | Target directory for compile test cases, for example, @:classes@, @:resources@. |
168
+ | @:reports, <framework/usage>@ | Target directory for generated reports, for example, @:junit@, @:coverage@. |
169
+
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:
171
+
172
+ {% highlight ruby %}
173
+ define 'bad' do
174
+ # This may not be the real target.
175
+ puts 'Compiling to ' + path_to('target/classes')
176
+ # This will break with different layouts.
177
+ package(:jar).include 'src/main/etc/*'
178
+ end
179
+
180
+ define 'good' do
181
+ # This is always the compiler's target.
182
+ puts 'Compiling to ' + compile.target.to_s
183
+ # This will work with different layouts.
184
+ package(:jar).include path_to(:source, :main, :etc, '*')
185
+ end
186
+ {% endhighlight %}