buildr 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +76 -0
- data/NOTICE +1 -1
- data/README.rdoc +9 -21
- data/Rakefile +20 -37
- data/_buildr +3 -12
- data/{doc/print.toc.yaml → _jbuildr} +14 -14
- data/addon/buildr/cobertura.rb +5 -219
- data/addon/buildr/drb.rb +281 -0
- data/addon/buildr/emma.rb +5 -221
- data/addon/buildr/nailgun.rb +93 -689
- data/bin/buildr +0 -9
- data/buildr.buildfile +4 -4
- data/buildr.gemspec +27 -21
- data/doc/_layouts/default.html +82 -0
- data/doc/_layouts/preface.html +22 -0
- data/doc/{pages/artifacts.textile → artifacts.textile} +82 -42
- data/doc/{pages/building.textile → building.textile} +89 -47
- data/doc/{pages/contributing.textile → contributing.textile} +53 -45
- data/doc/css/default.css +6 -5
- data/doc/css/print.css +17 -24
- data/doc/css/syntax.css +7 -36
- data/doc/download.textile +78 -0
- data/doc/{pages/extending.textile → extending.textile} +45 -24
- data/doc/{pages/getting_started.textile → getting_started.textile} +146 -88
- data/doc/images/asf-logo.gif +0 -0
- data/doc/images/note.png +0 -0
- data/doc/index.textile +47 -0
- data/doc/{pages/languages.textile → languages.textile} +108 -54
- data/doc/mailing_lists.textile +25 -0
- data/doc/{pages/more_stuff.textile → more_stuff.textile} +152 -73
- data/doc/{pages/packaging.textile → packaging.textile} +181 -96
- data/doc/preface.textile +28 -0
- data/doc/{pages/projects.textile → projects.textile} +55 -40
- data/doc/scripts/buildr-git.rb +364 -264
- data/doc/scripts/gitflow.rb +296 -0
- data/doc/scripts/install-jruby.sh +2 -2
- data/doc/scripts/install-linux.sh +6 -6
- data/doc/scripts/install-osx.sh +2 -2
- data/doc/{pages/settings_profiles.textile → settings_profiles.textile} +83 -45
- data/doc/{pages/testing.textile → testing.textile} +77 -41
- data/lib/buildr.rb +5 -5
- data/lib/buildr/core.rb +2 -0
- data/lib/buildr/core/application.rb +321 -151
- data/lib/buildr/core/build.rb +298 -167
- data/lib/buildr/core/checks.rb +4 -132
- data/lib/buildr/core/common.rb +1 -5
- data/lib/buildr/core/compile.rb +3 -9
- data/lib/buildr/core/environment.rb +12 -3
- data/lib/buildr/core/filter.rb +20 -18
- data/lib/buildr/core/generate.rb +36 -36
- data/lib/buildr/core/help.rb +2 -1
- data/lib/buildr/core/osx.rb +46 -0
- data/lib/buildr/core/progressbar.rb +1 -1
- data/lib/buildr/core/project.rb +7 -34
- data/lib/buildr/core/test.rb +12 -6
- data/lib/buildr/core/transports.rb +13 -11
- data/lib/buildr/core/util.rb +14 -23
- data/lib/buildr/groovy/bdd.rb +3 -2
- data/lib/buildr/groovy/compiler.rb +1 -1
- data/lib/buildr/ide/eclipse.rb +31 -21
- data/lib/buildr/ide/idea.rb +3 -2
- data/lib/buildr/ide/idea7x.rb +6 -4
- data/lib/buildr/java/ant.rb +3 -1
- data/lib/buildr/java/bdd.rb +9 -7
- data/lib/buildr/java/cobertura.rb +243 -0
- data/lib/buildr/java/compiler.rb +5 -4
- data/lib/buildr/java/emma.rb +244 -0
- data/lib/buildr/java/packaging.rb +11 -8
- data/lib/buildr/java/pom.rb +0 -4
- data/lib/buildr/java/rjb.rb +1 -1
- data/lib/buildr/java/test_result.rb +5 -7
- data/lib/buildr/java/tests.rb +17 -11
- data/lib/buildr/packaging.rb +5 -2
- data/lib/buildr/packaging/archive.rb +488 -0
- data/lib/buildr/packaging/artifact.rb +48 -29
- data/lib/buildr/packaging/artifact_namespace.rb +6 -6
- data/lib/buildr/packaging/gems.rb +4 -4
- data/lib/buildr/packaging/package.rb +3 -2
- data/lib/buildr/packaging/tar.rb +85 -3
- data/lib/buildr/packaging/version_requirement.rb +172 -0
- data/lib/buildr/packaging/zip.rb +24 -682
- data/lib/buildr/packaging/ziptask.rb +313 -0
- data/lib/buildr/scala.rb +5 -0
- data/lib/buildr/scala/bdd.rb +100 -0
- data/lib/buildr/scala/compiler.rb +45 -4
- data/lib/buildr/scala/tests.rb +12 -59
- data/rakelib/checks.rake +57 -0
- data/rakelib/doc.rake +58 -68
- data/rakelib/jekylltask.rb +110 -0
- data/rakelib/package.rake +35 -37
- data/rakelib/release.rake +119 -35
- data/rakelib/rspec.rake +29 -39
- data/rakelib/setup.rake +21 -59
- data/rakelib/stage.rake +184 -26
- data/spec/addon/drb_spec.rb +328 -0
- data/spec/core/application_spec.rb +32 -25
- data/spec/core/build_spec.rb +336 -126
- data/spec/core/checks_spec.rb +292 -310
- data/spec/core/common_spec.rb +8 -2
- data/spec/core/compile_spec.rb +17 -1
- data/spec/core/generate_spec.rb +3 -3
- data/spec/core/project_spec.rb +18 -10
- data/spec/core/test_spec.rb +8 -1
- data/spec/core/transport_spec.rb +40 -3
- data/spec/core/util_spec.rb +67 -0
- data/spec/ide/eclipse_spec.rb +96 -28
- data/spec/ide/idea7x_spec.rb +84 -0
- data/spec/java/ant.rb +5 -0
- data/spec/java/bdd_spec.rb +12 -3
- data/spec/{addon → java}/cobertura_spec.rb +6 -6
- data/spec/{addon → java}/emma_spec.rb +5 -6
- data/spec/java/java_spec.rb +12 -2
- data/spec/java/packaging_spec.rb +31 -2
- data/spec/{addon → java}/test_coverage_spec.rb +3 -3
- data/spec/java/tests_spec.rb +5 -0
- data/spec/packaging/archive_spec.rb +11 -1
- data/spec/{core → packaging}/artifact_namespace_spec.rb +10 -2
- data/spec/packaging/artifact_spec.rb +44 -3
- data/spec/packaging/packaging_spec.rb +1 -1
- data/spec/sandbox.rb +17 -14
- data/spec/scala/bdd_spec.rb +150 -0
- data/spec/scala/compiler_spec.rb +27 -0
- data/spec/scala/scala.rb +38 -0
- data/spec/scala/tests_spec.rb +78 -33
- data/spec/spec_helpers.rb +29 -5
- data/spec/version_requirement_spec.rb +6 -0
- metadata +175 -171
- data/DISCLAIMER +0 -7
- data/doc/images/apache-incubator-logo.png +0 -0
- data/doc/pages/download.textile +0 -51
- data/doc/pages/index.textile +0 -42
- data/doc/pages/mailing_lists.textile +0 -17
- data/doc/pages/recipes.textile +0 -103
- data/doc/pages/troubleshooting.textile +0 -103
- data/doc/pages/whats_new.textile +0 -323
- data/doc/print.haml +0 -51
- data/doc/site.haml +0 -56
- data/doc/site.toc.yaml +0 -47
- data/etc/git-svn-authors +0 -16
- data/lib/buildr/core/application_cli.rb +0 -139
- data/rakelib/apache.rake +0 -191
- data/rakelib/changelog.rake +0 -57
- data/rakelib/rubyforge.rake +0 -53
- data/rakelib/scm.rake +0 -49
data/doc/css/default.css
CHANGED
@@ -18,10 +18,9 @@
|
|
18
18
|
body {
|
19
19
|
background-color: #fff;
|
20
20
|
color: #000;
|
21
|
-
font-family: "DejaVu Sans", Verdana
|
21
|
+
font-family: "Helvetica Neue", "DejaVu Sans", "Verdana";
|
22
22
|
text-align: center;
|
23
23
|
line-height: 150%;
|
24
|
-
font-size: 12pt;
|
25
24
|
}
|
26
25
|
|
27
26
|
a:link, a:visited{
|
@@ -38,18 +37,20 @@ img {
|
|
38
37
|
}
|
39
38
|
|
40
39
|
pre, code {
|
41
|
-
font-family: "DejaVu Sans Mono", "Courier New", "Courier";
|
40
|
+
font-family: "Monaco", "DejaVu Sans Mono", "Courier New", "Courier";
|
42
41
|
font-size: 11pt;
|
43
42
|
}
|
44
43
|
pre {
|
45
44
|
margin: 0.3em 0 0.3em 0.9em;
|
46
45
|
padding: 0;
|
47
|
-
line-height:
|
46
|
+
line-height: 1.8em;
|
48
47
|
white-space: pre-wrap; /* css-3 */
|
49
48
|
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
50
49
|
}
|
50
|
+
pre br { display: none; }
|
51
51
|
|
52
52
|
h1, h2, h3 {
|
53
|
+
font-family: "Gill Sans";
|
53
54
|
padding: 0;
|
54
55
|
margin: 1.6em 0 0.6em -0.9em;
|
55
56
|
line-height: 1.25em;
|
@@ -137,7 +138,7 @@ th, thead td {
|
|
137
138
|
float: left;
|
138
139
|
text-align: left;
|
139
140
|
margin-right: 2em;
|
140
|
-
font-family: "
|
141
|
+
font-family: "Gill Sans";
|
141
142
|
font-size: 11pt;
|
142
143
|
text-align: right;
|
143
144
|
border-right: 1px solid #ccc;
|
data/doc/css/print.css
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
@page {
|
19
19
|
margin: 1in 0.75in 1in 0.75in;
|
20
20
|
@top-left, @top-right {
|
21
|
-
font-family: "Gill Sans"
|
21
|
+
font-family: "Gill Sans";
|
22
22
|
font-weight: normal;
|
23
23
|
}
|
24
24
|
}
|
@@ -39,8 +39,7 @@
|
|
39
39
|
title { string-set: doctitle content(); }
|
40
40
|
|
41
41
|
body {
|
42
|
-
font-family: "
|
43
|
-
font-size: 12pt;
|
42
|
+
font-family: "Helvetica Neue", "DejaVu Sans", "Verdana";
|
44
43
|
margin: 0;
|
45
44
|
color: black;
|
46
45
|
background: white;
|
@@ -51,8 +50,8 @@
|
|
51
50
|
page-break-before: always;
|
52
51
|
}
|
53
52
|
h1:first-child { page-break-before: avoid; }
|
54
|
-
h1, h2, h3
|
55
|
-
font-family: "Gill Sans"
|
53
|
+
h1, h2, h3 {
|
54
|
+
font-family: "Gill Sans";
|
56
55
|
}
|
57
56
|
pre, p, blockquote { page-break-inside: avoid; }
|
58
57
|
pre, code {
|
@@ -63,7 +62,9 @@
|
|
63
62
|
background: transparent;
|
64
63
|
text-decoration: none;
|
65
64
|
}
|
66
|
-
|
65
|
+
|
66
|
+
#header, #pages, #footer { display: none }
|
67
|
+
#wrap, #content {
|
67
68
|
float: none !important;
|
68
69
|
color: black;
|
69
70
|
background: transparent;
|
@@ -73,28 +74,20 @@
|
|
73
74
|
border: 0;
|
74
75
|
}
|
75
76
|
|
76
|
-
#header {
|
77
|
-
margin-bottom: 5%;
|
78
|
-
font-size: 120%;
|
79
|
-
}
|
80
|
-
#header img { width: 4in; }
|
81
|
-
#header .tagline {
|
82
|
-
float: none !important;
|
83
|
-
position: static !important;
|
84
|
-
font-size: 1.2em;
|
85
|
-
text-align: center;
|
86
|
-
}
|
87
|
-
|
88
|
-
#pages, .noprint { display: none; }
|
89
|
-
|
90
77
|
ol.toc a:link, ol.toc a:visited { text-decoration: none; }
|
91
78
|
ol.toc a:after { content: leader('.') target-counter(attr(href), page); }
|
92
79
|
|
93
|
-
|
94
|
-
|
95
|
-
|
80
|
+
.title {
|
81
|
+
page-break-before: always;
|
82
|
+
border: none;
|
83
|
+
}
|
84
|
+
.title img {
|
85
|
+
width: 20em;
|
86
|
+
margin: 2em auto 2em auto;
|
87
|
+
}
|
88
|
+
p.preface {
|
96
89
|
page-break-before: always;
|
97
|
-
padding-top:
|
90
|
+
padding-top: 2.5in;
|
98
91
|
}
|
99
92
|
|
100
93
|
}
|
data/doc/css/syntax.css
CHANGED
@@ -14,39 +14,10 @@
|
|
14
14
|
* under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
|
18
|
-
.
|
19
|
-
.
|
20
|
-
.
|
21
|
-
.
|
22
|
-
.
|
23
|
-
.
|
24
|
-
.ruby .char { }
|
25
|
-
.ruby .ident { color: black; }
|
26
|
-
.ruby .constant, ruby .class, ruby .module { color: darkblue; }
|
27
|
-
.ruby .number { color: blue; }
|
28
|
-
.ruby .attribute { }
|
29
|
-
.ruby .global { }
|
30
|
-
.ruby .expr { }
|
31
|
-
.ruby .escape { }
|
32
|
-
|
33
|
-
.xml .normal {}
|
34
|
-
.xml .namespace { color: darkblue; }
|
35
|
-
.xml .tag { color: blue; }
|
36
|
-
.xml .comment { color: gray; }
|
37
|
-
.xml .punct { color: darkblue; }
|
38
|
-
.xml .string { }
|
39
|
-
.xml .number { }
|
40
|
-
.xml .attribute { color: blue; }
|
41
|
-
|
42
|
-
.yaml .document { }
|
43
|
-
.yaml .type { }
|
44
|
-
.yaml .key { color: blue; }
|
45
|
-
.yaml .comment { color: gray; }
|
46
|
-
.yaml .punct { color: darkblue; }
|
47
|
-
.yaml .string { }
|
48
|
-
.yaml .number { }
|
49
|
-
.yaml .time { }
|
50
|
-
.yaml .date { }
|
51
|
-
.yaml .ref { color: green; }
|
52
|
-
.yaml .anchor { color: green; }
|
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,78 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Download
|
4
|
+
---
|
5
|
+
|
6
|
+
|
7
|
+
h2(#install). Installing Buildr
|
8
|
+
|
9
|
+
*The easy way:* The "Getting Started guide":getting_started.html will show you how to install Buildr 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-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
|
+
| "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
|
+
| "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 |
|
29
|
+
|
30
|
+
p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.3.4/KEYS)
|
31
|
+
|
32
|
+
|
33
|
+
h3. buildr 1.3.3-incubating (2008-10-08)
|
34
|
+
|
35
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
36
|
+
| "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 |
|
37
|
+
| "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 |
|
38
|
+
| "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 |
|
39
|
+
| "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 |
|
40
|
+
|
41
|
+
p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.3-incubating/KEYS)
|
42
|
+
|
43
|
+
|
44
|
+
h3. buildr 1.3.2-incubating (2008-07-18)
|
45
|
+
|
46
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
47
|
+
| "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 |
|
48
|
+
| "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 |
|
49
|
+
| "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 |
|
50
|
+
| "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 |
|
51
|
+
|
52
|
+
p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.2-incubating/KEYS)
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
h3. buildr 1.3.1-incubating (2008-05-19)
|
57
|
+
|
58
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
59
|
+
| "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 |
|
60
|
+
| "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 |
|
61
|
+
| "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 |
|
62
|
+
| "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 |
|
63
|
+
|
64
|
+
p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.1-incubating/KEYS)
|
65
|
+
|
66
|
+
|
67
|
+
h3. buildr 1.3.0-incubating (2008-05-01)
|
68
|
+
|
69
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
70
|
+
| "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 |
|
71
|
+
| "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 |
|
72
|
+
| "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 |
|
73
|
+
| "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 |
|
74
|
+
|
75
|
+
p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.3.0-incubating/KEYS)
|
76
|
+
|
77
|
+
|
78
|
+
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.
|
@@ -1,6 +1,9 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Extending Buildr
|
4
|
+
---
|
2
5
|
|
3
|
-
h2. Organizing Tasks
|
6
|
+
h2(#tasks). Organizing Tasks
|
4
7
|
|
5
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.
|
6
9
|
|
@@ -8,7 +11,8 @@ For example, we use OpenJPA in several projects. It's a very short task, but ea
|
|
8
11
|
|
9
12
|
Compare this:
|
10
13
|
|
11
|
-
|
14
|
+
<notextile>
|
15
|
+
{% highlight ruby %}
|
12
16
|
file('derby.sql') do
|
13
17
|
REQUIRES = [
|
14
18
|
'org.apache.openjpa:openjpa-all:jar:0.9.7-incubating',
|
@@ -21,23 +25,26 @@ file('derby.sql') do
|
|
21
25
|
:classpath=>REQUIRES.join(File::PATH_SEPARATOR)
|
22
26
|
ant.mapping :schemaAction=>'build', :sqlFile=>task.name,
|
23
27
|
:ignoreErrors=>true do
|
24
|
-
ant.config :propertiesFile=>_(
|
28
|
+
ant.config :propertiesFile=>_('src/main/sql/derby.xml')
|
25
29
|
ant.classpath :path=>projects('store', 'utils' ).
|
26
30
|
flatten.map(&:to_s).join(File::PATH_SEPARATOR)
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
30
|
-
}
|
34
|
+
{% endhighlight %}
|
35
|
+
</notextile>
|
31
36
|
|
32
37
|
To this:
|
33
38
|
|
34
|
-
|
39
|
+
<notextile>
|
40
|
+
{% highlight ruby %}
|
35
41
|
file('derby.sql') do
|
36
42
|
mapping_tool :action=>'build', :sql=>task.name,
|
37
|
-
:properties=>_(
|
43
|
+
:properties=>_('src/main/sql/derby.xml'),
|
38
44
|
:classpath=>projects('store', 'utils')
|
39
45
|
end
|
40
|
-
}
|
46
|
+
{% endhighlight %}
|
47
|
+
</notextile>
|
41
48
|
|
42
49
|
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.
|
43
50
|
|
@@ -48,25 +55,29 @@ If you want to share these pre-canned definitions between projects, you have a f
|
|
48
55
|
For individual task files, you can also use "Sake":http://errtheblog.com/post/6069 for system-wide Rake tasks deployment.
|
49
56
|
|
50
57
|
|
51
|
-
h2. Creating Extensions
|
58
|
+
h2(#extensions). Creating Extensions
|
52
59
|
|
53
60
|
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.
|
54
61
|
|
55
62
|
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:
|
56
63
|
|
57
|
-
|
64
|
+
<notextile>
|
65
|
+
{% highlight ruby %}
|
58
66
|
class Project
|
59
67
|
include MyExtension
|
60
68
|
end
|
61
|
-
}
|
69
|
+
{% endhighlight %}
|
70
|
+
</notextile>
|
62
71
|
|
63
72
|
You can also extend a given project instance and only that instance by extending it with the module:
|
64
73
|
|
65
|
-
|
74
|
+
<notextile>
|
75
|
+
{% highlight ruby %}
|
66
76
|
define 'foo' do
|
67
77
|
extend MyExtension
|
68
78
|
end
|
69
|
-
}
|
79
|
+
{% endhighlight %}
|
80
|
+
</notextile>
|
70
81
|
|
71
82
|
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.
|
72
83
|
|
@@ -79,7 +90,8 @@ The easiest way to add callbacks is by incorporating the Extension module in you
|
|
79
90
|
|
80
91
|
This example illustrates how to write a simple extension:
|
81
92
|
|
82
|
-
|
93
|
+
<notextile>
|
94
|
+
{% highlight ruby %}
|
83
95
|
module LinesOfCode
|
84
96
|
include Extension
|
85
97
|
|
@@ -114,35 +126,42 @@ end
|
|
114
126
|
class Buildr::Project
|
115
127
|
include LinesOfCode
|
116
128
|
end
|
117
|
-
}
|
129
|
+
{% endhighlight %}
|
130
|
+
</notextile>
|
118
131
|
|
119
132
|
|
120
|
-
h2. Using Alternative Layouts
|
133
|
+
h2(#layouts). Using Alternative Layouts
|
121
134
|
|
122
135
|
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.
|
123
136
|
|
124
137
|
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:
|
125
138
|
|
126
|
-
|
139
|
+
<notextile>
|
140
|
+
{% highlight ruby %}
|
127
141
|
define 'foo', :layout=>my_layout do
|
128
142
|
...
|
129
143
|
end
|
130
|
-
}
|
144
|
+
{% endhighlight %}
|
145
|
+
</notextile>
|
131
146
|
|
132
147
|
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:
|
133
148
|
|
134
|
-
|
149
|
+
<notextile>
|
150
|
+
{% highlight ruby %}
|
135
151
|
my_layout = Layout.new
|
136
152
|
my_layout[:source, :main, :java] = 'java'
|
137
153
|
my_layout[:source, :main, :resources] = 'resources'
|
138
|
-
}
|
154
|
+
{% endhighlight %}
|
155
|
+
</notextile>
|
139
156
|
|
140
157
|
Partial expansion also works, so you can specify the above layout using:
|
141
158
|
|
142
|
-
|
159
|
+
<notextile>
|
160
|
+
{% highlight ruby %}
|
143
161
|
my_layout = Layout.new
|
144
162
|
my_layout[:source, :main] = ''
|
145
|
-
}
|
163
|
+
{% endhighlight %}
|
164
|
+
</notextile>
|
146
165
|
|
147
166
|
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.
|
148
167
|
|
@@ -158,7 +177,8 @@ The built-in tasks expand lists of symbols into relative paths, using the follow
|
|
158
177
|
|
159
178
|
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:
|
160
179
|
|
161
|
-
|
180
|
+
<notextile>
|
181
|
+
{% highlight ruby %}
|
162
182
|
define 'bad' do
|
163
183
|
# This may not be the real target.
|
164
184
|
puts 'Compiling to ' + path_to('target/classes')
|
@@ -172,4 +192,5 @@ define 'good' do
|
|
172
192
|
# This will work with different layouts.
|
173
193
|
package(:jar).include path_to(:source, :main, :etc, '*')
|
174
194
|
end
|
175
|
-
}
|
195
|
+
{% endhighlight %}
|
196
|
+
</notextile>
|
@@ -1,143 +1,194 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Getting Started
|
4
|
+
---
|
2
5
|
|
3
|
-
h2. Installing Buildr
|
4
6
|
|
5
|
-
The
|
7
|
+
*The easy way:* We recommend you pick the platform you want to run Buildr on and then follow the _easy way_ instructions for that platform. It could save you an hour or two struggling to install all the right dependencies.
|
6
8
|
|
7
|
-
|
9
|
+
"Installing Buildr for JRuby":#jruby is the same on all operating systems. Choose JRuby if you're working with Java 6 on OS X, developing with multiple JDKs, or just like JRuby better.
|
8
10
|
|
9
|
-
|
11
|
+
If you are running behind a proxy server, make sure the environment variable @HTTP_PROXY@ is set, as many of these steps require HTTP access.
|
10
12
|
|
13
|
+
<br>
|
11
14
|
|
12
|
-
|
15
|
+
*In details:* The @gem install@ and @gem update@ commands install Buildr from a binary distribution provided through "RubyForge":http://rubyforge.org/projects/buildr. This distribution is maintained by contributors to this project, but is *not* an official Apache distribution. You can obtain the official Apache distribution files from the "download page":download.html.
|
13
16
|
|
14
|
-
|
17
|
+
Older versions of RubyGems are all kind of fail. You want to avoid these unless you have the patience to install each Buildr dependency manually. Get RubyGems 1.3.1 or later, and when using Debian packages (e.g. Ubuntu), make sure to get the unmolested RubyGems straight form the source.
|
18
|
+
|
19
|
+
The Ruby interpreter and JVM must use compatible architectures. For example, OS X comes with 32-bit version of Ruby, Java 1.5 in both 32-bit and 64-bit flavors, and 64-bit Java 6. As a result you can run Ruby with Java 1.5 (32-bit), but to use Java 6 you either need to build Ruby from source for 64-bit, or use "Buildr for JRuby":#jruby.
|
20
|
+
|
21
|
+
h2(#linux). Installing on Linux
|
22
|
+
|
23
|
+
*The easy way:* Use this bash script to "install Buildr on Linux":scripts/install-linux.sh. This script will install the most recent version of Buildr, or if already installed, upgrade to the most recent version. It will also install Ruby 1.8.6 if not already installed (requires @apt-get@ or @yum@) and upgrade to RubyGems 1.3.1 or later.
|
24
|
+
|
25
|
+
p(note). At this time, the native Ruby-Java Bridge (RJB) does not work very well on Linux with JDK 1.6. If you get Segmentation Fault errors with JDK 1.6, we recommend switching to JDK 1.5.
|
26
|
+
|
27
|
+
<br>
|
28
|
+
|
29
|
+
*In details:* To get started you will need a recent version of Ruby, Ruby Gems and build tools for compiling native libraries (@make@, @gcc@ and standard headers).
|
15
30
|
|
16
31
|
On *RedHat/Fedora* you can use yum to install Ruby and RubyGems, and then upgrade to the most recent version of RubyGems:
|
17
32
|
|
18
|
-
|
33
|
+
<notextile>
|
34
|
+
{% highlight sh %}
|
19
35
|
$ sudo yum install ruby rubygems ruby-devel gcc
|
20
36
|
$ sudo gem update --system
|
21
|
-
}
|
37
|
+
{% endhighlight %}
|
38
|
+
</notextile>
|
22
39
|
|
23
40
|
On *Ubuntu* you have to install several packages:
|
24
41
|
|
25
|
-
|
42
|
+
<notextile>
|
43
|
+
{% highlight sh %}
|
26
44
|
$ sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential
|
27
|
-
}
|
45
|
+
{% endhighlight %}
|
46
|
+
</notextile>
|
28
47
|
|
29
48
|
The Debian package for @rubygems@ will not allow you to install Buildr, so you need to install RubyGems from source:
|
30
49
|
|
31
|
-
|
32
|
-
|
33
|
-
$
|
34
|
-
$
|
50
|
+
<notextile>
|
51
|
+
{% highlight sh %}
|
52
|
+
$ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
|
53
|
+
$ tar xzf rubygems-1.3.1.tgz
|
54
|
+
$ cd rubygems-1.3.1
|
35
55
|
$ sudo ruby setup.rb
|
36
56
|
$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
|
37
|
-
}
|
57
|
+
{% endhighlight %}
|
58
|
+
</notextile>
|
38
59
|
|
39
60
|
Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
|
40
61
|
|
41
|
-
|
62
|
+
<notextile>
|
63
|
+
{% highlight sh %}
|
42
64
|
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
43
|
-
}
|
65
|
+
{% endhighlight %}
|
66
|
+
</notextile>
|
44
67
|
|
45
68
|
To upgrade to a new version or install a specific version:
|
46
69
|
|
47
|
-
|
70
|
+
<notextile>
|
71
|
+
{% highlight sh %}
|
48
72
|
$ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
|
49
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.
|
50
|
-
}
|
73
|
+
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.4
|
74
|
+
{% endhighlight %}
|
75
|
+
</notextile>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
h2(#osx). Installing on OS X
|
51
80
|
|
52
|
-
|
81
|
+
*The easy way:* Use this script to "install Buildr on OS X":scripts/install-osx.sh. This script will install the most recent version of Buildr, or if already installed, upgrade to the most recent version. It will also install Ruby 1.8.6 if not already installed (using MacPorts/Fink) and upgrage RubyGems to 1.3.1 or later.
|
53
82
|
|
83
|
+
<br>
|
54
84
|
|
55
|
-
|
85
|
+
*In details:* OS X 10.5 (Leopard) comes with a recent version of Ruby 1.8.6. You do not need to install a different version of Ruby when running OS X 10.5.
|
56
86
|
|
57
|
-
OS X 10.
|
87
|
+
OS X 10.4 (Tiger) includes an older version of Ruby that is not compatible with Buildr. You can install Ruby 1.8.6 using MacPorts (@sudo port install ruby rb-rubygems@), Fink or the "Ruby One-Click Installer for OS X":http://rubyosx.rubyforge.org/.
|
58
88
|
|
59
89
|
We recommend you first upgrade to the latest version of Ruby gems:
|
60
90
|
|
61
|
-
|
91
|
+
<notextile>
|
92
|
+
{% highlight sh %}
|
62
93
|
$ sudo gem update --system
|
63
|
-
}
|
94
|
+
{% endhighlight %}
|
95
|
+
</notextile>
|
64
96
|
|
65
97
|
Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution:
|
66
98
|
|
67
|
-
|
99
|
+
<notextile>
|
100
|
+
{% highlight sh %}
|
68
101
|
$ export JAVA_HOME=/Library/Java/Home
|
69
|
-
}
|
102
|
+
{% endhighlight %}
|
103
|
+
</notextile>
|
70
104
|
|
71
105
|
To install Buildr:
|
72
106
|
|
73
|
-
|
107
|
+
<notextile>
|
108
|
+
{% highlight sh %}
|
74
109
|
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
75
|
-
}
|
110
|
+
{% endhighlight %}
|
111
|
+
</notextile>
|
76
112
|
|
77
113
|
To upgrade to a new version or install a specific version:
|
78
114
|
|
79
|
-
|
115
|
+
<notextile>
|
116
|
+
{% highlight sh %}
|
80
117
|
$ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
|
81
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.
|
82
|
-
}
|
118
|
+
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.4
|
119
|
+
{% endhighlight %}
|
120
|
+
</notextile>
|
83
121
|
|
84
|
-
You can also use this script "to install Buildr on OS X":scripts/install-osx.sh. This script will install Buildr or if already installed, upgrade to a more recent version. It will also install Ruby 1.8.6 if not already installed (using MacPorts) and upgrage RubyGems to 1.0.1.
|
85
122
|
|
123
|
+
h2(#windows). Installing on Windows
|
86
124
|
|
87
|
-
|
125
|
+
*The easy way:* The easiest way to install Ruby is using the "one-click installer":http://rubyinstaller.rubyforge.org/. Once installed, set the @JAVA_HOME@ environment variable and run @gem install buildr@.
|
88
126
|
|
89
|
-
|
127
|
+
<br>
|
90
128
|
|
91
|
-
We recommend you first upgrade to the latest version of Ruby gems:
|
129
|
+
*In details:* We recommend you first upgrade to the latest version of Ruby gems:
|
92
130
|
|
93
|
-
|
131
|
+
<notextile>
|
132
|
+
{% highlight sh %}
|
94
133
|
> gem update --system
|
95
|
-
}
|
134
|
+
{% endhighlight %}
|
135
|
+
</notextile>
|
96
136
|
|
97
137
|
Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
|
98
138
|
|
99
|
-
|
139
|
+
<notextile>
|
140
|
+
{% highlight sh %}
|
100
141
|
> gem install buildr
|
101
|
-
}
|
102
|
-
|
103
|
-
Buildr uses several libraries that include native extensions. During installation it will ask you to pick a platform for these libraries. By selecting @mswin32@ it will download and install pre-compiled DLLs for these extensions.
|
142
|
+
{% endhighlight %}
|
143
|
+
</notextile>
|
104
144
|
|
105
145
|
To upgrade to a new version or install a specific version:
|
106
146
|
|
107
|
-
|
147
|
+
<notextile>
|
148
|
+
{% highlight sh %}
|
108
149
|
> gem update buildr
|
109
|
-
> gem install buildr -v 1.3.
|
110
|
-
}
|
150
|
+
> gem install buildr -v 1.3.4
|
151
|
+
{% endhighlight %}
|
152
|
+
</notextile>
|
153
|
+
|
154
|
+
|
155
|
+
h2(#jruby). Installing for JRuby
|
111
156
|
|
157
|
+
*The easy way:* Use this bash script to "install Buildr on JRuby":scripts/install-jruby.sh. This script will install the most recent version of Buildr, or if already installed, upgrade to the most recent version. If necessary, it will also install JRuby 1.1.6 in @/opt/jruby@ and update the @PATH@ variable in @~/.bash_profile@ or @~/.profile@.
|
112
158
|
|
113
|
-
|
159
|
+
<br>
|
114
160
|
|
115
|
-
If you don't already have JRuby 1.1 or later installed, you can download it from the "JRuby site":http://dist.codehaus.org/jruby/.
|
161
|
+
*In details:* If you don't already have JRuby 1.1.6 or later installed, you can download it from the "JRuby site":http://dist.codehaus.org/jruby/.
|
116
162
|
|
117
163
|
After uncompressing JRuby, update your @PATH@ to include both @java@ and @jruby@ executables.
|
118
164
|
|
119
165
|
For Linux and OS X:
|
120
166
|
|
121
|
-
|
167
|
+
<notextile>
|
168
|
+
{% highlight sh %}
|
122
169
|
$ export PATH=$PATH:[path to JRuby]/bin:$JAVA_HOME/bin
|
123
170
|
$ jruby -S gem install buildr
|
124
|
-
}
|
171
|
+
{% endhighlight %}
|
172
|
+
</notextile>
|
125
173
|
|
126
174
|
For Windows:
|
127
175
|
|
128
|
-
|
176
|
+
<notextile>
|
177
|
+
{% highlight sh %}
|
129
178
|
> set PATH=%PATH%;[path to JRuby]/bin;%JAVA_HOME%/bin
|
130
179
|
> jruby -S gem install buildr
|
131
|
-
}
|
180
|
+
{% endhighlight %}
|
181
|
+
</notextile>
|
132
182
|
|
133
183
|
To upgrade to a new version or install a specific version:
|
134
184
|
|
135
|
-
|
185
|
+
<notextile>
|
186
|
+
{% highlight sh %}
|
136
187
|
$ jruby -S gem update buildr
|
137
|
-
$ jruby -S gem install buildr -v 1.3.
|
138
|
-
}
|
188
|
+
$ jruby -S gem install buildr -v 1.3.4
|
189
|
+
{% endhighlight %}
|
190
|
+
</notextile>
|
139
191
|
|
140
|
-
You can also use this script "to install Buildr on JRuby":scripts/install-jruby.sh. This script will install Buildr or if already installed, upgrade to a more recent version. If necessary, it will also install JRuby 1.1 in @/opt/jruby@ and update the @PATH@ variable in @~/.bash_profile@ or @~/.profile@.
|
141
192
|
|
142
193
|
*Important: Running JRuby and Ruby side by side*
|
143
194
|
|
@@ -149,59 +200,58 @@ To work exclusively with JRuby, make sure it shows first on the path, for exampl
|
|
149
200
|
|
150
201
|
You can use JRuby and Ruby side by side, by running scripts with the @-S@ command line argument. For example:
|
151
202
|
|
152
|
-
|
203
|
+
<notextile>
|
204
|
+
{% highlight sh %}
|
153
205
|
$ # with Ruby
|
154
206
|
$ ruby -S gem install buildr
|
155
207
|
$ ruby -S buildr
|
156
208
|
$ # with JRuby
|
157
209
|
$ jruby -S gem install buildr
|
158
210
|
$ jruby -S buildr
|
159
|
-
}
|
211
|
+
{% endhighlight %}
|
212
|
+
</notextile>
|
160
213
|
|
161
214
|
Run @buildr --version@ from the command line to find which version of Buildr you are using by default. If you see @(JRuby ...)@, Buildr is running on that version of JRuby.
|
162
215
|
|
163
216
|
|
164
|
-
h2. Document Conventions
|
217
|
+
h2(#conventions). Document Conventions
|
165
218
|
|
166
219
|
Lines that start with @$@ are command lines, for example:
|
167
220
|
|
168
|
-
|
221
|
+
<notextile>
|
222
|
+
{% highlight sh %}
|
169
223
|
$ # Run Buildr
|
170
224
|
$ buildr
|
171
|
-
}
|
225
|
+
{% endhighlight %}
|
226
|
+
</notextile>
|
172
227
|
|
173
228
|
Lines that start with @=>@ show output from the console or the result of a method, for example:
|
174
229
|
|
175
|
-
|
230
|
+
<notextile>
|
231
|
+
{% highlight sh %}
|
176
232
|
puts 'Hello world'
|
177
233
|
=> "Hello world"
|
178
|
-
}
|
234
|
+
{% endhighlight %}
|
235
|
+
</notextile>
|
179
236
|
|
180
237
|
And as you guessed, everything else is Buildfile Ruby or Java code. You can figure out which language is which.
|
181
238
|
|
182
239
|
|
240
|
+
h2(#running). Running Buildr
|
183
241
|
|
184
|
-
|
185
|
-
|
186
|
-
You need a *Buildfile*, a build script that tells Buildr all about the projects it's building, what they contain, what to produce, and so on. The Buildfile resides in the root directory of your project. We'll talk more about it in "the next chapter":projects.html. If you don't already have one, ask Buildr to create it:
|
187
|
-
|
188
|
-
{{{!sh
|
189
|
-
$ buildr
|
190
|
-
}}}
|
242
|
+
You need a *Buildfile*, a build script that tells Buildr all about the projects it's building, what they contain, what to produce, and so on. The Buildfile resides in the root directory of your project. We'll talk more about it in "the next chapter":projects.html. If you don't already have one, ask Buildr to create it by running @buildr@.
|
191
243
|
|
192
244
|
p(tip). You'll notice that Buildr creates a file called @buildfile@. It's case sensitive, but Buildr will look for either @buildfile@ or @Buildfile@.
|
193
245
|
|
194
246
|
You use Buildr by running the @buildr@ command:
|
195
247
|
|
196
|
-
|
248
|
+
<notextile>
|
249
|
+
{% highlight sh %}
|
197
250
|
$ buildr [options] [tasks] [name=value]
|
198
|
-
}
|
199
|
-
|
200
|
-
There are several options you can use, for a full list of options type:
|
251
|
+
{% endhighlight %}
|
252
|
+
</notextile>
|
201
253
|
|
202
|
-
|
203
|
-
$ buildr --help
|
204
|
-
}}}
|
254
|
+
There are several options you can use, for a full list of options type @buildr --help@:
|
205
255
|
|
206
256
|
|_. Option |_. Usage |
|
207
257
|
| @-f/--buildfile [file]@ | Specify the buildfile. |
|
@@ -216,51 +266,59 @@ $ buildr --help
|
|
216
266
|
|
217
267
|
You can tell Buildr to run specific tasks and the order to run them. For example:
|
218
268
|
|
219
|
-
|
269
|
+
<notextile>
|
270
|
+
{% highlight sh %}
|
220
271
|
# Clean and rebuild
|
221
272
|
buildr clean build
|
222
273
|
# Package and install
|
223
274
|
buildr install
|
224
|
-
}
|
275
|
+
{% endhighlight %}
|
276
|
+
</notextile>
|
225
277
|
|
226
278
|
If you don't specify a task, Buildr will run the "@build@ task":building.html, compiling source code and running test cases. Running a task may run other tasks as well, for example, running the @install@ task will also run @package@.
|
227
279
|
|
228
|
-
There are several "environment variables":settings_profiles.html#
|
280
|
+
There are several "environment variables":settings_profiles.html#env_vars that let you control how Buildr works, for example, to skip test cases during a build, or specify options for the JVM. Depending on the variable, you may want to set it once in your environment, or set a different value each time you run Buildr.
|
229
281
|
|
230
282
|
For example:
|
231
283
|
|
232
|
-
|
284
|
+
<notextile>
|
285
|
+
{% highlight sh %}
|
233
286
|
$ export JAVA_OPTS='-Xms1g -Xmx1g'
|
234
287
|
$ buildr TEST=no
|
235
|
-
}
|
288
|
+
{% endhighlight %}
|
289
|
+
</notextile>
|
236
290
|
|
237
291
|
|
238
|
-
h2. Help Tasks
|
292
|
+
h2(#help). Help Tasks
|
239
293
|
|
240
294
|
Buildr includes a number of informative tasks. Currently that number stands at two, but we'll be adding more tasks in future releases. These tasks report information from the Buildfile, so you need one to run them. For more general help (version number, command line arguments, etc) use @buildr --help@.
|
241
295
|
|
242
296
|
To start with, type:
|
243
297
|
|
244
|
-
|
298
|
+
<notextile>
|
299
|
+
{% highlight sh %}
|
245
300
|
$ buildr help
|
246
|
-
}
|
301
|
+
{% endhighlight %}
|
302
|
+
</notextile>
|
247
303
|
|
248
304
|
You can list the name and description of all your projects using the @help:projects@ task. For example:
|
249
305
|
|
250
|
-
|
306
|
+
<notextile>
|
307
|
+
{% highlight sh %}
|
251
308
|
$ buildr help:projects
|
252
309
|
killer-app # Code. Build. ??? Profit!
|
253
310
|
killer-app:teh-api # Abstract classes and interfaces
|
254
311
|
killer-app:teh-impl # All those implementation details
|
255
312
|
killer-app:la-web # What our users see
|
256
|
-
}
|
313
|
+
{% endhighlight %}
|
314
|
+
</notextile>
|
257
315
|
|
258
316
|
You are, of course, describing your projects for the sake of those who will maintain your code, right? To describe a project, or a task, call the @desc@ method before the project or task definition.
|
259
317
|
|
260
318
|
So next let's talk about "projects":projects.html.
|
261
319
|
|
262
320
|
|
263
|
-
h2. Learning More
|
321
|
+
h2(#more). Learning More
|
264
322
|
|
265
323
|
*Ruby* It pays to pick up Ruby as a second (or first) programming language. It's fun, powerful and slightly addictive. If you're interested in learning Ruby the language, a good place to start is "Programming Ruby: The Pragmatic Programmer's Guide":http://www.pragprog.com/titles/ruby/programming-ruby, fondly known as the _Pickaxe book_.
|
266
324
|
|