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
@@ -5,18 +5,14 @@ Common troubleshooting tips collected from the mailing list.
|
|
5
5
|
|
6
6
|
h2. Running out of heap space
|
7
7
|
|
8
|
-
You can give the JVM more heap space by setting the @JAVA_OPTS@ environment
|
9
|
-
variables. This environment variable provides arguments for staring the JVM.
|
10
|
-
For example, to set the heap space to 1GB:
|
8
|
+
You can give the JVM more heap space by setting the @JAVA_OPTS@ environment variables. This environment variable provides arguments for staring the JVM. For example, to set the heap space to 1GB:
|
11
9
|
|
12
10
|
{{{!sh
|
13
11
|
$ export "JAVA_OPTS=-Xms1g -Xmx1g"
|
14
12
|
$ buildr compile
|
15
13
|
}}}
|
16
14
|
|
17
|
-
If you're sharing the build with other developers, you'll want to specify these
|
18
|
-
options in the Buildfile itself. You can set the environment variable within
|
19
|
-
the Buildfile, but make sure to do so at the very top of the Buildfile.
|
15
|
+
If you're sharing the build with other developers, you'll want to specify these options in the Buildfile itself. You can set the environment variable within the Buildfile, but make sure to do so at the very top of the Buildfile.
|
20
16
|
|
21
17
|
For example:
|
22
18
|
|
@@ -27,13 +23,9 @@ ENV['JAVA_OPTS'] = '-Xms1g -Xmx1g'
|
|
27
23
|
|
28
24
|
h2. RJB fails to compile
|
29
25
|
|
30
|
-
On Linux, BSD and Cygwin, RJB locates the JDK headers files -- which it uses to
|
31
|
-
compile a native C extension -- based on the @JAVA_HOME@ environment variable.
|
32
|
-
Make sure @JAVA_HOME@ points to the JDK, not JRE.
|
26
|
+
On Linux, BSD and Cygwin, RJB locates the JDK headers files -- which it uses to compile a native C extension -- based on the @JAVA_HOME@ environment variable. Make sure @JAVA_HOME@ points to the JDK, not JRE.
|
33
27
|
|
34
|
-
If you are using @sudo gem install@, note that some environments do not pass
|
35
|
-
the @JAVA_HOME@ environment variable over to @sudo@. To get around this, run
|
36
|
-
@gem@ with the @env JAVA_HOME=$JAVA_HOME@ option:
|
28
|
+
If you are using @sudo gem install@, note that some environments do not pass the @JAVA_HOME@ environment variable over to @sudo@. To get around this, run @gem@ with the @env JAVA_HOME=$JAVA_HOME@ option:
|
37
29
|
|
38
30
|
{{{!sh
|
39
31
|
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
@@ -42,13 +34,9 @@ $ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
|
42
34
|
|
43
35
|
h2. Segmentation Fault when running Java code
|
44
36
|
|
45
|
-
This is most likely a JVM inconsistency, for example, when part of the RJB
|
46
|
-
library uses JDK 1.6, the other part uses JDK 1.5.
|
37
|
+
This is most likely a JVM inconsistency, for example, when part of the RJB library uses JDK 1.6, the other part uses JDK 1.5.
|
47
38
|
|
48
|
-
During installation RJB builds a native C extension using header files supplied by
|
49
|
-
the JVM, and compiles a Java bridge class using the Javac. It is possible for RJB
|
50
|
-
to use two different versions of the JVM, for example, if @JAVA_HOME@ points to
|
51
|
-
JDK 1.5, but @/usr/bin/javac@ points to JDK 1.6.
|
39
|
+
During installation RJB builds a native C extension using header files supplied by the JVM, and compiles a Java bridge class using the Javac. It is possible for RJB to use two different versions of the JVM, for example, if @JAVA_HOME@ points to JDK 1.5, but @/usr/bin/javac@ points to JDK 1.6.
|
52
40
|
|
53
41
|
Make sure @JAVA_HOME@ and @/usr/bin/javac@ both point to the same JDK:
|
54
42
|
|
@@ -57,54 +45,34 @@ echo $JAVA_HOME
|
|
57
45
|
ls -l /usr/bin/javac
|
58
46
|
}}}
|
59
47
|
|
60
|
-
*Note:* It seems that RJB works with Java 6, except when it doesn't, and for a
|
61
|
-
few people it doesn't. In that case, either switch to Java 1.5, or simply run
|
62
|
-
Buildr on JRuby using Java 6.
|
48
|
+
*Note:* It seems that RJB works with Java 6, except when it doesn't, and for a few people it doesn't. In that case, either switch to Java 1.5, or simply run Buildr on JRuby using Java 6.
|
63
49
|
|
64
50
|
|
65
51
|
h2. Bugs resulting from a dangling comma or period
|
66
52
|
|
67
|
-
Ruby statements don't need a delimiter and can span multiple lines, which can
|
68
|
-
lead to bugs resulting from dangling commas and periods left at the end of the
|
69
|
-
line. For example:
|
53
|
+
Ruby statements don't need a delimiter and can span multiple lines, which can lead to bugs resulting from dangling commas and periods left at the end of the line. For example:
|
70
54
|
|
71
55
|
{{{!ruby
|
72
56
|
compile.with 'org.apache.axis2:axis2:jar:1.2',
|
73
57
|
test.with 'log4j:log4j:jar:1.1'
|
74
58
|
}}}
|
75
59
|
|
76
|
-
This is actually a single method call with two arguments, separated by a comma.
|
77
|
-
The second argument is the result of calling @test.with@, and makes the test
|
78
|
-
task a pre-requisite of the compile task, leading to a circular dependency.
|
60
|
+
This is actually a single method call with two arguments, separated by a comma. The second argument is the result of calling @test.with@, and makes the test task a pre-requisite of the compile task, leading to a circular dependency.
|
79
61
|
|
80
|
-
As you can imagine this happens usually after editing, specifically for commas
|
81
|
-
and periods which are small enough that you won't notice them from a cursory
|
82
|
-
glance at the code, so if all else fails, search for lines that end with one of
|
83
|
-
these characters.
|
62
|
+
As you can imagine this happens usually after editing, specifically for commas and periods which are small enough that you won't notice them from a cursory glance at the code, so if all else fails, search for lines that end with one of these characters.
|
84
63
|
|
85
64
|
|
86
65
|
h2. Missing POM breaks transitive dependencies
|
87
66
|
|
88
|
-
Occasionally, artifacts are deployed to remote repositories with missing or
|
89
|
-
broken POMs. Buildr will fail when attempting to resolve transitive
|
90
|
-
dependencies with broken or missing POMs.
|
67
|
+
Occasionally, artifacts are deployed to remote repositories with missing or broken POMs. Buildr will fail when attempting to resolve transitive dependencies with broken or missing POMs.
|
91
68
|
|
92
|
-
In this particular case, failing is doing the right thing. There's no way for
|
93
|
-
Buildr to tell whether the POM is nowhere to be found, or just a temporary
|
94
|
-
problem accessing the remote server.
|
69
|
+
In this particular case, failing is doing the right thing. There's no way for Buildr to tell whether the POM is nowhere to be found, or just a temporary problem accessing the remote server.
|
95
70
|
|
96
|
-
If you can determine that the POM file is missing you can work around the
|
97
|
-
problem in three ways. If you published the artifact, make the release again,
|
98
|
-
getting it to upload the missing files.
|
71
|
+
If you can determine that the POM file is missing you can work around the problem in three ways. If you published the artifact, make the release again, getting it to upload the missing files.
|
99
72
|
|
100
|
-
If the source repository is not under your control, but you are also using your
|
101
|
-
own repository for the project, you can always create a dummy POM in your own
|
102
|
-
repository. Buildr will attempt to download the file from either repository,
|
103
|
-
using the first file it finds.
|
73
|
+
If the source repository is not under your control, but you are also using your own repository for the project, you can always create a dummy POM in your own repository. Buildr will attempt to download the file from either repository, using the first file it finds.
|
104
74
|
|
105
|
-
Alternatively, you can make Buildr create a dummy POM file in the local
|
106
|
-
repository, instead of downloading it from a remote repository. This example
|
107
|
-
creates a dummy POM for Axis JAX-RPC:
|
75
|
+
Alternatively, you can make Buildr create a dummy POM file in the local repository, instead of downloading it from a remote repository. This example creates a dummy POM for Axis JAX-RPC:
|
108
76
|
|
109
77
|
{{{!ruby
|
110
78
|
artifact 'axis:axis-jaxrpc:pom:1.3' do |task|
|
@@ -119,3 +87,17 @@ artifact 'axis:axis-jaxrpc:pom:1.3' do |task|
|
|
119
87
|
end
|
120
88
|
}}}
|
121
89
|
|
90
|
+
|
91
|
+
h2. Buildr fails to run after install with a "stack level too deep (SystemStackError)" error
|
92
|
+
|
93
|
+
A particular quirk of an existing Ruby setup can cause problems when running Buildr. If a system already has several Ruby directories that are in the @PATH@, it is often nice (appropriate?) to have them in @RUBYLIB@ as well (to be able to require them). If there are several of them a user may decide that @RUBYLIB=$PATH@ is a good way to handle this (or some less automated method that has the same effect).
|
94
|
+
|
95
|
+
The culprit is having the Gem's binary directory show up in @RUBYLIB@. For example, Buildr's @bin/buildr@ includes this line:
|
96
|
+
|
97
|
+
{{{!sh
|
98
|
+
require 'buildr'
|
99
|
+
}}}
|
100
|
+
|
101
|
+
Under normal circumstances, this tells RubyGems to load @buildr.rb@ from the Gem's library directory. When @RUBYLIB@ points to the Gem's @bin@ directory, it ends up loading itself repeatedly.
|
102
|
+
|
103
|
+
To solve this, remove Buildr's @bin@ directory from @RUBYLIB@. Removing all directories that you don't actually need is better (other Gems may have the same problem).
|
data/doc/pages/whats_new.textile
CHANGED
@@ -1,119 +1,90 @@
|
|
1
1
|
h1. What's New
|
2
2
|
|
3
|
+
h2. Buildr 1.3.3
|
4
|
+
|
5
|
+
* Support for "JtestR":http://jtestr.codehaus.org/ test framework.
|
6
|
+
* Support for "Emma":http://emma.sourceforge.net/ code coverage tool.
|
7
|
+
* Growl notifications (OS X only).
|
8
|
+
* Starting with this release you can use the @build.yml@ file to control versions of various 3rd party libraries, e.g. Ant, JUnit, ScalaCheck.
|
9
|
+
* The _release_ task now supports alternative SVN repository layouts. Releases are tagged in SVN using the version number, but you can customize the tag name (see @Releases.tag_name@). The @NEXT_VERSION@ constant is no longer used during the release process.
|
10
|
+
* This release is tested against JRuby 1.1.3 and JRuby 1.1.4. There are also some improvements towards Ruby 1.9 support.
|
11
|
+
* 27 other bug fixes and minor changes, see the "CHANGELOG":changelog.html for full details.
|
12
|
+
|
13
|
+
|
3
14
|
h2. Buildr 1.3.2
|
4
15
|
|
5
|
-
* New @--prereqs@ command line argument lists all the tasks and their
|
6
|
-
dependencies. You can also filter specific tasks by following with a regular
|
7
|
-
expression, for example, @--prereqs foo@.
|
16
|
+
* New @--prereqs@ command line argument lists all the tasks and their dependencies. You can also filter specific tasks by following with a regular expression, for example, @--prereqs foo@.
|
8
17
|
* Upgraded to latest release of Net::SSH, Net::SFTP, RubyForge and RubyGems.
|
9
|
-
* Upgraded to JUnit 4.4 and fixed case where abstract classes extending
|
10
|
-
|
11
|
-
* The target/test/class and /resources directories now come first in the
|
12
|
-
classpath, ahead of any code compiled code and resources copied over from
|
13
|
-
src/main.
|
18
|
+
* Upgraded to JUnit 4.4 and fixed case where abstract classes extending TestCase would lead to tests failing.
|
19
|
+
* The target/test/class and /resources directories now come first in the classpath, ahead of any code compiled code and resources copied over from src/main.
|
14
20
|
* Fixed: BUILDR-90 Installing from source doesn't work with JRuby.
|
15
|
-
* Fixed: BUILDR-91 When doing a release, buildr should spawn the same version
|
16
|
-
of buildr
|
21
|
+
* Fixed: BUILDR-91 When doing a release, buildr should spawn the same version of buildr
|
17
22
|
* Fixed: BUILDR-92 IDEA 7x: add resources directories to classpath.
|
18
23
|
* Fixed: BUILDR-95: Only download Scala test framework artifacts when required
|
19
24
|
* Fixed: BUILDR-100 Directory structure documentation needs updating.
|
20
25
|
* Fixed: Installation instructions updated for RubyGems 1.2.0.
|
21
26
|
|
27
|
+
|
22
28
|
h2. Buildr 1.3.1
|
23
29
|
|
24
30
|
* Fixed to specific Gem dependencies, so should install cleanly on Windows.
|
25
|
-
* Buildr now supports publishing files to HTTP server for remote repositories
|
26
|
-
|
27
|
-
* Buildr now supports reading files from SFTP server and upgrades to
|
28
|
-
Net::SSH 2.0 and Net::SFTP 2.0.
|
31
|
+
* Buildr now supports publishing files to HTTP server for remote repositories that support HTTP uploads (PUT).
|
32
|
+
* Buildr now supports reading files from SFTP server and upgrades to Net::SSH 2.0 and Net::SFTP 2.0.
|
29
33
|
* HTTP downloads now accept URLs with query parameters (Tommy Knowlton).
|
30
|
-
* On OS X if you are not using the default JDK, you can set the JAVA_HOME
|
31
|
-
|
32
|
-
*
|
33
|
-
|
34
|
-
the JVM, for example to set heap size, only applicable when forking (the
|
35
|
-
default mode when running JUnit).
|
36
|
-
* Fixed BUILDR-75: Filter now runs if there's a target directory, even if
|
37
|
-
there are no source files to copy over, and creates an empty target
|
38
|
-
directory. The previous behavior caused some problems with code that checked
|
39
|
-
if resource.target was nil, but didn't check if there are any
|
40
|
-
resource.sources to process.
|
41
|
-
* Added the jibx_bind method to use JiBX for Java<=>XML binding (by David
|
42
|
-
Peterson).
|
34
|
+
* On OS X if you are not using the default JDK, you can set the JAVA_HOME environment variable to point to any other JDK (Nathan Hamblen).
|
35
|
+
* JUnit properly passes options[:environment] as environment variables to the test case. In addition options[:java_args] are now passed as arguments to the JVM, for example to set heap size, only applicable when forking (the default mode when running JUnit).
|
36
|
+
* Fixed BUILDR-75: Filter now runs if there's a target directory, even if there are no source files to copy over, and creates an empty target directory. The previous behavior caused some problems with code that checked if resource.target was nil, but didn't check if there are any resource.sources to process.
|
37
|
+
* Added the jibx_bind method to use JiBX for Java<=>XML binding (by David Peterson).
|
43
38
|
|
44
39
|
|
45
40
|
h2. Buildr 1.3
|
46
41
|
|
47
42
|
h3. Multiple Languages
|
48
43
|
|
49
|
-
The main focus of this release is supporting multiple languages for compiling
|
50
|
-
and testing.
|
44
|
+
The main focus of this release is supporting multiple languages for compiling and testing.
|
51
45
|
|
52
|
-
For each project, Buildr will attempt to infer which compiler to use based on
|
53
|
-
the source files it finds, for example, if it finds @.java@ files in the
|
54
|
-
@src/main/java@ directory, it will switch to the javac compiler, if it finds
|
55
|
-
@.scala@ files in the @src/main/scala@ directory, to the scalac compiler and so
|
56
|
-
forth.
|
46
|
+
For each project, Buildr will attempt to infer which compiler to use based on the source files it finds, for example, if it finds @.java@ files in the @src/main/java@ directory, it will switch to the javac compiler, if it finds @.scala@ files in the @src/main/scala@ directory, to the scalac compiler and so forth.
|
57
47
|
|
58
|
-
Different compilers may use different target directory, @target/classes@ is
|
59
|
-
picked for JVM compilers (Java, Scala, Groovy, etc), so resources are not copied to
|
60
|
-
their own directory, @target/resources@. The prepare task has been removed.
|
48
|
+
Different compilers may use different target directory, @target/classes@ is picked for JVM compilers (Java, Scala, Groovy, etc), so resources are not copied to their own directory, @target/resources@. The prepare task has been removed.
|
61
49
|
|
62
|
-
Not all languages have classpaths, so @compile.classpath@ is now known as
|
63
|
-
@compile.dependencies@, but the old attribute still exists for backward
|
64
|
-
compatibility.
|
50
|
+
Not all languages have classpaths, so @compile.classpath@ is now known as @compile.dependencies@, but the old attribute still exists for backward compatibility.
|
65
51
|
|
66
|
-
Also, for consistency, the test target directories have changed to
|
67
|
-
@target/test/classes@ and @target/test/resources@, respectively.
|
52
|
+
Also, for consistency, the test target directories have changed to @target/test/classes@ and @target/test/resources@, respectively.
|
68
53
|
|
69
|
-
Speaking of tests, you can compile code in one language and use a different
|
70
|
-
language to test it, say, if you're interested in compiling Java code and
|
71
|
-
testing it with Ruby, or compiling Flash and running a Java test suite.
|
54
|
+
Speaking of tests, you can compile code in one language and use a different language to test it, say, if you're interested in compiling Java code and testing it with Ruby, or compiling Flash and running a Java test suite.
|
72
55
|
|
73
|
-
As before, you can pick the test framework by calling
|
74
|
-
@test.using(<framework>)@. Buildr will attempt to pick one by default, for
|
75
|
-
example, if the tests are written in Java, it will default to JUnit.
|
56
|
+
As before, you can pick the test framework by calling @test.using(<framework>)@. Buildr will attempt to pick one by default, for example, if the tests are written in Java, it will default to JUnit.
|
76
57
|
|
77
|
-
And, since not all languages package to JARs, the default packaging is either
|
78
|
-
inferred from the compiler (so @:jar@ when compiling Java code), otherwise to
|
79
|
-
@:zip@. All this defaulting means that @package()@ with no arguments does the
|
80
|
-
right thing in more cases, and most probably won't break anyone's buildfiles.
|
58
|
+
And, since not all languages package to JARs, the default packaging is either inferred from the compiler (so @:jar@ when compiling Java code), otherwise to @:zip@. All this defaulting means that @package()@ with no arguments does the right thing in more cases, and most probably won't break anyone's buildfiles.
|
81
59
|
|
82
|
-
I've tried to keep the compiler API as simple as possible, making it easy to
|
83
|
-
add new compilers; however, I had to change the test framework API to
|
84
|
-
accommodate the new features, so old test frameworks will not work on 1.3.
|
60
|
+
I've tried to keep the compiler API as simple as possible, making it easy to add new compilers; however, I had to change the test framework API to accommodate the new features, so old test frameworks will not work on 1.3.
|
85
61
|
|
86
62
|
|
87
63
|
h3. Scala Support
|
88
64
|
|
89
|
-
Buildr now supports Scala
|
65
|
+
Buildr now supports "Scala":http://www.scala-lang.org/, using both native and fast Scala compiler.
|
90
66
|
|
91
|
-
Read more about "using Scala":
|
67
|
+
Read more about "using Scala":languages.html#scala.
|
92
68
|
|
93
69
|
|
94
70
|
h3. Groovy Support
|
95
71
|
|
96
72
|
Buildr now supports Groovy, using the Groovyc Ant task.
|
97
73
|
|
98
|
-
Read more about "using Groovy":
|
74
|
+
Read more about "using Groovy":languages.html#groovy.
|
99
75
|
|
100
76
|
|
101
77
|
h3. Packaging Files
|
102
78
|
|
103
|
-
The @package@ method is convenient enough that you can now use it to generate
|
104
|
-
artifacts, an in addition to generate regular file tasks, specifying the file
|
105
|
-
name using the @:file@ attribute. For example:
|
79
|
+
The @package@ method is convenient enough that you can now use it to generate artifacts, an in addition to generate regular file tasks, specifying the file name using the @:file@ attribute. For example:
|
106
80
|
|
107
81
|
{{{!ruby
|
108
82
|
package :zip, :file=>_('target/interesting.zip')
|
109
83
|
}}}
|
110
84
|
|
111
|
-
Since this package is not an artifact and does not have a specification, it
|
112
|
-
will not automatically install itself in the local repository or upload to a
|
113
|
-
remote repository. For these, use the @package@ method as before.
|
85
|
+
Since this package is not an artifact and does not have a specification, it will not automatically install itself in the local repository or upload to a remote repository. For these, use the @package@ method as before.
|
114
86
|
|
115
|
-
Read more about "the package
|
116
|
-
method":packaging.html#specifying_and_referencing_packages.
|
87
|
+
Read more about "the package method":packaging.html#specifying_and_referencing_packages.
|
117
88
|
|
118
89
|
|
119
90
|
h3. Packaging EARs
|
@@ -133,44 +104,29 @@ package(:ear) << project('coolWebService').package(:war)
|
|
133
104
|
package(:ear).add project('commonLib') # By default, the JAR package
|
134
105
|
}}}
|
135
106
|
|
136
|
-
EAR packages include an @application.xml@ file in the @META-INF@ directory that
|
137
|
-
describes the application and its component. This file is created for you
|
138
|
-
during packaging, by referencing all the components added to the EAR. There
|
139
|
-
are a couple of things you will typically want to change.
|
107
|
+
EAR packages include an @application.xml@ file in the @META-INF@ directory that describes the application and its component. This file is created for you during packaging, by referencing all the components added to the EAR. There are a couple of things you will typically want to change.
|
140
108
|
|
141
|
-
* *display-name* -- The application's display name defaults to the project's
|
142
|
-
identifier. You can change that by setting the @display_name@ attribute.
|
109
|
+
* *display-name* -- The application's display name defaults to the project's identifier. You can change that by setting the @display_name@ attribute.
|
143
110
|
|
144
|
-
* *context-root* -- WAR components specify a context root, based on the package
|
145
|
-
identifier, for example, "cool-web-1.0.war" will have the context root
|
146
|
-
"cool-web". To specify a different context root, add the WAR package with the
|
147
|
-
@context_root@ option.
|
111
|
+
* *context-root* -- WAR components specify a context root, based on the package identifier, for example, "cool-web-1.0.war" will have the context root "cool-web". To specify a different context root, add the WAR package with the @context_root@ option.
|
148
112
|
|
149
113
|
"Read more ...":packaging.html#packaging_ears
|
150
114
|
|
151
115
|
|
152
116
|
h3. JRuby Support
|
153
117
|
|
154
|
-
We now offer two versions of Buildr, one for Ruby and one for JRuby. They're
|
155
|
-
exactly the same, except the Ruby version will also install RJB (Ruby Java
|
156
|
-
Bridge), the JRuby version obviously can do well without it.
|
118
|
+
We now offer two versions of Buildr, one for Ruby and one for JRuby. They're exactly the same, except the Ruby version will also install RJB (Ruby Java Bridge), the JRuby version obviously can do well without it.
|
157
119
|
|
158
120
|
"Read more ...":download.html#jruby
|
159
121
|
|
160
|
-
Buildr provides a "Nailgun":http://www.martiansoftware.com/nailgun/index.html
|
161
|
-
server when running on JRuby. Using the integrated BuildrServer allows for
|
162
|
-
faster task execution and avoid frequent JVM startup overhead.
|
122
|
+
Buildr provides a "Nailgun":http://www.martiansoftware.com/nailgun/index.html server when running on JRuby. Using the integrated BuildrServer allows for faster task execution and avoid frequent JVM startup overhead.
|
163
123
|
|
164
124
|
"Read more ...":more_stuff.html#nailgun
|
165
125
|
|
166
126
|
|
167
127
|
h3. Behaviour-Driven Development
|
168
128
|
|
169
|
-
Given that many languages are now supported by Buildr, the same is true for
|
170
|
-
testing, the convention is to store BDD files under the @src/spec/{lang}@
|
171
|
-
directory.
|
172
|
-
The following table shows the framework's name you can use to select them
|
173
|
-
for your projects. Buildr follows each framework's naming convention.
|
129
|
+
Given that many languages are now supported by Buildr, the same is true for testing, the convention is to store BDD files under the @src/spec/{lang}@ directory. The following table shows the framework's name you can use to select them for your projects. Buildr follows each framework's naming convention.
|
174
130
|
|
175
131
|
|_. test.using |_. Test file name convention |
|
176
132
|
| @:jbehave@ | @src/spec/java/**/*Behaviour.java@ |
|
@@ -182,12 +138,9 @@ for your projects. Buildr follows each framework's naming convention.
|
|
182
138
|
|
183
139
|
h3. Profiles
|
184
140
|
|
185
|
-
Different environments may require different configurations, some you will want
|
186
|
-
to control with code, others you will want to specify in the profiles file.
|
141
|
+
Different environments may require different configurations, some you will want to control with code, others you will want to specify in the profiles file.
|
187
142
|
|
188
|
-
The profiles file is a YAML file called @profiles.yaml@ that you place in the
|
189
|
-
same directory as the Buildfile. We selected YAML because it's easier to read
|
190
|
-
and edit than XML.
|
143
|
+
The profiles file is a YAML file called @profiles.yaml@ that you place in the same directory as the Buildfile. We selected YAML because it's easier to read and edit than XML.
|
191
144
|
|
192
145
|
For example, to support three different database configurations, we could write:
|
193
146
|
|
@@ -208,20 +161,16 @@ production:
|
|
208
161
|
jdbc: oracle:thin:@bigstrong:1521:mighty
|
209
162
|
}}}
|
210
163
|
|
211
|
-
You can also use profiles to specify default filters for the "@resources@
|
212
|
-
task":building.html#resources.
|
164
|
+
You can also use profiles to specify default filters for the "@resources@ task":building.html#resources.
|
213
165
|
|
214
166
|
"Read more ...":settings_profiles.html#profiles
|
215
167
|
|
216
168
|
|
217
169
|
h3. Settings and build YAML files
|
218
170
|
|
219
|
-
In addition to profiles, we also allow you to specify personal and build
|
220
|
-
settings using two YAML files.
|
171
|
+
In addition to profiles, we also allow you to specify personal and build settings using two YAML files.
|
221
172
|
|
222
|
-
Personal settings are placed in the @.buildr/settings.yaml@ file under your
|
223
|
-
home directory. Settings stored there will be applied the same across all
|
224
|
-
builds.
|
173
|
+
Personal settings are placed in the @.buildr/settings.yaml@ file under your home directory. Settings stored there will be applied the same across all builds.
|
225
174
|
|
226
175
|
For example:
|
227
176
|
|
@@ -247,10 +196,7 @@ im:
|
|
247
196
|
|
248
197
|
"Read more ...":settings_profiles.html#personal_settings
|
249
198
|
|
250
|
-
Build settings are placed in the @build.yaml@ file located in the same
|
251
|
-
directory that the @buildfile@. Normally this file would be managed by the
|
252
|
-
project revision control system, so settings here are shared between
|
253
|
-
developers.
|
199
|
+
Build settings are placed in the @build.yaml@ file located in the same directory that the @buildfile@. Normally this file would be managed by the project revision control system, so settings here are shared between developers.
|
254
200
|
|
255
201
|
For example:
|
256
202
|
|
@@ -280,23 +226,11 @@ jira:
|
|
280
226
|
|
281
227
|
h3. Using Gems for extensions and 3rd party libraries
|
282
228
|
|
283
|
-
"RubyGems":http://rubygems.rubyforge.org provides the @gem@ command line tool
|
284
|
-
that you can use to search, install, upgrade, package and distribute gems. It
|
285
|
-
installs all gems into a local repository that is shared across your builds and
|
286
|
-
all other Ruby applications you may have running. You can install a gem from a
|
287
|
-
local file, or download and install it from any number of remote repositories.
|
229
|
+
"RubyGems":http://rubygems.rubyforge.org provides the @gem@ command line tool that you can use to search, install, upgrade, package and distribute gems. It installs all gems into a local repository that is shared across your builds and all other Ruby applications you may have running. You can install a gem from a local file, or download and install it from any number of remote repositories.
|
288
230
|
|
289
|
-
If your build depends on other gems, you will want to specify these
|
290
|
-
dependencies as part of your build and check that configuration into source
|
291
|
-
control. That way you can have a specific environment that will guarantee
|
292
|
-
repeatable builds, whether you're building a particular version, moving between
|
293
|
-
branches, or joining an existing project. Buildr will take care of installing
|
294
|
-
all the necessary dependencies, which you can then manage with the @gem@
|
295
|
-
command.
|
231
|
+
If your build depends on other gems, you will want to specify these dependencies as part of your build and check that configuration into source control. That way you can have a specific environment that will guarantee repeatable builds, whether you're building a particular version, moving between branches, or joining an existing project. Buildr will take care of installing all the necessary dependencies, which you can then manage with the @gem@ command.
|
296
232
|
|
297
|
-
Use the @build.yaml@ file to specify these dependencies (see "Build
|
298
|
-
Settings":settings_profiles.html#build_settings for more information), for
|
299
|
-
example:
|
233
|
+
Use the @build.yaml@ file to specify these dependencies (see "Build Settings":settings_profiles.html#build_settings for more information), for example:
|
300
234
|
|
301
235
|
{{{!yaml
|
302
236
|
# This project requires the following gems
|
@@ -324,9 +258,7 @@ Java.java.lang.String.isInstance(str)
|
|
324
258
|
Java.com.sun.tools.javac.Main.compile(args)
|
325
259
|
}}}
|
326
260
|
|
327
|
-
The @classpath@ attribute allows Buildr to add JARs and directories to the
|
328
|
-
classpath, for example, we use it to load Ant and various Ant tasks, code
|
329
|
-
generators, test frameworks, and so forth.
|
261
|
+
The @classpath@ attribute allows Buildr to add JARs and directories to the classpath, for example, we use it to load Ant and various Ant tasks, code generators, test frameworks, and so forth.
|
330
262
|
|
331
263
|
For example, Ant is loaded as follows:
|
332
264
|
|
@@ -334,21 +266,14 @@ For example, Ant is loaded as follows:
|
|
334
266
|
Java.classpath << 'org.apache.ant:ant:jar:1.7.0'
|
335
267
|
}}}
|
336
268
|
|
337
|
-
Artifacts can only be downloaded after the Buildfile has loaded, giving it a
|
338
|
-
chance to specify which remote repositories to use, so adding to classpath does
|
339
|
-
not by itself load any libraries. You must call @Java.load@ before accessing any
|
340
|
-
Java classes to give Buildr a chance to load the libraries specified in the
|
341
|
-
classpath.
|
269
|
+
Artifacts can only be downloaded after the Buildfile has loaded, giving it a chance to specify which remote repositories to use, so adding to classpath does not by itself load any libraries. You must call @Java.load@ before accessing any Java classes to give Buildr a chance to load the libraries specified in the classpath.
|
342
270
|
|
343
271
|
"Read more ...":more_stuff.html#using_java_libraries
|
344
272
|
|
345
273
|
|
346
274
|
h3. Creating Extensions
|
347
275
|
|
348
|
-
A module defines instance methods that are then mixed into the project and
|
349
|
-
become instance methods of the project. There are two general ways for
|
350
|
-
extending projects. You can extend all projects by including the module in
|
351
|
-
Project:
|
276
|
+
A module defines instance methods that are then mixed into the project and become instance methods of the project. There are two general ways for extending projects. You can extend all projects by including the module in Project:
|
352
277
|
|
353
278
|
{{{!ruby
|
354
279
|
class Project
|
@@ -356,8 +281,7 @@ class Project
|
|
356
281
|
end
|
357
282
|
}}}
|
358
283
|
|
359
|
-
You can also extend a given project instance and only that instance by
|
360
|
-
extending it with the module:
|
284
|
+
You can also extend a given project instance and only that instance by extending it with the module:
|
361
285
|
|
362
286
|
{{{!ruby
|
363
287
|
define 'foo' do
|
@@ -365,57 +289,35 @@ define 'foo' do
|
|
365
289
|
end
|
366
290
|
}}}
|
367
291
|
|
368
|
-
Some extensions require tighter integration with the project, specifically for
|
369
|
-
setting up tasks and properties, or for configuring tasks based on the project
|
370
|
-
definition. You can do that by adding callbacks to the process.
|
292
|
+
Some extensions require tighter integration with the project, specifically for setting up tasks and properties, or for configuring tasks based on the project definition. You can do that by adding callbacks to the process.
|
371
293
|
|
372
294
|
"Read more ...":extending.html#creating_extensions
|
373
295
|
|
374
296
|
|
375
297
|
h3. Using Alternative Layouts
|
376
298
|
|
377
|
-
Buildr follows a common convention for project layouts: Java source files
|
378
|
-
appear in @src/main/java@ and compile to @target/classes@, resources are
|
379
|
-
copied over from @src/main/resources@ and so forth. Not all projects follow
|
380
|
-
this convention, so it's now possible to specify an alternative project
|
381
|
-
layout.
|
299
|
+
Buildr follows a common convention for project layouts: Java source files appear in @src/main/java@ and compile to @target/classes@, resources are copied over from @src/main/resources@ and so forth. Not all projects follow this convention, so it's now possible to specify an alternative project layout.
|
382
300
|
|
383
|
-
A layout is an object that implements the @expand@ method. The easiest way to
|
384
|
-
define a custom layout is to create a new @Layout@ object and specify mapping
|
385
|
-
between names used by Buildr and actual paths within the project.
|
301
|
+
A layout is an object that implements the @expand@ method. The easiest way to define a custom layout is to create a new @Layout@ object and specify mapping between names used by Buildr and actual paths within the project.
|
386
302
|
|
387
303
|
"Read more ...":extending.html#using_alternative_layouts
|
388
304
|
|
389
305
|
|
390
306
|
h3. Other
|
391
307
|
|
392
|
-
* Buildr 1.3 upgrades to Rake 0.8, RSpec 1.1, RJB 1.1 and OpenJPA
|
393
|
-
|
394
|
-
* JUnit tests now operate on all compiled test classes that extend
|
395
|
-
@junit.framework.TestCase@ or use the @Test@ annotation; TestNG test cases are
|
396
|
-
filtered by annotation. Test cases no longer have to use a specific file name.
|
308
|
+
* Buildr 1.3 upgrades to Rake 0.8, RSpec 1.1, RJB 1.1 and OpenJPA 1.0.1. Buildr no longer includes or uses Facets.
|
309
|
+
* JUnit tests now operate on all compiled test classes that extend @junit.framework.TestCase@ or use the @Test@ annotation; TestNG test cases are filtered by annotation. Test cases no longer have to use a specific file name.
|
397
310
|
* Remote repositories now support HTTP Basic Authentication.
|
398
|
-
* The prepare task has been removed, if you need to, simply add a prerequisite
|
399
|
-
to the compile task.
|
311
|
+
* The prepare task has been removed, if you need to, simply add a prerequisite to the compile task.
|
400
312
|
|
401
313
|
|
402
314
|
h3. Documentation
|
403
315
|
|
404
|
-
* The "What's new?":whats_new.html page (this one, actually), summarizes all
|
405
|
-
|
406
|
-
* The "
|
407
|
-
|
408
|
-
|
409
|
-
* The "Troubleshooting":troubleshooting.html page (also available in the PDF)
|
410
|
-
collects troubleshooting ideas from the mailing list.
|
411
|
-
* The "Getting Started":getting_started.html has been rewritten to cover all
|
412
|
-
you need to know about downloading and installing Buildr on Linux, OS/X,
|
413
|
-
Windows and with JRuby (1.1 or later).
|
414
|
-
* A new "Contributing":contributing.html page has more details on how to file
|
415
|
-
bugs, policy for submitting patches, running Buildr test cases, and helping
|
416
|
-
with the documentation.
|
316
|
+
* The "What's new?":whats_new.html page (this one, actually), summarizes all the important new features and changes in each release.
|
317
|
+
* The "Recipes":recipes.html page (also available in the PDF) lists recipes for using Buildr, collected from the mailing list. Feel free to contribute tips, tricks and techniques.
|
318
|
+
* The "Troubleshooting":troubleshooting.html page (also available in the PDF) collects troubleshooting ideas from the mailing list.
|
319
|
+
* The "Getting Started":getting_started.html has been rewritten to cover all you need to know about downloading and installing Buildr on Linux, OS X, Windows and with JRuby (1.1 or later).
|
320
|
+
* A new "Contributing":contributing.html page has more details on how to file bugs, policy for submitting patches, running Buildr test cases, and helping with the documentation.
|
417
321
|
* A new page for "Settings and Profiles":settings_profiles.html.
|
418
|
-
* The "Extending Buildr":extending.html page that deals with writing your own
|
419
|
-
|
420
|
-
* The site also includes "RSpec report":specs.html which provides the official
|
421
|
-
specification against which we test each release.
|
322
|
+
* The "Extending Buildr":extending.html page that deals with writing your own tasks, creating extensions and specifying alternative layouts.
|
323
|
+
* The site also includes "RSpec report":specs.html which provides the official specification against which we test each release.
|