= Rant -- Ruby's ant
Rant is a flexible build tool written entirely in Ruby.
The equivalent to a _Makefile_ for _make_ is the _Rantfile_. An
_Rantfile_ is actually a valid Ruby script that is read in by the
_rant_ command.
Rant currently features:
* Rantfiles are written in Ruby.
* Defining custom tasks
* Automated packaging, testing and RDoc generation for Ruby
applications and libraries.
* Primitive support for compiling C# sources portably with csc, cscc
and mcs.
* A _configure_ plugin for easy environment and build-parameter
checking (but not like autoconf!) which saves data in a yaml file.
* The rant-import command creates a monolithic rant script,
so you don't depend on an rant installation anymore.
As programmers usually want to see code, here is a short and very
basic example of rant usage:
A file called +Rantfile+ contains the code:
file "backup/data" => "data" do |t|
sys.cp "data", t.name
end
Running rant in the directory of this file:
% rant
cp data backup/data
will ensure that the "data" file in the "backup" directory is up to
date.
This document was written for version 0.3.4 of Rant. Most things
described here will work for older/newer versions of Rant, but look at
the README file in the Rant distribution you've installed for exact
documentation of your Rant version.
== Support
The newest version of this document can be found at
http://make.rubyforge.org.
For further information, feature requests, bugreports or comments
visit the
{RubyForge site for Rant}[http://rubyforge.org/projects/make/].
Also feel free to contact the author directly by sending an email to
mailto:langstefan@gmx.at.
== Roadmap
Installing Rant::
read the section _Installation_ in this document
License::
read the section _Copying_ in this document
Invoking *rant*::
read doc/rant.rdoc[link:files/doc/rant_rdoc.html]
Writing an *Rantfile*::
read doc/rantfile.rdoc[link:files/doc/rantfile_rdoc.html]
Automation for your Ruby library/application::
read doc/rubyproject.rdoc[link:files/doc/rubyproject_rdoc.html]
Independent from Rant? The rant-import command::
read doc/rant-import.rdoc[link:files/doc/rant-import_rdoc.html]
Using the Configure plugin::
read doc/configure.rdoc[link:files/doc/configure_rdoc.html]
Compiling C#::
read doc/csharp.rdoc[link:files/doc/csharp_rdoc.html]
Upgrading::
read the NEWS[link:files/NEWS.html] for new features, not
backwards compatible changes and other issues.
== Installation
Of course you need Ruby to run rant. You can get the latest Ruby
package from the {Ruby hompage}[http://www.ruby-lang.org/en/].
There are two ways to install Rant on your system:
=== Installing Rant as a RubyGem
RubyGems has to be installed on your system. Check this by trying
the _gem_ command:
% gem
If this prints a help message, RubyGems should work. Otherwise
install Rant as described in the next section.
Now the following command:
% gem install --remote rant
will download and install Rant. Depending on the RubyGems
configuration, you will probably need superuser privileges.
Then try to run:
% rant --version
which should print name and version of the _rant_ command. If this
is done, you have successfully installed Rant. Congratulations!
=== Conventional installation
First download the latest version of Rant from
http://rubyforge.org/frs/?group_id=615. Choose the .zip or .tar.gz
file, whatever you like, with the highest version number. Then unpack
the archive, cd to the new directory and run the install.rb script.
This could look like:
% tar -xzf rant-.tar.gz
% cd rant-
% ruby install.rb
Depending on your Ruby installation, you'll probably need superuser
privileges for the last command.
Finally try to run
% rant --version
to verify Rant was installed correctly.
If you aren't already reading this documentation in html format, you
can generate it with:
% rant doc
The output will be in doc/html.
== Copying
Copyright (C) 2005 Stefan Lang
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
The file COPYING[link:../../COPYING] in the Rant package contains a
copy of the LGPL. Of course your Rantfiles don't need to be licenced
under the terms of the LGPL.
== Other info
Rant was started in February 2005. It has been written and is
maintained by Stefan Lang (mailto:langstefan@gmx.at).
=== Why did you write another build tool?
Because I wasn't satisfied by any other build tool. Before I started
Rant, I had to write a program in C#. The program had to run under
Windows, but I wanted to develop under Linux. Also I decided to write
the documentation in Docbook.
So there where quite a few problems arising:
* I had to compile with cscc on Linux.
* compile with csc on Windows.
* automate PDF and HTML generation from Docbook
_Nant_ would have been ok to compile the C# sources. But it isn't
suited for more general tasks as clueing togheter other programs
(needed for Docbook processing).
Then I tried to use _Rake_ and it was the other way round. I liked the
basic concept and syntax of Rake and of course I could have written
code for Rake (e.g. with a so called _Tasklib_) to support portable C#
compilation. But it was a bit quirky and because I like to work with
Ruby, I decided to write my own build tool.
Rant has taken the basic syntax of a _task_ and some other concepts
from Rake.
So thanks to Jim Weirich, the author of
Rake[http://rubyforge.org/projects/rake].
=== Goals of Rant
* Most important is to be a very *flexible* build tool. This currently
means that you can run/use Rant in many different ways. E.g. you can
invoke it the conventional way like _make_, define tasks and run
Rant from _irb_ (the interactive Ruby shell), create an independent
script with rant-import, or simply use Rant as a library to
automate tasks for your application.
* *Extensible*: currently through _plugins_ and _generators_. (Think
of the +plugin+ and +import+ functions.)
* Portability: see _Platforms_ below for details
* Well scaling: Rant should work acceptable for bigger projects (from
a performance POV and for the writer of the Rantfiles).
=== Platforms
Rant was tested on:
System Ruby version
=======================================================
Linux 1.8.2
1.9
MacOS X 1.8.2
Windows XP 1.8.2 (OneClick Installer)
Windows 2000 1.8.2 (OneClick Installer)
It *should* run on most platforms where Ruby runs, but you never
know...
If you encounter problems with Rant on any platform (with Ruby 1.8.1
or higher) please write a bugreport!