buildr 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +66 -4
- data/{README → README.rdoc} +29 -16
- data/Rakefile +16 -20
- data/_buildr +38 -0
- data/addon/buildr/cobertura.rb +49 -45
- data/addon/buildr/emma.rb +238 -0
- data/addon/buildr/jetty.rb +1 -1
- data/addon/buildr/nailgun.rb +585 -661
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail$Main.class +0 -0
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.class +0 -0
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.java +0 -0
- data/bin/buildr +9 -2
- data/buildr.buildfile +53 -0
- data/buildr.gemspec +21 -14
- data/doc/css/default.css +51 -48
- data/doc/css/print.css +60 -55
- data/doc/images/favicon.png +0 -0
- data/doc/images/growl-icon.tiff +0 -0
- data/doc/images/project-structure.png +0 -0
- data/doc/pages/artifacts.textile +46 -156
- data/doc/pages/building.textile +63 -323
- data/doc/pages/contributing.textile +112 -102
- data/doc/pages/download.textile +19 -27
- data/doc/pages/extending.textile +27 -81
- data/doc/pages/getting_started.textile +44 -119
- data/doc/pages/index.textile +26 -47
- data/doc/pages/languages.textile +407 -0
- data/doc/pages/more_stuff.textile +92 -173
- data/doc/pages/packaging.textile +71 -239
- data/doc/pages/projects.textile +58 -233
- data/doc/pages/recipes.textile +19 -43
- data/doc/pages/settings_profiles.textile +39 -104
- data/doc/pages/testing.textile +41 -304
- data/doc/pages/troubleshooting.textile +29 -47
- data/doc/pages/whats_new.textile +69 -167
- data/doc/print.haml +0 -1
- data/doc/print.toc.yaml +1 -0
- data/doc/scripts/buildr-git.rb +1 -1
- data/doc/site.haml +1 -0
- data/doc/site.toc.yaml +8 -5
- data/{KEYS → etc/KEYS} +0 -0
- data/etc/git-svn-authors +16 -0
- data/lib/buildr.rb +2 -5
- data/lib/buildr/core/application.rb +192 -98
- data/lib/buildr/core/build.rb +140 -91
- data/lib/buildr/core/checks.rb +5 -5
- data/lib/buildr/core/common.rb +1 -1
- data/lib/buildr/core/compile.rb +12 -10
- data/lib/buildr/core/filter.rb +151 -46
- data/lib/buildr/core/generate.rb +9 -9
- data/lib/buildr/core/progressbar.rb +1 -1
- data/lib/buildr/core/project.rb +8 -7
- data/lib/buildr/core/test.rb +51 -26
- data/lib/buildr/core/transports.rb +22 -38
- data/lib/buildr/core/util.rb +78 -26
- data/lib/buildr/groovy.rb +18 -0
- data/lib/buildr/groovy/bdd.rb +105 -0
- data/lib/buildr/groovy/compiler.rb +138 -0
- data/lib/buildr/ide/eclipse.rb +102 -71
- data/lib/buildr/ide/idea.rb +7 -12
- data/lib/buildr/ide/idea7x.rb +7 -8
- data/lib/buildr/java.rb +4 -7
- data/lib/buildr/java/ant.rb +26 -5
- data/lib/buildr/java/bdd.rb +449 -0
- data/lib/buildr/java/commands.rb +9 -9
- data/lib/buildr/java/{compilers.rb → compiler.rb} +8 -90
- data/lib/buildr/java/jruby.rb +29 -11
- data/lib/buildr/java/jtestr_runner.rb.erb +116 -0
- data/lib/buildr/java/packaging.rb +23 -16
- data/lib/buildr/java/pom.rb +1 -1
- data/lib/buildr/java/rjb.rb +21 -8
- data/lib/buildr/java/test_result.rb +308 -0
- data/lib/buildr/java/tests.rb +324 -0
- data/lib/buildr/packaging/artifact.rb +12 -11
- data/lib/buildr/packaging/artifact_namespace.rb +7 -4
- data/lib/buildr/packaging/gems.rb +3 -3
- data/lib/buildr/packaging/zip.rb +13 -10
- data/lib/buildr/resources/buildr.icns +0 -0
- data/lib/buildr/scala.rb +19 -0
- data/lib/buildr/scala/compiler.rb +109 -0
- data/lib/buildr/scala/tests.rb +203 -0
- data/rakelib/apache.rake +71 -45
- data/rakelib/doc.rake +2 -2
- data/rakelib/package.rake +3 -2
- data/rakelib/rspec.rake +23 -21
- data/rakelib/setup.rake +34 -9
- data/rakelib/stage.rake +4 -1
- data/spec/addon/cobertura_spec.rb +77 -0
- data/spec/addon/emma_spec.rb +120 -0
- data/spec/addon/test_coverage_spec.rb +255 -0
- data/spec/{application_spec.rb → core/application_spec.rb} +82 -4
- data/spec/{artifact_namespace_spec.rb → core/artifact_namespace_spec.rb} +12 -1
- data/spec/core/build_spec.rb +415 -0
- data/spec/{checks_spec.rb → core/checks_spec.rb} +2 -2
- data/spec/{common_spec.rb → core/common_spec.rb} +119 -30
- data/spec/{compile_spec.rb → core/compile_spec.rb} +17 -13
- data/spec/core/generate_spec.rb +33 -0
- data/spec/{project_spec.rb → core/project_spec.rb} +9 -6
- data/spec/{test_spec.rb → core/test_spec.rb} +222 -28
- data/spec/{transport_spec.rb → core/transport_spec.rb} +5 -9
- data/spec/groovy/bdd_spec.rb +80 -0
- data/spec/{groovy_compilers_spec.rb → groovy/compiler_spec.rb} +1 -1
- data/spec/ide/eclipse_spec.rb +243 -0
- data/spec/{java_spec.rb → java/ant.rb} +7 -17
- data/spec/java/bdd_spec.rb +358 -0
- data/spec/{java_compilers_spec.rb → java/compiler_spec.rb} +1 -1
- data/spec/java/java_spec.rb +88 -0
- data/spec/{java_packaging_spec.rb → java/packaging_spec.rb} +65 -4
- data/spec/{java_test_frameworks_spec.rb → java/tests_spec.rb} +31 -10
- data/spec/{archive_spec.rb → packaging/archive_spec.rb} +12 -2
- data/spec/{artifact_spec.rb → packaging/artifact_spec.rb} +12 -5
- data/spec/{packaging_helper.rb → packaging/packaging_helper.rb} +0 -0
- data/spec/{packaging_spec.rb → packaging/packaging_spec.rb} +1 -1
- data/spec/sandbox.rb +22 -5
- data/spec/{scala_compilers_spec.rb → scala/compiler_spec.rb} +1 -1
- data/spec/{scala_test_frameworks_spec.rb → scala/tests_spec.rb} +11 -12
- data/spec/spec_helpers.rb +38 -17
- metadata +103 -70
- data/lib/buildr/java/bdd_frameworks.rb +0 -265
- data/lib/buildr/java/groovyc.rb +0 -137
- data/lib/buildr/java/test_frameworks.rb +0 -450
- data/spec/build_spec.rb +0 -193
- data/spec/java_bdd_frameworks_spec.rb +0 -238
- data/spec/spec.opts +0 -6
@@ -1,41 +1,28 @@
|
|
1
1
|
h1. Contributing
|
2
2
|
|
3
|
-
Buildr is a community effort, and we welcome all contributors. Here's your
|
4
|
-
chance to get involved and help your fellow developers.
|
3
|
+
Buildr is a community effort, and we welcome all contributors. Here's your chance to get involved and help your fellow developers.
|
5
4
|
|
5
|
+
h2. Getting involved
|
6
6
|
|
7
|
-
|
7
|
+
All our discussions are done in the open, over "email":mailing_lists.html, and that would be the first place to look for answers, raise ideas, etc. For bug reports, issues and patches, "see below":#bugs_aka_issues.
|
8
8
|
|
9
|
-
We run two mailing lists, the
|
10
|
-
"buildr-user":http://mail-archives.apache.org/mod_mbox/incubator-buildr-user/
|
11
|
-
mailing list for developers working with Buildr, that would be you if you're
|
12
|
-
using Buildr or interested in using it. There's the
|
13
|
-
"buildr-dev":http://mail-archives.apache.org/mod_mbox/incubator-buildr-dev/
|
14
|
-
mailing list for talking about development of Buildr itself, and
|
15
|
-
"commits":http://mail-archives.apache.org/mod_mbox/incubator-buildr-commits/
|
16
|
-
mailing list for following SVN commits and JIRA issues.
|
17
9
|
|
18
|
-
|
19
|
-
subscribing, searching and posting to the mailing list.
|
10
|
+
h3. Mailing Lists
|
20
11
|
|
12
|
+
We run two mailing lists, the "buildr-user":http://mail-archives.apache.org/mod_mbox/incubator-buildr-user/ mailing list for developers working with Buildr, that would be you if you're using Buildr or interested in using it. There's the "buildr-dev":http://mail-archives.apache.org/mod_mbox/incubator-buildr-dev/ mailing list for talking about development of Buildr itself, and "commits":http://mail-archives.apache.org/mod_mbox/incubator-buildr-commits/ mailing list for following SVN commits and JIRA issues.
|
21
13
|
|
22
|
-
|
14
|
+
Check the "mailing lists":mailing_lists.html page for more information on subscribing, searching and posting to the mailing list.
|
23
15
|
|
24
|
-
We really do try to keep bugs to a minimum, and anticipate everything you'll
|
25
|
-
ever want to do with Buildr. We're also, not perfect. So you may have found a
|
26
|
-
bug, or have an enhancement in mind, or better yet, a patch to contribute.
|
27
|
-
Here's what you can do.
|
28
16
|
|
29
|
-
|
30
|
-
"JIRA":http://issues.apache.org/jira/browse/Buildr. For trivial stuff, that's
|
31
|
-
good enough.
|
17
|
+
h3. Bugs (aka Issues)
|
32
18
|
|
33
|
-
|
34
|
-
will still use JIRA to log the progress, but the mailing list is a better place
|
35
|
-
for talking things through.
|
19
|
+
We really do try to keep bugs to a minimum, and anticipate everything you'll ever want to do with Buildr. We're also, not perfect. So you may have found a bug, or have an enhancement in mind, or better yet, a patch to contribute. Here's what you can do.
|
36
20
|
|
37
|
-
|
38
|
-
|
21
|
+
If it's a bug, enhancement or patch, add it to "JIRA":http://issues.apache.org/jira/browse/Buildr. For trivial stuff, that's good enough.
|
22
|
+
|
23
|
+
If it needs more attention, start a discussion over on the mailing list. We will still use JIRA to log the progress, but the mailing list is a better place for talking things through.
|
24
|
+
|
25
|
+
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:
|
39
26
|
|
40
27
|
{{{!sh
|
41
28
|
$ ruby --version
|
@@ -43,54 +30,65 @@ $ buildr --version
|
|
43
30
|
$ java --version
|
44
31
|
}}}
|
45
32
|
|
46
|
-
If you have a patch to submit, do it through
|
47
|
-
"JIRA":http://issues.apache.org/jira/browse/Buildr. We want to make sure
|
48
|
-
Apache gets the right to use your contribution, and the JIRA upload form
|
49
|
-
includes a simple contribution agreement. Lawyer not included.
|
50
33
|
|
34
|
+
h3. Community Wiki
|
35
|
+
|
36
|
+
Our community Wiki is available at "http://cwiki.apache.org/confluence/display/BUILDR/Index":http://cwiki.apache.org/confluence/display/BUILDR/Index.
|
37
|
+
|
38
|
+
|
39
|
+
h3. Contributing Code
|
40
|
+
|
41
|
+
Yes, please.
|
42
|
+
|
43
|
+
If you have a patch to submit, do it through "JIRA":http://issues.apache.org/jira/browse/Buildr. We want to make sure Apache gets the right to use your contribution, and the JIRA upload form includes a simple contribution agreement. Lawyer not included.
|
44
|
+
|
45
|
+
h4. The Perfect Patch
|
46
|
+
|
47
|
+
If you want to get your patch accepted quickly:
|
48
|
+
|
49
|
+
# Provide a good summary of the bug/fix. We use that to decide which issue we can do quickly, and also copy and paste it into the changelog.
|
50
|
+
# Provide short explanation of what failed, under what conditions, why, and what else could be affected by the change (when relevant). The helps us understand the problem and move on to the next step.
|
51
|
+
# Provide a patch with relevant specs, or a fix to incomplete/broken specs. First thing we have to do is replicate the problem, before applying the change, and then make sure the change fixes that problem. And we need to have those specs in there, they make sure we don't accidentally break it again in the future.
|
52
|
+
# Provide a patch with the fix/change itself. Keep it separate from the specs, so it's easy to apply them individually.
|
51
53
|
|
52
|
-
|
54
|
+
If you don't know how to fix it, but can at least write a spec for the correct behavior (which, obviously would fail), do just that. A spec is preferred to a fix.
|
53
55
|
|
54
|
-
|
55
|
-
Buildr you get all the source code, documentation, test case and everything you
|
56
|
-
need to use it, extend it and patch it. Have a look in your Gem directory.
|
56
|
+
h4. Working on a new feature?
|
57
57
|
|
58
|
-
|
58
|
+
If you want to work on a cool new feature, but not quite ready to submit a patch, there's still a way you can get the Buildr community involved. We're experimenting with using Git for that. You can use Git to maintain a fork of Buildr that can keep up with changes in the main branch (tip: use @git rebase@), while developing your own changes/features on it.
|
59
59
|
|
60
|
-
|
61
|
-
|
60
|
+
That way you can get other people involved, checking out the code, and eventually merge it back with the main branch. Check out the "Git section":#Git below and the post "Git forking for fun and profit":http://blog.labnotes.org/2008/04/30/git-forking-for-fun-and-profit/.
|
61
|
+
|
62
|
+
|
63
|
+
h2. Living on the edge
|
64
|
+
|
65
|
+
Did we mention Buildr is an open source project? In fact, when you install Buildr you get all the source code, documentation, test case and everything you need to use it, extend it and patch it. Have a look in your Gem directory.
|
66
|
+
|
67
|
+
h3. SVN
|
68
|
+
|
69
|
+
But if you want to work with the latest and greatest, you'll want to check out "Buildr from SVN":http://svn.apache.org/repos/asf/incubator/buildr:
|
62
70
|
|
63
71
|
{{{!sh
|
64
72
|
$ svn co http://svn.apache.org/repos/asf/incubator/buildr/trunk buildr
|
65
73
|
}}}
|
66
74
|
|
67
|
-
You can also browse the "Buildr
|
68
|
-
repository":http://svn.apache.org/repos/asf/incubator/buildr.
|
75
|
+
You can also browse the "Buildr repository":http://svn.apache.org/repos/asf/incubator/buildr.
|
69
76
|
|
70
|
-
|
77
|
+
h3. Git
|
71
78
|
|
72
|
-
Not a fan SVN? We understand. You can also grab a copy of "Buildr from
|
73
|
-
GitHub":http://github.com/vic/buildr/tree/master:
|
79
|
+
Not a fan SVN? We understand. You can also grab a copy of "Buildr from GitHub":http://github.com/vic/buildr/tree/master:
|
74
80
|
|
75
81
|
{{{!sh
|
76
82
|
$ git clone git://github.com/vic/buildr.git
|
77
83
|
}}}
|
78
84
|
|
79
|
-
|
80
|
-
*not* an official Apache repository. To obtain Buildr from the official Apache
|
81
|
-
repository, consider using @giv-svn@ instead.
|
85
|
+
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.
|
82
86
|
|
83
|
-
|
84
|
-
"Git presentation":http://en.oreilly.com/rails2008/public/asset/attachment/2816
|
85
|
-
(PDF), or any of the "Git screencasts":http://www.gitcasts.com/. For more,
|
86
|
-
there's also the "Git Internals
|
87
|
-
book":http://peepcode.com/products/git-internals-pdf.
|
87
|
+
And keep this "Git cheat sheet":http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png close at hand. Very useful.
|
88
88
|
|
89
|
-
|
90
|
-
sheet":http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png handy at
|
91
|
-
hand. Very useful.
|
89
|
+
*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.
|
92
90
|
|
93
|
-
|
91
|
+
h3. Working with Source Code
|
94
92
|
|
95
93
|
To install Buildr from the source directory:
|
96
94
|
|
@@ -106,77 +104,86 @@ $ cd buildr
|
|
106
104
|
$ jruby -S rake setup install
|
107
105
|
}}}
|
108
106
|
|
107
|
+
The _setup_ task takes care of installing all the necessary dependencies used for building, testing and running Buildr. Once in a while we upgrade or add new dependencies, if you're experiencing a missing dependency, simply run @rake setup@ again.
|
108
|
+
|
109
|
+
The _install_ task creates a Gem in your working directory (_pkg/_) and install it in your local repository. Since Ruby Gems uses version numbers to detect new releases, if you installed Buildr this way and want to upgrade to the latest official release, you need to use @gem install buildr@ rather than @gem upgrade@.
|
110
|
+
|
111
|
+
Both _setup_ and _install_ tasks use the @sudo@ command on platforms that require it (i.e. not Windows), so there's no need to run @sudo rake@ when working with the Buildr source code.
|
112
|
+
|
113
|
+
|
114
|
+
h3. Using development build
|
115
|
+
|
116
|
+
Occasionally we'll make development builds from the current code in trunk/head. We appreciate if you can take the time to test those out and report any bugs. To install development builds, use the Gem repository at @people.apache.org/~assaf/buildr/snapshot@:
|
117
|
+
|
118
|
+
{{{!sh
|
119
|
+
gem source --add http://people.apache.org/~assaf/buildr/snapshot/
|
120
|
+
}}}
|
121
|
+
|
122
|
+
Since Ruby Gems uses version numbers to detect new releases, if you installed Buildr from a snapshot and want to upgrade to a newer snapshot or the latest official release, you need to use @gem install buildr@ rather than @gem upgrade@.
|
123
|
+
|
124
|
+
If you want to go back to using the RubyForge releases:
|
125
|
+
|
126
|
+
{{{!sh
|
127
|
+
gem source --remove http://people.apache.org/~assaf/buildr/snapshot/
|
128
|
+
gem install buildr
|
129
|
+
}}}
|
130
|
+
|
131
|
+
|
132
|
+
h2. Tested and Documented
|
109
133
|
|
110
|
-
|
134
|
+
Two things we definitely encourage!
|
111
135
|
|
112
|
-
|
113
|
-
include a test case. One that will fail without the patch, and run
|
114
|
-
successfully with it. If not for our love, then think of the benefit to you:
|
115
|
-
once we add that test case, we won't accidentally break that feature in the
|
116
|
-
next release.
|
136
|
+
h3. Testing/Specs
|
117
137
|
|
118
|
-
|
119
|
-
|
120
|
-
formulate test cases in terms of specifications: you describe how the code
|
121
|
-
should behave, and run RSpec to make sure it matches that specification.
|
138
|
+
Obviously we won't turn down patches, but we'll love you even more if you include a test case. One that will fail without the patch, and run successfully with it. If not for our love, then think of the benefit to you: once we add that test case, we won't accidentally break that feature in the next release.
|
139
|
+
|
140
|
+
We test using "RSpec":http://rspec.info/, a Behavior-Driven Development test framework. The main difference between RSpec and xUnit is that RSpec helps you formulate test cases in terms of specifications: you describe how the code should behave, and run RSpec to make sure it matches that specification.
|
122
141
|
|
123
142
|
You can run an individual specifications using the @spec@ command, for example:
|
124
143
|
|
125
144
|
{{{!sh
|
145
|
+
$ spec spec/compiler_spec.rb
|
126
146
|
$ spec spec/compiler_spec.rb -l 409
|
127
147
|
}}}
|
128
148
|
|
129
|
-
|
130
|
-
|
149
|
+
The first command will run all the specifications in @compiler_spec@, the second command will run only the specification identified by line 409 of that file. You can use line numbers to point at a particular specification (lines starting with @it@), or set of specifications (lines starting with @describe@). You can also use the @-e@ command line option to name a particular specification.
|
150
|
+
|
151
|
+
To make sure your change did not break anything else, you can run all the specifications (be patient, we have a lot of these):
|
131
152
|
|
132
153
|
{{{!sh
|
133
154
|
$ rake spec
|
134
155
|
}}}
|
135
156
|
|
157
|
+
If you get any failures, you can use @rake failed@ to run only the failed specs, and repeat until there are no more failed specs to run. The list of failed specs is stored in the file _failed_.
|
158
|
+
|
136
159
|
We always @rake spec@ before making a release.
|
137
160
|
|
138
|
-
|
139
|
-
|
161
|
+
For full test coverage:
|
162
|
+
|
163
|
+
{{{!sh
|
164
|
+
$ rake coverage
|
165
|
+
}}}
|
166
|
+
|
167
|
+
Specification and coverage reports are HTML files you can view with a Web browser, look for them in the _reports_ directory. You can also check out the "RSpec report":specs.html and "test coverage":coverage/index.html we publish with each release.
|
140
168
|
|
141
169
|
|
142
|
-
|
170
|
+
h3. Documentation
|
143
171
|
|
144
|
-
Yes, we do make typos, spelling errors and sometimes we write things that don't
|
145
|
-
make sense, so if you find a documentation bug, or want to help make the
|
146
|
-
documentation even better, here's the way to do it.
|
172
|
+
Yes, we do make typos, spelling errors and sometimes we write things that don't make sense, so if you find a documentation bug, or want to help make the documentation even better, here's the way to do it.
|
147
173
|
|
148
|
-
For simple typos and quick fixes, just send a message to the mailing list or
|
149
|
-
log an issue in JIRA.
|
174
|
+
For simple typos and quick fixes, just send a message to the mailing list or log an issue in JIRA.
|
150
175
|
|
151
|
-
If you end up rewriting a significant piece of text, or add new documentation
|
152
|
-
(your rock!), send a patch. Making documentation patches is fairly easy. All
|
153
|
-
the documentation is generated from text files in the @doc/pages@ directory, so
|
154
|
-
all you need to do is check it out from SVN, edit, and @svn diff@ to create a
|
155
|
-
patch.
|
176
|
+
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.
|
156
177
|
|
157
|
-
We use "Textile":http://www.textism.com/tools/textile/ as the markup language,
|
158
|
-
it takes all of a few minutes to learn, it's intuitive to use, and produces
|
159
|
-
clean HTML. Also check out the "Textile Quick
|
160
|
-
Reference":http://hobix.com/textile/quick.html.
|
178
|
+
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.
|
161
179
|
|
162
|
-
You can always check the documentation to see which conventions we use, and
|
163
|
-
also a couple of extensions we have for styling source code (with syntax
|
164
|
-
highlighting!) and handling footnotes. The table of contents is auto-generated
|
165
|
-
form H1/H2 headers.
|
180
|
+
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.
|
166
181
|
|
167
|
-
The tool we use for this is called Docter, which we developed specifically for
|
168
|
-
Buildr, and use to create the Web site and printable PDF. If you want to try
|
169
|
-
it out you'll need to first @gem install docter@. To generate a copy of the
|
170
|
-
Web site, simple run @rake html@ .
|
182
|
+
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@ .
|
171
183
|
|
172
|
-
If you're thinking of editing the docs, and using @rake html@ to see what the
|
173
|
-
HTML looks like, you may want to try something simpler. Start by running the
|
174
|
-
Docter Web server with @rake docter@ and then point your browser at
|
175
|
-
@http://localhost:3000@. To see your edits, simply refresh the page.
|
184
|
+
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.
|
176
185
|
|
177
|
-
Generating the PDF is a bit more tricky, we use the HTML in combination with
|
178
|
-
print media CSS stylesheets and run them through the wonderful
|
179
|
-
"PrinceXML":http://www.princexml.com/, so you'll need to install PrinceXML
|
186
|
+
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
|
180
187
|
first before you can @rake pdf@.
|
181
188
|
|
182
189
|
|
@@ -188,11 +195,14 @@ Here is the list of people who are actively working and committing on Buildr:
|
|
188
195
|
|
189
196
|
*Alex Boisvert*
|
190
197
|
|
198
|
+
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.
|
199
|
+
|
191
200
|
*"Matthieu Riou":http://offthelip.org*
|
192
201
|
|
193
202
|
*Victor Hugo Borja* (vborja at apache.org)
|
194
203
|
|
195
|
-
Currently a Java Developer at
|
196
|
-
|
197
|
-
|
198
|
-
|
204
|
+
Currently a Java Developer at "http://jwmsolutions.com":http://jwmsolutions.com, Victor has been enjoying and using Apache's software since 1999 when he started with Java, now he prefers programming Ruby and is happy to help on Apache's first ruby project.
|
205
|
+
|
206
|
+
*Lacton* (lacton at apache.org)
|
207
|
+
|
208
|
+
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.
|
data/doc/pages/download.textile
CHANGED
@@ -3,28 +3,28 @@ h1. Download
|
|
3
3
|
|
4
4
|
h2. Installing Buildr
|
5
5
|
|
6
|
-
The easiest way to install Buildr is using the fabulous RubyGems package
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
The *official Apache distribution* consists of the digitally signed binaries
|
14
|
-
(gems) and source packages "available below":#binaries_and_source_code. To
|
15
|
-
install these binaries, you must first download them to disk and then install
|
16
|
-
them using the @gem install@ command (or @rake install@ for a source
|
17
|
-
distribution).
|
18
|
-
|
19
|
-
In addition, contributors to this project maintain a separate distribution over
|
20
|
-
on "RubyForge":http://rubyforge.org/projects/buildr. Using this distribution,
|
21
|
-
you're able to install Buildr directly from the remote gem repository and to
|
22
|
-
automatically upgrade when a new release comes out. The RubyForge distribution
|
23
|
-
is *not* an official Apache distribution.
|
6
|
+
The easiest way to install Buildr is using the fabulous RubyGems package manager. Of course, you will need either Ruby or JRuby, and we recommend upgrading to the most recent version of RubyGems. If this sounds foreign to you, don't worry. We'll show you how to install Buildr on Linux, OS X, Windows and JRuby in the "Getting Started guide":getting_started.html, we even provide automated installation scripts.
|
7
|
+
|
8
|
+
The *official Apache distribution* consists of the digitally signed binaries (gems) and source packages "available below":#binaries_and_source_code. To install these binaries, you must first download them to disk and then install them using the @gem install@ command (or @rake install@ for a source distribution).
|
9
|
+
|
10
|
+
In addition, contributors to this project maintain a separate distribution over on "RubyForge":http://rubyforge.org/projects/buildr. Using this distribution, you're able to install Buildr directly from the remote gem repository and to automatically upgrade when a new release comes out. The RubyForge distribution is *not* an official Apache distribution.
|
11
|
+
|
12
|
+
The source code is included in both source and binary distribution, the Gem distribution expands the source code into your local Gem repository. That's in addition to getting the source code directly from "SVN":http://svn.apache.org/repos/asf/incubator/buildr or "GitHub":http://github.com/vic/buildr/tree/master. Learn more about working with source code and "living on the edge":contributing.html#living_on_the_edge.
|
24
13
|
|
25
14
|
|
26
15
|
h2. Binaries and Source Code
|
27
16
|
|
17
|
+
h3. buildr 1.3.2-incubating (2008-07-18)
|
18
|
+
|
19
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
20
|
+
| "buildr-1.3.2-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem | "225504bc195334c4eb9d6dec814d9db1":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.gem.asc |
|
21
|
+
| "buildr-1.3.2-java-incubating.gem":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem | "d7d8394c7aed887987be0e813e1e4cee":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-java-incubating.gem.asc |
|
22
|
+
| "buildr-1.3.2-incubating.tgz":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz | "611e97df1bc76382ecbe6b60e9340f2b":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.tgz.asc |
|
23
|
+
| "buildr-1.3.2-incubating.zip":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip | "d65d20005f603338c0aedd4f17d0bc90":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.md5 | "Sig":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/buildr-1.3.2-incubating.zip.asc |
|
24
|
+
|
25
|
+
p>. ("Release signing keys":http://www.apache.org/dist/incubator/buildr/1.3.2-incubating/KEYS)
|
26
|
+
|
27
|
+
|
28
28
|
|
29
29
|
h3. buildr 1.3.1-incubating (2008-05-19)
|
30
30
|
|
@@ -48,12 +48,4 @@ h3. buildr 1.3.0-incubating (2008-05-01)
|
|
48
48
|
p>. ("Release signing keys":http://www.apache.org/dist/incubator/buildr/1.3.0-incubating/KEYS)
|
49
49
|
|
50
50
|
|
51
|
-
p(note). When downloading from files please check the
|
52
|
-
"md5sum":http://www.apache.org/dev/release-signing#md5 and verify the
|
53
|
-
"OpenPGP":http://www.apache.org/dev/release-signing#openpgp compatible
|
54
|
-
signature from the main Apache site. This
|
55
|
-
"KEYS":http://www.apache.org/dist/incubator/buildr/KEYS file contains the
|
56
|
-
public keys used for signing releases. It is recommended that (when possible) a
|
57
|
-
web of trust is used to confirm the identity of these keys. For more
|
58
|
-
information, please see the "Apache Release
|
59
|
-
FAQ":http://www.apache.org/dev/release.html.
|
51
|
+
p(note). When downloading from files please check the "md5sum":http://www.apache.org/dev/release-signing#md5 and verify the "OpenPGP":http://www.apache.org/dev/release-signing#openpgp compatible signature from the main Apache site. This "KEYS":http://www.apache.org/dist/incubator/buildr/KEYS file contains the public keys used for signing releases. It is recommended that (when possible) a web of trust is used to confirm the identity of these keys. For more information, please see the "Apache Release FAQ":http://www.apache.org/dev/release.html.
|
data/doc/pages/extending.textile
CHANGED
@@ -2,16 +2,9 @@ h1. Extending Buildr
|
|
2
2
|
|
3
3
|
h2. Organizing Tasks
|
4
4
|
|
5
|
-
A couple of things we learned while working on Buildr. Being able to write
|
6
|
-
your own Rake tasks is a very powerful feature. But if you find yourself
|
7
|
-
doing the same thing over and over, you might also want to consider functions.
|
8
|
-
They give you a lot more power and easy abstractions.
|
5
|
+
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
6
|
|
10
|
-
For example, we use OpenJPA in several projects. It's a very short task, but
|
11
|
-
each time I have to go back to the OpenJPA documentation to figure out how to
|
12
|
-
set the Ant MappingTool task, tell Ant how to define it. After the second
|
13
|
-
time, you're recognizing a pattern and it's just easier to write a function
|
14
|
-
that does all that for you.
|
7
|
+
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.
|
15
8
|
|
16
9
|
Compare this:
|
17
10
|
|
@@ -46,36 +39,20 @@ file('derby.sql') do
|
|
46
39
|
end
|
47
40
|
}}}
|
48
41
|
|
49
|
-
I prefer the second. It's easier to look at the Buildfile and understand what
|
50
|
-
it does. It's easier to maintain when you only have to look at the important
|
51
|
-
information.
|
42
|
+
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.
|
52
43
|
|
53
|
-
But just using functions is not always enough. You end up with a Buildfile
|
54
|
-
containing a lot of code that clearly doesn't belong there. For starters, I
|
55
|
-
recommend putting it in the @tasks@ directory. Write it into a file with a
|
56
|
-
@.rake@ extension and place that in the @tasks@ directory next to the
|
57
|
-
Buildfile. Buildr will automatically pick it up and load it for you.
|
44
|
+
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.
|
58
45
|
|
59
|
-
If you want to share these pre-canned definitions between projects, you have a
|
60
|
-
few more options. You can share the @tasks@ directory using SVN externals.
|
61
|
-
Another mechanism with better version control is to package all these tasks,
|
62
|
-
functions and modules into a "Gem":http://rubygems.org/ and require it from
|
63
|
-
your Buildfile. You can run your own internal Gem server for that.
|
46
|
+
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.
|
64
47
|
|
65
|
-
For individual task files, you can also use
|
66
|
-
"Sake":http://errtheblog.com/post/6069 for system-wide Rake tasks deployment.
|
48
|
+
For individual task files, you can also use "Sake":http://errtheblog.com/post/6069 for system-wide Rake tasks deployment.
|
67
49
|
|
68
50
|
|
69
51
|
h2. Creating Extensions
|
70
52
|
|
71
|
-
The basic mechanism for extending projects in Buildr are Ruby modules. In
|
72
|
-
fact, base features like compiling and testing are all developed in the form
|
73
|
-
of modules, and then added to the core Project class.
|
53
|
+
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.
|
74
54
|
|
75
|
-
A module defines instance methods that are then mixed into the project and
|
76
|
-
become instance methods of the project. There are two general ways for
|
77
|
-
extending projects. You can extend all projects by including the module in
|
78
|
-
Project:
|
55
|
+
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:
|
79
56
|
|
80
57
|
{{{!ruby
|
81
58
|
class Project
|
@@ -83,8 +60,7 @@ class Project
|
|
83
60
|
end
|
84
61
|
}}}
|
85
62
|
|
86
|
-
You can also extend a given project instance and only that instance by
|
87
|
-
extending it with the module:
|
63
|
+
You can also extend a given project instance and only that instance by extending it with the module:
|
88
64
|
|
89
65
|
{{{!ruby
|
90
66
|
define 'foo' do
|
@@ -92,23 +68,14 @@ define 'foo' do
|
|
92
68
|
end
|
93
69
|
}}}
|
94
70
|
|
95
|
-
Some extensions require tighter integration with the project, specifically for
|
96
|
-
setting up tasks and properties, or for configuring tasks based on the project
|
97
|
-
definition. You can do that by adding callbacks to the process.
|
71
|
+
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.
|
98
72
|
|
99
|
-
The easiest way to add callbacks is by incorporating the Extension module in
|
100
|
-
your own extension, and using the various class methods to define callback
|
101
|
-
behavior.
|
73
|
+
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.
|
102
74
|
|
103
75
|
|_. Method |_. Usage |
|
104
|
-
| @first_time@ | This block will be called once for any particular
|
105
|
-
|
106
|
-
| @
|
107
|
-
instance, right before running the project definition. You can use this to add
|
108
|
-
tasks and set properties that will be used in the project definition. |
|
109
|
-
| @after_define@ | This block is called once for the project with the project
|
110
|
-
instance, right after running the project definition. You can use this to do
|
111
|
-
any post-processing that depends on the project definition. |
|
76
|
+
| @first_time@ | This block will be called once for any particular extension. You can use this to setup top-level and local tasks. |
|
77
|
+
| @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. |
|
78
|
+
| @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. |
|
112
79
|
|
113
80
|
This example illustrates how to write a simple extension:
|
114
81
|
|
@@ -152,16 +119,9 @@ end
|
|
152
119
|
|
153
120
|
h2. Using Alternative Layouts
|
154
121
|
|
155
|
-
Buildr follows a common convention for project layouts: Java source files
|
156
|
-
appear in @src/main/java@ and compile to @target/classes@, resources are
|
157
|
-
copied over from @src/main/resources@ and so forth. Not all projects follow
|
158
|
-
this convention, so it's now possible to specify an alternative project
|
159
|
-
layout.
|
122
|
+
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.
|
160
123
|
|
161
|
-
The default layout is available in @Layout.default@, and all projects inherit
|
162
|
-
it. You can set @Layout.default@ to your own layout, or define a project with
|
163
|
-
a given layout (recommended) by setting the @:layout@ property. Projects
|
164
|
-
inherit the layout from their parent projects. For example:
|
124
|
+
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:
|
165
125
|
|
166
126
|
{{{!ruby
|
167
127
|
define 'foo', :layout=>my_layout do
|
@@ -169,10 +129,7 @@ define 'foo', :layout=>my_layout do
|
|
169
129
|
end
|
170
130
|
}}}
|
171
131
|
|
172
|
-
A layout is an object that implements the @expand@ method. The easiest way to
|
173
|
-
define a custom layout is to create a new @Layout@ object and specify mapping
|
174
|
-
between names used by Buildr and actual paths within the project. For
|
175
|
-
example:
|
132
|
+
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:
|
176
133
|
|
177
134
|
{{{!ruby
|
178
135
|
my_layout = Layout.new
|
@@ -187,30 +144,19 @@ my_layout = Layout.new
|
|
187
144
|
my_layout[:source, :main] = ''
|
188
145
|
}}}
|
189
146
|
|
190
|
-
If you need anything more complex, you can always subclass @Layout@ and add
|
191
|
-
special handling in the @expand@ method, you'll find one such example in the
|
192
|
-
API documentation.
|
147
|
+
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.
|
193
148
|
|
194
|
-
The built-in tasks expand lists of symbols into relative paths, using the
|
195
|
-
following convention:
|
149
|
+
The built-in tasks expand lists of symbols into relative paths, using the following convention:
|
196
150
|
|
197
151
|
|_. Path |_. Expands to |
|
198
|
-
| @:source, :main, <lang/usage>@ | Directory containing source files for a
|
199
|
-
given language or usage, for example, @:java@, @:resources
|
200
|
-
| @:
|
201
|
-
|
202
|
-
| @:target, :
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
| @:target, :test, <lang/usage>@ | Target directory for compile test cases,
|
207
|
-
for example, @:classes@, @:resources@. |
|
208
|
-
| @:reports, <framework/usage>@ | Target directory for generated reports, for
|
209
|
-
example, @:junit@, @:coverage@. |
|
210
|
-
|
211
|
-
All tasks are encouraged to use the same convention, and whenever possible, we
|
212
|
-
recommend using the project's @path_to@ method to expand a list of symbols
|
213
|
-
into a path, or use the appropriate path when available. For example:
|
152
|
+
| @:source, :main, <lang/usage>@ | Directory containing source files for a given language or usage, for example, @:java@, @:resources@, @:webapp@. |
|
153
|
+
| @:source, :test, <lang/usage>@ | Directory containing test files for a given language or usage, for example, @:java@, @:resources@. |
|
154
|
+
| @:target, :generated@ | Target directory for generated code (typically source code). |
|
155
|
+
| @:target, :main, <lang/usage>@ | Target directory for compiled code, for example, @:classes@, @:resources@. |
|
156
|
+
| @:target, :test, <lang/usage>@ | Target directory for compile test cases, for example, @:classes@, @:resources@. |
|
157
|
+
| @:reports, <framework/usage>@ | Target directory for generated reports, for example, @:junit@, @:coverage@. |
|
158
|
+
|
159
|
+
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:
|
214
160
|
|
215
161
|
{{{!ruby
|
216
162
|
define 'bad' do
|