rake 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rake might be problematic. Click here for more details.

data/CHANGES CHANGED
@@ -1,6 +1,31 @@
1
1
  = Rake Changelog
2
2
 
3
- == PreVersion 0.5.5
3
+ == Pre-Version 0.7.0
4
+
5
+ * Added Rake.original_dir to return the original starting directory of
6
+ the rake application.
7
+ * Added safe_ln support for openAFS (from Ludvig Omholt).
8
+ * Added --trace reminder on short exception messages (David Heinemeier
9
+ Hansson suggestion).
10
+ * Added multitask declaration that executes prerequisites in
11
+ parallel. (Doug Young providied an initial implementation).
12
+ * Fixed missing_const hack to be compatible with Rails. (Jamis Buck
13
+ supplied test case).
14
+ * Made the RDoc task default to internal (in-process) RDoc formatting.
15
+ The old behavior is still available by setting the +external+ flag
16
+ to true.
17
+ * Rakefiles are now loaded with the expanded path to prevent
18
+ accidental polution from the Ruby load path.
19
+ * The +namespace+ command now returns a NameSpace object that can be
20
+ used to lookup tasks defined in that namespace. This allows for
21
+ better anonymous namespace behavior.
22
+ * Task objects my now be used in prerequisite lists directly.
23
+
24
+ == Version 0.6.1
25
+
26
+ * Rebuilt 0.6.0 gem without signing.
27
+
28
+ == Version 0.6.0
4
29
 
5
30
  * Fixed file creation bug in the unit tests (caused infinite loop on
6
31
  windows).
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  = RAKE -- Ruby Make
2
2
 
3
- Supporting Rake version: 0.6
3
+ Supporting Rake version: 0.7.x
4
4
 
5
5
  This package contains Rake, a simple ruby build program with
6
6
  capabilities similar to make.
@@ -43,6 +43,16 @@ Download and install rake with the following.
43
43
 
44
44
  gem install --remote rake
45
45
 
46
+ === Running the Rake Test Suite
47
+
48
+ If you wish to run the unit and functional tests that come with Rake:
49
+
50
+ * CD into the top project directory of rake.
51
+ * Type one of the following:
52
+
53
+ rake # If you have a version of rake installed
54
+ ruby -Ilib bin/rake # If you do not have a version of rake installed.
55
+
46
56
  == Online Resources
47
57
 
48
58
  == Rake References
@@ -53,8 +63,8 @@ Download and install rake with the following.
53
63
 
54
64
  == Presentations and Articles about Rake
55
65
 
56
- * Jim Weirich\u2019s 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
57
- * Martin Fowler\u2019s article on Rake: http://martinfowler.com/articles/rake.html
66
+ * Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
67
+ * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
58
68
 
59
69
  === Road Map
60
70
 
@@ -101,8 +111,10 @@ other projects with similar (and not so similar) goals.
101
111
  * http://www.a-a-p.org -- Make in Python
102
112
  * http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make
103
113
  * http://ant.apache.org -- The Ant project
104
- * http://www.perl.com/language/ppt/src/make/index.html -- Make from
105
- the Perl Power Tools implementation.
114
+ * http://ppt.perl.org/commands/make/index.html -- Make from the Perl
115
+ Power Tools implementation.
116
+ * http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
117
+ * http://make.rubyforge.org -- Rant, another Ruby make tool.
106
118
 
107
119
  == Credits
108
120
 
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rakefile for rake -*- ruby -*-
2
2
 
3
- # Copyright 2003, 2004 by Jim Weirich (jim@weirichhouse.org)
3
+ # Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
4
4
  # All rights reserved.
5
5
 
6
6
  # This file is may be distributed under an MIT style license. See
@@ -30,8 +30,8 @@ end
30
30
 
31
31
  # Determine the current version of the software
32
32
 
33
- if `ruby -Ilib ./bin/rake --version` =~ /\S+$/
34
- CURRENT_VERSION = $&
33
+ if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9.]+)$/
34
+ CURRENT_VERSION = $1
35
35
  else
36
36
  CURRENT_VERSION = "0.0.0"
37
37
  end
@@ -42,23 +42,24 @@ else
42
42
  PKG_VERSION = CURRENT_VERSION
43
43
  end
44
44
 
45
-
46
45
  SRC_RB = FileList['lib/**/*.rb']
47
46
 
48
47
  # The default task is run if rake is given no explicit arguments.
49
48
 
50
49
  desc "Default Task"
51
- task :default => :alltests
50
+ task :default => :test_all
52
51
 
53
52
  # Test Tasks ---------------------------------------------------------
54
53
 
55
- task :ta => :alltests
56
- task :tf => :funtests
57
- task :tu => :unittests
58
- task :tc => :contribtests
59
- task :test => :unittests
54
+ # Common Abbreviations ...
55
+
56
+ task :ta => :test_all
57
+ task :tf => :test_functional
58
+ task :tu => :test_units
59
+ task :tc => :test_contribs
60
+ task :test => :test_units
60
61
 
61
- Rake::TestTask.new(:alltests) do |t|
62
+ Rake::TestTask.new(:test_all) do |t|
62
63
  t.test_files = FileList[
63
64
  'test/test*.rb',
64
65
  'test/contrib/test*.rb',
@@ -68,26 +69,26 @@ Rake::TestTask.new(:alltests) do |t|
68
69
  t.verbose = true
69
70
  end
70
71
 
71
- Rake::TestTask.new(:unittests) do |t|
72
+ Rake::TestTask.new(:test_units) do |t|
72
73
  t.test_files = FileList['test/test*.rb']
73
74
  t.warning = true
74
75
  t.verbose = false
75
76
  end
76
77
 
77
- Rake::TestTask.new(:funtests) do |t|
78
+ Rake::TestTask.new(:test_functional) do |t|
78
79
  t.test_files = FileList['test/fun*.rb']
79
80
  t.warning = true
80
81
  t.warning = true
81
82
  end
82
83
 
83
- Rake::TestTask.new(:contribtests) do |t|
84
+ Rake::TestTask.new(:test_contribs) do |t|
84
85
  t.test_files = FileList['test/contrib/test*.rb']
85
86
  t.verbose = false
86
87
  t.warning = true
87
88
  end
88
89
 
89
90
  directory 'testdata'
90
- [:alltests, :unittests, :contribtests, :funtests].each do |t|
91
+ [:test_all, :test_units, :test_contribs, :test_functional].each do |t|
91
92
  task t => ['testdata']
92
93
  end
93
94
 
@@ -106,7 +107,7 @@ rd = Rake::RDocTask.new("rdoc") { |rdoc|
106
107
  rdoc.rdoc_dir = 'html'
107
108
  # rdoc.template = 'kilmer'
108
109
  # rdoc.template = 'css2'
109
- rdoc.template = 'doc/jamis.rb'
110
+ rdoc.template = '/home/jim/working/rubyforge/rake/doc/jamis.rb'
110
111
  rdoc.title = "Rake -- Ruby Make"
111
112
  rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
112
113
  rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
@@ -257,6 +258,7 @@ task :rubyfiles do
257
258
  puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
258
259
  puts Dir['bin/*'].reject { |fn| fn =~ /CVS|(~$)|(\.rb$)/ }
259
260
  end
261
+ task :rf => :rubyfiles
260
262
 
261
263
  # --------------------------------------------------------------------
262
264
  # Creating a release
@@ -265,7 +267,7 @@ desc "Make a new release"
265
267
  task :release => [
266
268
  :prerelease,
267
269
  :clobber,
268
- :alltests,
270
+ :test_all,
269
271
  :update_version,
270
272
  :package,
271
273
  :tag] do
@@ -348,6 +350,14 @@ task :tag => [:prerelease] do
348
350
  end
349
351
  end
350
352
 
353
+ desc "Install the jamis RDoc template"
354
+ task :install_jamis_template do
355
+ require 'rbconfig'
356
+ dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
357
+ fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
358
+ install "doc/jamis.rb", dest_dir, :verbose => true
359
+ end
360
+
351
361
  # Require experimental XForge/Metaproject support.
352
362
 
353
363
  load 'xforge.rf' if File.exist?('xforge.rf')
data/bin/rake CHANGED
@@ -2,7 +2,6 @@ begin
2
2
  require 'rake'
3
3
  rescue LoadError
4
4
  require 'rubygems'
5
- require_gem 'rake'
5
+ require 'rake'
6
6
  end
7
- Rake::Application.new.run
8
-
7
+ Rake.application.run
data/doc/rakefile.rdoc CHANGED
@@ -110,6 +110,46 @@ both prerequisites and actions can be added later. For example ...
110
110
  cp Dir["standard_data/*.data"], "testdata"
111
111
  end
112
112
 
113
+ == Tasks with Parallel Prerequisites
114
+
115
+ Rake allows parallel execution of prerequisites using the following syntax:
116
+
117
+ multitask :copy_files => [:copy_src, :copy_doc, :copy_bin] do
118
+ puts "All Copies Complete"
119
+ end
120
+
121
+ In this example, +copy_files+ is a normal rake task. Its actions are
122
+ executed whereever all of its prerequisites are done. The big
123
+ difference is that the prerequisites (+copy_src+, +copy_bin+ and
124
+ +copy_doc+) are executed in parallel. Each of the prerequisites are
125
+ run in their own Ruby thread, possibly allowing faster overall runtime.
126
+
127
+ === Secondary Prerequisites
128
+
129
+ If any of the primary prerequites of a multitask have common secondary
130
+ prerequisites, all of the primary/parallel prerequisites will wait
131
+ until the common prerequisites have been run.
132
+
133
+ For example, if the <tt>copy_<em>xxx</em></tt> tasks have the
134
+ following prerequisites:
135
+
136
+ task :copy_src => [:prep_for_copy]
137
+ task :copy_bin => [:prep_for_copy]
138
+ task :copy_doc => [:prep_for_copy]
139
+
140
+ Then the +prep_for_copy+ task is run before starting all the copies in
141
+ parallel. Once +prep_for_copy+ is complete, +copy_src+, +copy_bin+,
142
+ and +copy_doc+ are all run in parallel. Note that +prep_for_copy+ is
143
+ run only once, even though it is referenced in multiple threads.
144
+
145
+ === Thread Safety
146
+
147
+ The Rake internal data structures are thread-safe with respect
148
+ to the multitask parallel execution, so there is no need for the user
149
+ to do extra synchronization for Rake's benefit. However, if there are
150
+ user data structures shared between the parallel prerequisites, the
151
+ user must do whatever is necessary to prevent race conditions.
152
+
113
153
  == Rules
114
154
 
115
155
  When a file is named as a prerequisite, but does not have a file task
@@ -231,6 +271,91 @@ Only tasks with descriptions will be displayed with the "-T" switch.
231
271
  Use "-P" (or "--prereqs") to get a list of all tasks and their
232
272
  prerequisites.
233
273
 
274
+ == Namespaces
275
+
276
+ As projects grow (and along with it, the number of tasks), it is
277
+ common for task names to begin to clash. For example, if you might
278
+ have a main program and a set of sample programs built by a single
279
+ Rakefile. By placing the tasks related to the main program in one
280
+ namespace, and the tasks for building the sample programs in a
281
+ different namespace, the task names will not will not interfer with
282
+ each other.
283
+
284
+ For example:
285
+
286
+ namespace "main"
287
+ task :build do
288
+ # Build the main program
289
+ end
290
+ end
291
+
292
+ namespace "samples" do
293
+ task :build do
294
+ # Build the sample programs
295
+ end
296
+ end
297
+
298
+ task :build => ["main:build", "samples:build"]
299
+
300
+ Referencing a task in a separate namespace can be achieved by
301
+ prefixing the task name with the namespace and a colon
302
+ (e.g. "main:build" refers to the :build task in the +main+ namespace).
303
+ Nested namespaces are supported, so
304
+
305
+ Note that the name given in the +task+ command is always the unadorned
306
+ task name without any namespace prefixes. The +task+ command always
307
+ defines a task in the current namespace.
308
+
309
+ === FileTasks
310
+
311
+ File task names are not scoped by the namespace command. Since the
312
+ name of a file task is the name of an actual file in the file system,
313
+ it makes little sense to include file task names in name space.
314
+ Directory tasks (created by the +directory+ command) are a type of
315
+ file task and are also not affected by namespaces.
316
+
317
+ === Name Resolution
318
+
319
+ When looking up a task name, rake will start with the current
320
+ namespace and attempt to find the name there. If it fails to find a
321
+ name in the current namespace, it will search the parent namespaces
322
+ until a match is found (or an error occurs if there is no match).
323
+
324
+ The "rake" namespace is a special implicit namespace that refers to
325
+ the toplevel names.
326
+
327
+ If a task name begins with a "^" character, the name resolution will
328
+ start in the parent namespace. Multiple "^" characters are allowed.
329
+
330
+ Here is an example file with multiple :run tasks and how various names
331
+ resolve in different locations.
332
+
333
+ task :run
334
+
335
+ namespace "one" do
336
+ task :run
337
+
338
+ namespace "two" do
339
+ task :run
340
+
341
+ # :run => "one:two:run"
342
+ # "two:run" => "one:two:run"
343
+ # "one:two:run" => "one:two:run"
344
+ # "one:run" => "one:run"
345
+ # "^run" => "one:run"
346
+ # "^^run" => "rake:run" (the top level task)
347
+ # "rake:run" => "rake:run" (the top level task)
348
+ end
349
+
350
+ # :run => "one:run"
351
+ # "two:run" => "one:two:run"
352
+ # "^run" => "rake:run"
353
+ end
354
+
355
+ # :run => "rake:run"
356
+ # "one:run" => "one:run"
357
+ # "one:two:run" => "one:two:run"
358
+
234
359
  == Odds and Ends
235
360
 
236
361
  === do/end verses { }
@@ -262,6 +387,7 @@ This is the proper way to specify the task ...
262
387
  end
263
388
 
264
389
  ----
390
+
265
391
  == See
266
392
 
267
393
  * README -- Main documentation for Rake.
@@ -0,0 +1,119 @@
1
+ = Rake 0.7.0 Released
2
+
3
+ These changes for Rake have been brewing for a long time. Here they
4
+ are, I hope you enjoy them.
5
+
6
+ == Changes
7
+
8
+ === New Features
9
+
10
+ * Name space support for task names (see below).
11
+
12
+ * Prerequisites can be executed in parallel (see below).
13
+
14
+ * Added safe_ln support for openAFS (via Ludvig Omholt).
15
+
16
+ * RDoc defaults to internal (in-process) invocation. The old behavior
17
+ is still available by setting the +external+ flag to true.
18
+
19
+ * Rakefiles are now loaded with the expanded path to prevent
20
+ accidental polution from the Ruby load path.
21
+
22
+ * Task objects my now be used in prerequisite lists directly.
23
+
24
+ * Task objects (in addition to task names) may now be included in the
25
+ prerequisite list of a task.
26
+
27
+ * Internals cleanup and refactoring.
28
+
29
+ === Bug Fixes
30
+
31
+ * Compatibility fixes for Ruby 1.8.4 FileUtils changes.
32
+
33
+ === Namespaces
34
+
35
+ Tasks can now be nested inside their own namespaces. Tasks within one
36
+ namespace will not accidently interfer with tasks named in a different
37
+ namespace.
38
+
39
+ For example:
40
+
41
+ namespace "main" do
42
+ task :build do
43
+ # Build the main program
44
+ end
45
+ end
46
+
47
+ namespace "samples" do
48
+ task :build do
49
+ # Build the sample programs
50
+ end
51
+ end
52
+
53
+ task :build_all => ["main:build", "samples:build"]
54
+
55
+ Even though both tasks are named :build, they are separate tasks in
56
+ their own namespaces. The :build_all task (defined in the toplevel
57
+ namespace) references both build tasks in its prerequisites.
58
+
59
+ You may invoke each of the individual build tasks with the following
60
+ commands:
61
+
62
+ rake main:build
63
+ rake samples:build
64
+
65
+ Or invoke both via the :build_all command:
66
+
67
+ rake build_all
68
+
69
+ Namespaces may be nested arbitrarily. Since the name of file tasks
70
+ correspond to the name of a file in the external file system,
71
+ FileTasks are not affected by the namespaces.
72
+
73
+ See the Rakefile format documentation (in the Rake API documents) for
74
+ more information.
75
+
76
+ === Parallel Tasks
77
+
78
+ Sometimes you have several tasks that can be executed in parallel. By
79
+ specifying these tasks as prerequisites to a +multitask+ task.
80
+
81
+ In the following example the tasks copy_src, copy_doc and copy_bin
82
+ will all execute in parallel in their own thread.
83
+
84
+ multitask :copy_files => [:copy_src, :copy_doc, :copy_bin] do
85
+ puts "All Copies Complete"
86
+ end
87
+
88
+ == What is Rake
89
+
90
+ Rake is a build tool similar to the make program in many ways. But
91
+ instead of cryptic make recipes, Rake uses standard Ruby code to
92
+ declare tasks and dependencies. You have the full power of a modern
93
+ scripting language built right into your build tool.
94
+
95
+ == Availability
96
+
97
+ The easiest way to get and install rake is via RubyGems ...
98
+
99
+ gem install rake (you may need root/admin privileges)
100
+
101
+ Otherwise, you can get it from the more traditional places:
102
+
103
+ Home Page:: http://rake.rubyforge.org/
104
+ Download:: http://rubyforge.org/project/showfiles.php?group_id=50
105
+
106
+ == Thanks
107
+
108
+ As usual, it was input from users that drove a alot of these changes.
109
+ The following people either contributed patches, made suggestions or
110
+ made otherwise helpful comments. Thanks to ...
111
+
112
+ * Doug Young (inspriation for the parallel task)
113
+
114
+ * David Heinemeier Hansson (for --trace message enhancement and for
115
+ pushing for namespace support).
116
+
117
+ * Ludvig Omholt (for the openAFS fix)
118
+
119
+ -- Jim Weirich