Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/rake/trunk@409 5af023f1-ac1a-0410-98d6-829a145c37ef
  • Loading branch information
jimweirich committed Apr 9, 2005
1 parent ddd28f9 commit cdd66db
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 1 deletion.
35 changes: 34 additions & 1 deletion rake/doc/rakefile.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,47 @@ The following rule might be used for Java files ...
<b>NOTE:</b> +java_compile+ is a hypothetical method that invokes the
java compiler.

== Importing Dependencies

Any ruby file (including other rakefiles) can be included with a
standard Ruby +require+ command. The rules and declarations in the
required file are just added to the definitions already accumulated.

Because the files are loaded _before_ the rake targets are evaluated,
the loaded files must be "ready to go" when the rake command is
invoked. This make generated dependency files difficult to use. By
the time rake gets around to updating the dependencies file, it is too
late to load it.

The +import+ command addresses this by specifying a file to be loaded
_after_ the main rakefile is loaded, but _before_ any targets on the
command line are specified. In addition, if the file name matches an
explicit task, that task is invoked before loading the file. This
allows dependency files to be generated and used in a single rake
command invocation.

=== Example:

require 'rake/loaders/makefile'

file ".depends.mf" => [SRC_LIST] do |t|
sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites} > #{t.name}"
end

import ".depends.mf"

If ".depends" does not exist, or is out of date w.r.t. the source
files, a new ".depends" file is generated using +makedepend+ before
loading.

== Comments

Standard Ruby comments (beginning with "#") can be used anywhere it is
legal in Ruby source code, including comments for tasks and rules.
However, if you wish a task to be described using the "-T" switch,
then you need to use the +desc+ command to describe the task.

Example:
=== Example:

desc "Create a distribution package"
task :package => [ ... ] do ... end
Expand Down
78 changes: 78 additions & 0 deletions rake/doc/release_notes/rake-0.5.3.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
= Rake 0.5.0 Released

Although it has only been two weeks since the last release, we have
enough updates to the Rake program to make it time for another
release.

== Changes

Here are the changes for version 0.5.3 ...

* FileLists have been extensively changed so that they mimic the
behavior of real arrays even more closely. In particular,
operations on FileLists that return a new collection (e.g. collect,
reject) will now return a FileList rather than an array. In
addition, several places where FileLists were not properly expanded
before use have been fixed.

* A method (+ext+) to simplify the handling of file extensions was
added to String and to Array.

* The 'testrb' script in test/unit tends to silently swallow syntax
errors in test suites. Because of that, the default test loader is
now a rake-provided script. You can still use 'testrb' by setting
the loader flag in the test task to :testrb. (See the API documents
for TestTask for all the loader flag values).

* FileUtil methods (e.g. cp, mv, install) are now declared to be
private. This will cut down on the interference with user defined
methods of the same name.

* Fixed the verbose flag in the TestTask so that the test code is
controlled by the flag. Also shortened up some failure messages.
(Thanks to Tobias Luetke for the suggestion).

* Rules will now properly detect a task that can generate a source
file. Previously rules would only consider source files that were
already present.

* Added an +import+ command that allows Rake to dynamically import
dependendencies into a running Rake session. The +import+ command
can run tasks to update the dependency file before loading them.
Dependency files can be in rake or make format, allowing rake to
work with tools designed to generate dependencies for make.

== What is Rake

Rake is a build tool similar to the make program in many ways. But
instead of cryptic make recipes, Rake uses standard Ruby code to
declare tasks and dependencies. You have the full power of a modern
scripting language built right into your build tool.

== Availability

The easiest way to get and install rake is via RubyGems ...

gem install rake (you may need root/admin privileges)

Otherwise, you can get it from the more traditional places:

Home Page:: http://rake.rubyforge.org/
Download:: http://rubyforge.org/project/showfiles.php?group_id=50

== Thanks

As usual, it was input from users that drove a alot of these changes.
Thanks to ...

* Brian Gernhardt for the rules fix (especially for the patience to
explain the problem to me until I got what he was talking about).
* Stefan Lang for pointing out problems in the dark corners of the
FileList implementation.
* Alexey Verkhovsky pointing out the silently swallows syntax errors
in tests.
* Tobias Luetke for beautifying the test task output.
* Sam Roberts for some of the ideas behind dependency loading.

-- Jim Weirich

0 comments on commit cdd66db

Please sign in to comment.