Skip to content

Commit cdd66db

Browse files
author
jimweirich
committed
updated documentation
git-svn-id: svn+ssh://rubyforge.org/var/svn/rake/trunk@409 5af023f1-ac1a-0410-98d6-829a145c37ef
1 parent ddd28f9 commit cdd66db

File tree

2 files changed

+112
-1
lines changed

2 files changed

+112
-1
lines changed

rake/doc/rakefile.rdoc

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,47 @@ The following rule might be used for Java files ...
163163
<b>NOTE:</b> +java_compile+ is a hypothetical method that invokes the
164164
java compiler.
165165

166+
== Importing Dependencies
167+
168+
Any ruby file (including other rakefiles) can be included with a
169+
standard Ruby +require+ command. The rules and declarations in the
170+
required file are just added to the definitions already accumulated.
171+
172+
Because the files are loaded _before_ the rake targets are evaluated,
173+
the loaded files must be "ready to go" when the rake command is
174+
invoked. This make generated dependency files difficult to use. By
175+
the time rake gets around to updating the dependencies file, it is too
176+
late to load it.
177+
178+
The +import+ command addresses this by specifying a file to be loaded
179+
_after_ the main rakefile is loaded, but _before_ any targets on the
180+
command line are specified. In addition, if the file name matches an
181+
explicit task, that task is invoked before loading the file. This
182+
allows dependency files to be generated and used in a single rake
183+
command invocation.
184+
185+
=== Example:
186+
187+
require 'rake/loaders/makefile'
188+
189+
file ".depends.mf" => [SRC_LIST] do |t|
190+
sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites} > #{t.name}"
191+
end
192+
193+
import ".depends.mf"
194+
195+
If ".depends" does not exist, or is out of date w.r.t. the source
196+
files, a new ".depends" file is generated using +makedepend+ before
197+
loading.
198+
166199
== Comments
167200

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

173-
Example:
206+
=== Example:
174207

175208
desc "Create a distribution package"
176209
task :package => [ ... ] do ... end
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
= Rake 0.5.0 Released
2+
3+
Although it has only been two weeks since the last release, we have
4+
enough updates to the Rake program to make it time for another
5+
release.
6+
7+
== Changes
8+
9+
Here are the changes for version 0.5.3 ...
10+
11+
* FileLists have been extensively changed so that they mimic the
12+
behavior of real arrays even more closely. In particular,
13+
operations on FileLists that return a new collection (e.g. collect,
14+
reject) will now return a FileList rather than an array. In
15+
addition, several places where FileLists were not properly expanded
16+
before use have been fixed.
17+
18+
* A method (+ext+) to simplify the handling of file extensions was
19+
added to String and to Array.
20+
21+
* The 'testrb' script in test/unit tends to silently swallow syntax
22+
errors in test suites. Because of that, the default test loader is
23+
now a rake-provided script. You can still use 'testrb' by setting
24+
the loader flag in the test task to :testrb. (See the API documents
25+
for TestTask for all the loader flag values).
26+
27+
* FileUtil methods (e.g. cp, mv, install) are now declared to be
28+
private. This will cut down on the interference with user defined
29+
methods of the same name.
30+
31+
* Fixed the verbose flag in the TestTask so that the test code is
32+
controlled by the flag. Also shortened up some failure messages.
33+
(Thanks to Tobias Luetke for the suggestion).
34+
35+
* Rules will now properly detect a task that can generate a source
36+
file. Previously rules would only consider source files that were
37+
already present.
38+
39+
* Added an +import+ command that allows Rake to dynamically import
40+
dependendencies into a running Rake session. The +import+ command
41+
can run tasks to update the dependency file before loading them.
42+
Dependency files can be in rake or make format, allowing rake to
43+
work with tools designed to generate dependencies for make.
44+
45+
== What is Rake
46+
47+
Rake is a build tool similar to the make program in many ways. But
48+
instead of cryptic make recipes, Rake uses standard Ruby code to
49+
declare tasks and dependencies. You have the full power of a modern
50+
scripting language built right into your build tool.
51+
52+
== Availability
53+
54+
The easiest way to get and install rake is via RubyGems ...
55+
56+
gem install rake (you may need root/admin privileges)
57+
58+
Otherwise, you can get it from the more traditional places:
59+
60+
Home Page:: http://rake.rubyforge.org/
61+
Download:: http://rubyforge.org/project/showfiles.php?group_id=50
62+
63+
== Thanks
64+
65+
As usual, it was input from users that drove a alot of these changes.
66+
Thanks to ...
67+
68+
* Brian Gernhardt for the rules fix (especially for the patience to
69+
explain the problem to me until I got what he was talking about).
70+
* Stefan Lang for pointing out problems in the dark corners of the
71+
FileList implementation.
72+
* Alexey Verkhovsky pointing out the silently swallows syntax errors
73+
in tests.
74+
* Tobias Luetke for beautifying the test task output.
75+
* Sam Roberts for some of the ideas behind dependency loading.
76+
77+
-- Jim Weirich
78+

0 commit comments

Comments
 (0)