buildr 1.4.7-x86-mswin32 → 1.4.8-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +41 -0
- data/Rakefile +0 -6
- data/addon/buildr/bnd.rb +13 -3
- data/addon/buildr/checkstyle.rb +1 -1
- data/addon/buildr/git_auto_version.rb +33 -0
- data/addon/buildr/{gwt.rake → gwt.rb} +0 -0
- data/addon/buildr/jacoco.rb +194 -0
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +23 -16
- data/doc/_layouts/default.html +0 -2
- data/doc/contributing.textile +47 -0
- data/doc/download.textile +24 -0
- data/doc/index.textile +43 -23
- data/doc/languages.textile +65 -6
- data/doc/more_stuff.textile +12 -0
- data/doc/packaging.textile +2 -0
- data/doc/settings_profiles.textile +1 -1
- data/lib/buildr.rb +0 -4
- data/lib/buildr/core/application.rb +41 -8
- data/lib/buildr/core/build.rb +102 -1
- data/lib/buildr/core/cc.rb +14 -8
- data/lib/buildr/core/generate.rb +148 -7
- data/lib/buildr/core/util.rb +3 -3
- data/lib/buildr/ide/eclipse.rb +114 -0
- data/lib/buildr/ide/idea.rb +95 -1
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/rjb.rb +5 -4
- data/lib/buildr/packaging/artifact.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -2
- data/lib/buildr/scala.rb +1 -1
- data/lib/buildr/scala/bdd.rb +9 -2
- data/lib/buildr/scala/compiler.rb +94 -4
- data/lib/buildr/scala/doc.rb +17 -5
- data/lib/buildr/scala/tests.rb +15 -4
- data/lib/buildr/version.rb +1 -1
- data/rakelib/all-in-one.rake +50 -47
- data/rakelib/checks.rake +4 -4
- data/rakelib/doc.rake +85 -88
- data/rakelib/metrics.rake +9 -9
- data/rakelib/package.rake +13 -34
- data/rakelib/release.rake +11 -12
- data/rakelib/rspec.rake +71 -76
- data/rakelib/stage.rake +25 -51
- data/spec/addon/bnd_spec.rb +61 -7
- data/spec/core/build_spec.rb +117 -0
- data/spec/core/cc_spec.rb +36 -22
- data/spec/core/common_spec.rb +3 -2
- data/spec/core/compile_spec.rb +3 -3
- data/spec/core/generate_from_eclipse_spec.rb +280 -0
- data/spec/java/bdd_spec.rb +2 -2
- data/spec/java/packaging_spec.rb +2 -1
- data/spec/packaging/archive_spec.rb +25 -2
- data/spec/packaging/artifact_spec.rb +2 -2
- data/spec/sandbox.rb +3 -2
- data/spec/scala/compiler_spec.rb +41 -0
- data/spec/scala/doc_spec.rb +22 -3
- data/spec/scala/scala.rb +2 -2
- data/spec/scala/tests_spec.rb +2 -2
- metadata +223 -194
- data/addon/buildr/jdepend.rb.orig +0 -178
- data/doc/installing.textile.orig +0 -282
- data/doc/more_stuff.textile.orig +0 -1004
- data/lib/buildr/ide/eclipse/java.rb +0 -49
- data/lib/buildr/ide/eclipse/plugin.rb +0 -67
- data/lib/buildr/ide/eclipse/scala.rb +0 -64
@@ -1,178 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
-
# work for additional information regarding copyright ownership. The ASF
|
4
|
-
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations under
|
14
|
-
# the License.
|
15
|
-
|
16
|
-
module Buildr
|
17
|
-
# Addes the <code>projectname:jdepend:swing</code>, <code>projectname:jdepend:text</code> and
|
18
|
-
# <code>projectname:jdepend:xml</code> tasks.
|
19
|
-
#
|
20
|
-
# Require explicitly using <code>require "buildr/jdepend"</code>.
|
21
|
-
module JDepend
|
22
|
-
|
23
|
-
class << self
|
24
|
-
|
25
|
-
# The specs for requirements
|
26
|
-
def dependencies
|
27
|
-
[
|
28
|
-
'jdepend:jdepend:jar:2.9.1'
|
29
|
-
]
|
30
|
-
end
|
31
|
-
|
32
|
-
def jdepend(output_file, target_paths, options = {})
|
33
|
-
dependencies = (options[:dependencies] || []) + self.dependencies
|
34
|
-
cp = Buildr.artifacts(dependencies).each(&:invoke).map(&:to_s)
|
35
|
-
|
36
|
-
args = []
|
37
|
-
if output_file
|
38
|
-
args << "-file"
|
39
|
-
args << output_file
|
40
|
-
end
|
41
|
-
target_paths.each do |target_path|
|
42
|
-
file(target_path).invoke
|
43
|
-
<<<<<<< HEAD
|
44
|
-
args << target_path
|
45
|
-
=======
|
46
|
-
args << target_path.to_s
|
47
|
-
>>>>>>> 28deb000947f13d5df722228ed2bc24fdcb303d3
|
48
|
-
end
|
49
|
-
|
50
|
-
# If no output file then we must be trying to run the swing app
|
51
|
-
command = output_file ? 'jdepend.xmlui.JDepend' : 'jdepend.swingui.JDepend'
|
52
|
-
|
53
|
-
begin
|
54
|
-
Java::Commands.java command, *(args + [{:classpath => cp, :properties => options[:properties], :java_args => options[:java_args]}])
|
55
|
-
rescue => e
|
56
|
-
raise e if options[:fail_on_error]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
class Config
|
62
|
-
def enabled?
|
63
|
-
!!@enabled
|
64
|
-
end
|
65
|
-
|
66
|
-
attr_writer :enabled
|
67
|
-
|
68
|
-
def html_enabled?
|
69
|
-
File.exist?(self.style_file)
|
70
|
-
end
|
71
|
-
|
72
|
-
attr_writer :config_directory
|
73
|
-
|
74
|
-
def config_directory
|
75
|
-
@config_directory || project._(:source, :main, :etc, :jdepend)
|
76
|
-
end
|
77
|
-
|
78
|
-
attr_writer :report_dir
|
79
|
-
|
80
|
-
def report_dir
|
81
|
-
@report_dir || project._(:reports, :jdepend)
|
82
|
-
end
|
83
|
-
|
84
|
-
attr_writer :fail_on_error
|
85
|
-
|
86
|
-
def fail_on_error?
|
87
|
-
@fail_on_error.nil? ? false : @fail_on_error
|
88
|
-
end
|
89
|
-
|
90
|
-
attr_writer :xml_output_file
|
91
|
-
|
92
|
-
def xml_output_file
|
93
|
-
@xml_output_file || "#{self.report_dir}/jdepend.xml"
|
94
|
-
end
|
95
|
-
|
96
|
-
attr_writer :html_output_file
|
97
|
-
|
98
|
-
def html_output_file
|
99
|
-
@html_output_file || "#{self.report_dir}/jdepend.html"
|
100
|
-
end
|
101
|
-
|
102
|
-
attr_writer :style_file
|
103
|
-
|
104
|
-
def style_file
|
105
|
-
@style_file || "#{self.config_directory}/jdepend.xsl"
|
106
|
-
end
|
107
|
-
|
108
|
-
def target_paths
|
109
|
-
@target_paths ||= [self.project.compile.target, self.project.test.compile.target]
|
110
|
-
end
|
111
|
-
|
112
|
-
def to_options
|
113
|
-
{
|
114
|
-
:fail_on_error => project.jdepend.fail_on_error?,
|
115
|
-
# Set user home so that jdepend.properties will be loaded from there if present
|
116
|
-
:properties => { 'user.home' => project.jdepend.config_directory }
|
117
|
-
}
|
118
|
-
end
|
119
|
-
|
120
|
-
protected
|
121
|
-
|
122
|
-
def initialize(project)
|
123
|
-
@project = project
|
124
|
-
end
|
125
|
-
|
126
|
-
attr_reader :project
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
module ProjectExtension
|
131
|
-
include Extension
|
132
|
-
|
133
|
-
def jdepend
|
134
|
-
@jdepend ||= Buildr::JDepend::Config.new(project)
|
135
|
-
end
|
136
|
-
|
137
|
-
after_define do |project|
|
138
|
-
if project.jdepend.enabled?
|
139
|
-
desc "Generate JDepend xml report."
|
140
|
-
project.task("jdepend:xml") do
|
141
|
-
puts "JDepend: Analyzing source code..."
|
142
|
-
mkdir_p File.dirname(project.jdepend.xml_output_file)
|
143
|
-
Buildr::JDepend.jdepend(project.jdepend.xml_output_file,
|
144
|
-
project.jdepend.target_paths.flatten.compact,
|
145
|
-
project.jdepend.to_options)
|
146
|
-
end
|
147
|
-
|
148
|
-
desc "Run JDepend with Swing UI."
|
149
|
-
project.task("jdepend:swing") do
|
150
|
-
puts "JDepend: Analyzing source code..."
|
151
|
-
Buildr::JDepend.jdepend(nil,
|
152
|
-
project.jdepend.target_paths.flatten.compact,
|
153
|
-
project.jdepend.to_options)
|
154
|
-
end
|
155
|
-
|
156
|
-
if project.jdepend.html_enabled?
|
157
|
-
xml_task = project.task("jdepend:xml")
|
158
|
-
desc "Generate JDepend html report."
|
159
|
-
project.task("jdepend:html" => xml_task) do
|
160
|
-
puts "JDepend: Generating report"
|
161
|
-
mkdir_p File.dirname(project.jdepend.html_output_file)
|
162
|
-
Buildr.ant "jdepend" do |ant|
|
163
|
-
ant.xslt :in => project.jdepend.xml_output_file,
|
164
|
-
:out => project.jdepend.html_output_file,
|
165
|
-
:style => project.jdepend.style_file
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
class Buildr::Project
|
177
|
-
include Buildr::JDepend::ProjectExtension
|
178
|
-
end
|
data/doc/installing.textile.orig
DELETED
@@ -1,282 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: default
|
3
|
-
title: Installing and Running
|
4
|
-
---
|
5
|
-
|
6
|
-
|
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.
|
8
|
-
|
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.
|
10
|
-
|
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.
|
12
|
-
|
13
|
-
<br>
|
14
|
-
|
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.
|
16
|
-
|
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@, @yum@ or @urpmi@) and upgrade to RubyGems 1.3.1 or later.
|
24
|
-
|
25
|
-
<br>
|
26
|
-
|
27
|
-
*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).
|
28
|
-
|
29
|
-
On *RedHat/Fedora* you can use yum to install Ruby and RubyGems, and then upgrade to the most recent version of RubyGems:
|
30
|
-
|
31
|
-
{% highlight sh %}
|
32
|
-
$ sudo yum install ruby rubygems ruby-devel gcc
|
33
|
-
$ sudo gem update --system
|
34
|
-
{% endhighlight %}
|
35
|
-
|
36
|
-
On *Ubuntu* you have to install several packages:
|
37
|
-
|
38
|
-
{% highlight sh %}
|
39
|
-
$ sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential
|
40
|
-
{% endhighlight %}
|
41
|
-
|
42
|
-
If using Ubuntu 9.10 or earlier, the Debian package for @rubygems@ will not allow you to install Buildr, so you need to install RubyGems from source:
|
43
|
-
|
44
|
-
{% highlight sh %}
|
45
|
-
$ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
|
46
|
-
$ tar xzf rubygems-1.3.1.tgz
|
47
|
-
$ cd rubygems-1.3.1
|
48
|
-
$ sudo ruby setup.rb
|
49
|
-
$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
|
50
|
-
{% endhighlight %}
|
51
|
-
|
52
|
-
Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
|
53
|
-
|
54
|
-
{% highlight sh %}
|
55
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
56
|
-
{% endhighlight %}
|
57
|
-
|
58
|
-
To upgrade to a new version or install a specific version:
|
59
|
-
|
60
|
-
{% highlight sh %}
|
61
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
|
62
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.4.3
|
63
|
-
{% endhighlight %}
|
64
|
-
|
65
|
-
|
66
|
-
h2(#osx). Installing on OS X
|
67
|
-
|
68
|
-
*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.
|
69
|
-
|
70
|
-
You need to have the Apple Development Tools installed. They are available on the Mac OSX installation CD.
|
71
|
-
|
72
|
-
p(note). Java Update 3 for Snow Leopard removes header files necessary to compile the native Ruby-Java Bridge (RJB) gem, so installing rjb gem may fail on OS X. The solution is to install Java for Mac OS X 10.6 Update 3 Developer Package from http://connect.apple.com before @gem install@.
|
73
|
-
|
74
|
-
*Using RVM?* If you're not using the built-in ruby on OS X (e.g., if you're using RVM), you'll need to force-install the platform-independent RJB:
|
75
|
-
|
76
|
-
{% highlight sh %}
|
77
|
-
$ gem install rjb -v 1.3.3 --platform ruby
|
78
|
-
{% endhighlight %}
|
79
|
-
|
80
|
-
The darwin pre-built binary seems to only work with the built-in ruby.
|
81
|
-
|
82
|
-
<br>
|
83
|
-
|
84
|
-
*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.
|
85
|
-
|
86
|
-
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/.
|
87
|
-
|
88
|
-
We recommend you first upgrade to the latest version of Ruby gems:
|
89
|
-
|
90
|
-
{% highlight sh %}
|
91
|
-
$ sudo gem update --system
|
92
|
-
{% endhighlight %}
|
93
|
-
|
94
|
-
Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution:
|
95
|
-
|
96
|
-
{% highlight sh %}
|
97
|
-
$ export JAVA_HOME=/Library/Java/Home
|
98
|
-
{% endhighlight %}
|
99
|
-
|
100
|
-
To install Buildr:
|
101
|
-
|
102
|
-
{% highlight sh %}
|
103
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr
|
104
|
-
{% endhighlight %}
|
105
|
-
|
106
|
-
To upgrade to a new version or install a specific version:
|
107
|
-
|
108
|
-
{% highlight sh %}
|
109
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem update buildr
|
110
|
-
$ sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.3.4
|
111
|
-
{% endhighlight %}
|
112
|
-
|
113
|
-
h2(#windows). Installing on Windows
|
114
|
-
|
115
|
-
*The easy way:* The easiest way to install Ruby is using the "one-click installer":http://rubyinstaller.rubyforge.org/. Be sure to install Ruby 1.8.6; support for Ruby 1.9.x is still a work in progress. Once installed, set the @JAVA_HOME@ environment variable and run @gem install buildr --platform mswin32@.
|
116
|
-
|
117
|
-
<br>
|
118
|
-
|
119
|
-
*In details:* Before installing Buildr, please set the @JAVA_HOME@ environment variable to point to your JDK distribution. Next, use Ruby Gem to install Buildr:
|
120
|
-
|
121
|
-
{% highlight sh %}
|
122
|
-
> gem install buildr --platform mswin32
|
123
|
-
{% endhighlight %}
|
124
|
-
|
125
|
-
To upgrade to a new version or install a specific version:
|
126
|
-
|
127
|
-
{% highlight sh %}
|
128
|
-
> gem update buildr
|
129
|
-
> gem install buildr -v 1.3.4 --platform mswin32
|
130
|
-
{% endhighlight %}
|
131
|
-
|
132
|
-
h2(#jruby). Installing for JRuby
|
133
|
-
|
134
|
-
*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.6.1 in @/opt/jruby@ and update the @PATH@ variable in @~/.bash_profile@ or @~/.profile@.
|
135
|
-
|
136
|
-
<br>
|
137
|
-
|
138
|
-
*In details:* If you don't already have JRuby 1.5.1 or later installed, you can download it from the "JRuby site":http://www.jruby.org/download.
|
139
|
-
|
140
|
-
After uncompressing JRuby, update your @PATH@ to include both @java@ and @jruby@ executables.
|
141
|
-
|
142
|
-
For Linux and OS X:
|
143
|
-
|
144
|
-
{% highlight sh %}
|
145
|
-
$ export PATH=$PATH:[path to JRuby]/bin:$JAVA_HOME/bin
|
146
|
-
$ jruby -S gem install buildr
|
147
|
-
{% endhighlight %}
|
148
|
-
|
149
|
-
For Windows:
|
150
|
-
|
151
|
-
{% highlight sh %}
|
152
|
-
> set PATH=%PATH%;[path to JRuby]/bin;%JAVA_HOME%/bin
|
153
|
-
> jruby -S gem install buildr
|
154
|
-
{% endhighlight %}
|
155
|
-
|
156
|
-
To upgrade to a new version or install a specific version:
|
157
|
-
|
158
|
-
{% highlight sh %}
|
159
|
-
$ jruby -S gem update buildr
|
160
|
-
$ jruby -S gem install buildr -v 1.3.4
|
161
|
-
{% endhighlight %}
|
162
|
-
|
163
|
-
|
164
|
-
*Important: Running JRuby and Ruby side by side*
|
165
|
-
|
166
|
-
Ruby and JRuby maintain separate Gem repositories, and in fact install slightly different versions of the Buildr Gem (same functionality, different dependencies). Installing Buildr for Ruby does not install it for JRuby and vice versa.
|
167
|
-
|
168
|
-
If you have JRuby installed but not Ruby, the @gem@ and @buildr@ commands will use JRuby. If you have both JRuby and Ruby installed, follow the instructions below. To find out if you have Ruby installed (some operating systems include it by default), run @ruby --version@ from the command line.
|
169
|
-
|
170
|
-
To work exclusively with JRuby, make sure it shows first on the path, for example, by setting @PATH=/opt/jruby/bin:$PATH@.
|
171
|
-
|
172
|
-
You can use JRuby and Ruby side by side, by running scripts with the @-S@ command line argument. For example:
|
173
|
-
|
174
|
-
{% highlight sh %}
|
175
|
-
$ # with Ruby
|
176
|
-
$ ruby -S gem install buildr
|
177
|
-
$ ruby -S buildr
|
178
|
-
$ # with JRuby
|
179
|
-
$ jruby -S gem install buildr
|
180
|
-
$ jruby -S buildr
|
181
|
-
{% endhighlight %}
|
182
|
-
|
183
|
-
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.
|
184
|
-
|
185
|
-
h2. Using multiple versions of Buildr
|
186
|
-
|
187
|
-
Rubygems makes it possible to install several versions of Buildr side-by-side on the same system. If you want to run a specific version, you can do so by adding the version number between underscores ('_') as the first command-line parameter. For example,
|
188
|
-
|
189
|
-
{% highlight sh %}
|
190
|
-
$ buildr _1.3.4_ clean # runs Buildr v1.3.4
|
191
|
-
|
192
|
-
$ buildr _1.4.4_ clean # runs Buildr v1.4.4
|
193
|
-
{% endhighlight %}
|
194
|
-
|
195
|
-
p(note). There are two `buildr` executables installed by Rubygems. One script serves to select the specified (or default) version of Buildr and is typically found under `/usr/bin/buildr` or `/var/lib/gems/1.8/bin/buildr`. The exact location will vary depending on your system. The other script is the Buildr bootstrap per se and can be found under the specific version of Buildr, e.g, `/var/lib/gems/1.8/gems/buildr-1.4.0/bin/buildr`. The first script should be on your `PATH`. The second script should not be called directly and should not be on your `PATH`.
|
196
|
-
|
197
|
-
h2(#running). Running Buildr
|
198
|
-
|
199
|
-
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@.
|
200
|
-
|
201
|
-
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@.
|
202
|
-
|
203
|
-
You use Buildr by running the @buildr@ command:
|
204
|
-
|
205
|
-
{% highlight sh %}
|
206
|
-
$ buildr [options] [tasks] [name=value]
|
207
|
-
{% endhighlight %}
|
208
|
-
|
209
|
-
There are several options you can use, for a full list of options type @buildr --help@:
|
210
|
-
|
211
|
-
|_. Option |_. Usage |
|
212
|
-
| @-f/--buildfile [file]@ | Specify the buildfile. |
|
213
|
-
| @-e/--environment [name]@ | Environment name (e.g. development, test, production). |
|
214
|
-
| @-h/--help@ | Display this help message. |
|
215
|
-
| @-n/--nosearch@ | Do not search parent directories for the buildfile. |
|
216
|
-
| @-q/--quiet@ | Do not log messages to standard output. |
|
217
|
-
| @-r/--require [file]@ | Require MODULE before executing buildfile. |
|
218
|
-
| @-t/--trace@ | Turn on invoke/execute tracing, enable full backtrace. |
|
219
|
-
<<<<<<< HEAD
|
220
|
-
=======
|
221
|
-
| @-v/--verbose@ | Log message to standard output |
|
222
|
-
>>>>>>> Fix -V (capital V) to display program version
|
223
|
-
| @-V/--version@ | Display the program version. |
|
224
|
-
| @-P/--prereqs@ | Display tasks and dependencies, then exit. |
|
225
|
-
|
226
|
-
You can tell Buildr to run specific tasks and the order to run them. For example:
|
227
|
-
|
228
|
-
{% highlight sh %}
|
229
|
-
# Clean and rebuild
|
230
|
-
buildr clean build
|
231
|
-
# Package and install
|
232
|
-
buildr install
|
233
|
-
{% endhighlight %}
|
234
|
-
|
235
|
-
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@.
|
236
|
-
|
237
|
-
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.
|
238
|
-
|
239
|
-
For example:
|
240
|
-
|
241
|
-
{% highlight sh %}
|
242
|
-
$ export JAVA_OPTS='-Xms1g -Xmx1g'
|
243
|
-
$ buildr TEST=no
|
244
|
-
{% endhighlight %}
|
245
|
-
|
246
|
-
|
247
|
-
h2(#help). Help Tasks
|
248
|
-
|
249
|
-
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@.
|
250
|
-
|
251
|
-
To start with, type:
|
252
|
-
|
253
|
-
{% highlight sh %}
|
254
|
-
$ buildr help
|
255
|
-
{% endhighlight %}
|
256
|
-
|
257
|
-
You can list the name and description of all your projects using the @help:projects@ task. For example:
|
258
|
-
|
259
|
-
{% highlight sh %}
|
260
|
-
$ buildr help:projects
|
261
|
-
killer-app # Code. Build. ??? Profit!
|
262
|
-
killer-app:teh-api # Abstract classes and interfaces
|
263
|
-
killer-app:teh-impl # All those implementation details
|
264
|
-
killer-app:la-web # What our users see
|
265
|
-
{% endhighlight %}
|
266
|
-
|
267
|
-
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.
|
268
|
-
|
269
|
-
So next let's talk about "projects":projects.html.
|
270
|
-
|
271
|
-
|
272
|
-
h2(#more). Learning More
|
273
|
-
|
274
|
-
*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_.
|
275
|
-
|
276
|
-
For a quicker read (and much more humor), "Why’s (Poignant) Guide to Ruby":http://poignantguide.net/ruby/ is available online. More resources are listed on the "ruby-lang web site":http://www.ruby-lang.org/en/documentation/.
|
277
|
-
|
278
|
-
*Rake* Buildr is based on Rake, a Ruby build system that handles tasks and dependencies. Check out the "Rake documentation":http://docs.rubyrake.org/ for more information.
|
279
|
-
|
280
|
-
*AntWrap* Buildr uses AntWrap, for configuring and running Ant tasks. You can learn more from the "Antwrap documentation":http://antwrap.rubyforge.org/.
|
281
|
-
|
282
|
-
*YAML* Buildr uses YAML for its profiles. You can "learn more about YAML here":http://www.yaml.org, and use this handy "YAML quick reference":http://www.yaml.org/refcard.html.
|