drake 0.8.7.0.2.4 → 0.9.0.0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/.gemtest +0 -0
  2. data/CHANGES +77 -9
  3. data/{CHANGES.drake → CHANGES-drake} +6 -2
  4. data/MIT-LICENSE +2 -0
  5. data/{README → README.rdoc} +30 -18
  6. data/Rakefile +144 -130
  7. data/Rakefile-drake +67 -0
  8. data/TODO +1 -1
  9. data/bin/drake +2 -0
  10. data/doc/command_line_usage.rdoc +25 -11
  11. data/doc/glossary.rdoc +2 -2
  12. data/doc/jamis.rb +2 -2
  13. data/doc/parallel.rdoc +37 -29
  14. data/doc/proto_rake.rdoc +22 -22
  15. data/doc/rake.1.gz +0 -0
  16. data/doc/rakefile.rdoc +56 -33
  17. data/doc/rational.rdoc +6 -6
  18. data/doc/release_notes/rake-0.4.15.rdoc +1 -1
  19. data/doc/release_notes/rake-0.5.0.rdoc +1 -1
  20. data/doc/release_notes/rake-0.7.0.rdoc +1 -1
  21. data/doc/release_notes/rake-0.7.2.rdoc +3 -3
  22. data/doc/release_notes/rake-0.7.3.rdoc +2 -2
  23. data/doc/release_notes/rake-0.8.0.rdoc +1 -1
  24. data/doc/release_notes/rake-0.8.2.rdoc +3 -3
  25. data/doc/release_notes/rake-0.8.3.rdoc +2 -2
  26. data/doc/release_notes/rake-0.8.4.rdoc +1 -1
  27. data/doc/release_notes/rake-0.8.5.rdoc +1 -1
  28. data/doc/release_notes/rake-0.8.6.rdoc +1 -1
  29. data/doc/release_notes/rake-0.8.7.rdoc +1 -1
  30. data/doc/release_notes/rake-0.9.0.rdoc +112 -0
  31. data/install.rb +14 -12
  32. data/lib/rake.rb +31 -2527
  33. data/lib/rake/alt_system.rb +7 -6
  34. data/lib/rake/application.rb +626 -0
  35. data/lib/rake/classic_namespace.rb +1 -0
  36. data/lib/rake/clean.rb +2 -4
  37. data/lib/rake/cloneable.rb +25 -0
  38. data/lib/rake/contrib/compositepublisher.rb +2 -5
  39. data/lib/rake/contrib/ftptools.rb +5 -8
  40. data/lib/rake/contrib/publisher.rb +2 -8
  41. data/lib/rake/contrib/rubyforgepublisher.rb +2 -4
  42. data/lib/rake/contrib/sshpublisher.rb +4 -6
  43. data/lib/rake/contrib/sys.rb +7 -25
  44. data/lib/rake/default_loader.rb +10 -0
  45. data/lib/rake/dsl.rb +2 -0
  46. data/lib/rake/dsl_definition.rb +143 -0
  47. data/lib/rake/early_time.rb +18 -0
  48. data/lib/rake/ext/core.rb +27 -0
  49. data/lib/rake/ext/module.rb +39 -0
  50. data/lib/rake/ext/string.rb +167 -0
  51. data/lib/rake/ext/time.rb +14 -0
  52. data/lib/rake/file_creation_task.rb +24 -0
  53. data/lib/rake/file_list.rb +403 -0
  54. data/lib/rake/file_task.rb +47 -0
  55. data/lib/rake/file_utils.rb +112 -0
  56. data/lib/rake/file_utils_ext.rb +142 -0
  57. data/lib/rake/gempackagetask.rb +6 -90
  58. data/lib/rake/invocation_chain.rb +51 -0
  59. data/lib/rake/invocation_exception_mixin.rb +16 -0
  60. data/lib/rake/loaders/makefile.rb +13 -15
  61. data/lib/rake/multi_task.rb +16 -0
  62. data/lib/rake/name_space.rb +25 -0
  63. data/lib/rake/packagetask.rb +13 -12
  64. data/lib/rake/parallel.rb +17 -28
  65. data/lib/rake/pathmap.rb +1 -0
  66. data/lib/rake/pseudo_status.rb +24 -0
  67. data/lib/rake/rake_module.rb +29 -0
  68. data/lib/rake/rake_test_loader.rb +10 -2
  69. data/lib/rake/rdoctask.rb +211 -190
  70. data/lib/rake/ruby182_test_unit_fix.rb +9 -7
  71. data/lib/rake/rule_recursion_overflow_error.rb +20 -0
  72. data/lib/rake/runtest.rb +4 -6
  73. data/lib/rake/task.rb +351 -0
  74. data/lib/rake/task_argument_error.rb +7 -0
  75. data/lib/rake/task_arguments.rb +74 -0
  76. data/lib/rake/task_manager.rb +307 -0
  77. data/lib/rake/tasklib.rb +1 -2
  78. data/lib/rake/testtask.rb +57 -27
  79. data/lib/rake/version.rb +13 -0
  80. data/lib/rake/win32.rb +4 -4
  81. data/test/contrib/test_sys.rb +8 -31
  82. data/test/data/access/Rakefile +33 -0
  83. data/test/data/comments/Rakefile +18 -0
  84. data/test/data/default/Rakefile +1 -1
  85. data/test/data/deprecated_import/Rakefile +1 -0
  86. data/test/data/dryrun/Rakefile +1 -1
  87. data/test/data/file_creation_task/Rakefile +1 -1
  88. data/test/data/namespace/Rakefile +9 -0
  89. data/test/data/rakelib/test1.rb +1 -0
  90. data/test/data/verbose/Rakefile +34 -0
  91. data/test/{filecreation.rb → file_creation.rb} +11 -7
  92. data/test/functional/functional_test.rb +25 -0
  93. data/test/{session_functional.rb → functional/session_based_tests.rb} +141 -23
  94. data/test/in_environment.rb +7 -5
  95. data/test/{test_application.rb → lib/application_test.rb} +331 -143
  96. data/test/{test_clean.rb → lib/clean_test.rb} +1 -0
  97. data/test/{test_definitions.rb → lib/definitions_test.rb} +4 -4
  98. data/test/lib/dsl_test.rb +52 -0
  99. data/test/{test_earlytime.rb → lib/earlytime_test.rb} +1 -2
  100. data/test/{test_extension.rb → lib/extension_test.rb} +2 -2
  101. data/test/{test_file_creation_task.rb → lib/file_creation_task_test.rb} +1 -1
  102. data/test/{test_file_task.rb → lib/file_task_test.rb} +9 -5
  103. data/test/{test_filelist.rb → lib/filelist_test.rb} +38 -24
  104. data/test/{test_fileutils.rb → lib/fileutils_test.rb} +27 -22
  105. data/test/{test_ftp.rb → lib/ftp_test.rb} +0 -0
  106. data/test/{test_invocation_chain.rb → lib/invocation_chain_test.rb} +0 -0
  107. data/test/{test_makefile_loader.rb → lib/makefile_loader_test.rb} +0 -0
  108. data/test/{test_multitask.rb → lib/multitask_test.rb} +3 -2
  109. data/test/{test_namespace.rb → lib/namespace_test.rb} +0 -0
  110. data/test/lib/package_task_test.rb +82 -0
  111. data/test/{test_parallel.rb → lib/parallel_test.rb} +5 -5
  112. data/test/{test_pathmap.rb → lib/pathmap_test.rb} +3 -2
  113. data/test/{test_pseudo_status.rb → lib/pseudo_status_test.rb} +0 -0
  114. data/test/{test_rake.rb → lib/rake_test.rb} +1 -1
  115. data/test/{test_rdoc_task.rb → lib/rdoc_task_test.rb} +19 -23
  116. data/test/{test_require.rb → lib/require_test.rb} +8 -2
  117. data/test/{test_rules.rb → lib/rules_test.rb} +4 -5
  118. data/test/{test_task_arguments.rb → lib/task_arguments_test.rb} +5 -5
  119. data/test/{test_task_manager.rb → lib/task_manager_test.rb} +15 -5
  120. data/test/{test_tasks.rb → lib/task_test.rb} +91 -28
  121. data/test/{test_tasklib.rb → lib/tasklib_test.rb} +0 -0
  122. data/test/{test_test_task.rb → lib/test_task_test.rb} +3 -3
  123. data/test/lib/testtask_test.rb +49 -0
  124. data/test/{test_top_level_functions.rb → lib/top_level_functions_test.rb} +5 -3
  125. data/test/{test_win32.rb → lib/win32_test.rb} +19 -0
  126. data/test/rake_test_setup.rb +6 -10
  127. data/test/ruby_version_test.rb +3 -0
  128. data/test/test_helper.rb +19 -0
  129. metadata +108 -66
  130. data/Rakefile.drake +0 -73
  131. data/test/functional.rb +0 -15
  132. data/test/test_package_task.rb +0 -118
data/.gemtest ADDED
File without changes
data/CHANGES CHANGED
@@ -1,6 +1,70 @@
1
-
2
1
  = Rake Changelog
3
2
 
3
+ == Version 0.9.0
4
+
5
+ * Rake now warns when the deprecated :needs syntax used.
6
+
7
+ * Moved Rake DSL commands to top level ruby object 'main'. Rake DSL
8
+ commands are no longer private methods in Object. (Suggested by
9
+ James M. Lawrence/quix)
10
+
11
+ * Rake history is now UTF-8 encoded.
12
+
13
+ * Rake now uses case-insensitive comparisons to find the Rakefile on Windows.
14
+ Based on patch by Roger Pack.
15
+
16
+ * Rake now requires (instead of loads) files in the test task. Patch by Cezary
17
+ Baginski.
18
+
19
+ * Fixed typos. Patches by Sean Scot August Moon and R.T. Lechow.
20
+
21
+ * Rake now prints the Rakefile directory only when it's different from the
22
+ current directory. Patch by Alex Chaffee.
23
+
24
+ * Improved rakefile_location discovery on Windows. Patch by James Tucker.
25
+
26
+ * Rake now recognizes "Windows Server" as a windows system. Patch by Matthias
27
+ Lüdtke
28
+
29
+ * Rake::RDocTask is deprecated. Use RDoc::Task from RDoc 2.4.2+ (require
30
+ 'rdoc/task')
31
+
32
+ * Rake::GemPackageTask is deprecated. Use Gem::PackageTask (require
33
+ 'rubygems/package_task')
34
+
35
+ * Rake now outputs various messages to $stderr instead of $stdout.
36
+
37
+ * Rake no longer emits warnings for Config. Patch by Santiago Pastorino.
38
+
39
+ * Removed Rake's DSL methods from the top level scope. If you need to
40
+ call 'task :xzy' in your code, include Rake::DSL into your class, or
41
+ put the code in a Rake::DSL.environment do ... end block.
42
+
43
+ * Split rake.rb into individual files.
44
+
45
+ * Support for the --where (-W) flag for showing where a task is defined.
46
+
47
+ * Fixed quoting in test task.
48
+ (http://onestepback.org/redmine/issues/show/44,
49
+ http://www.pivotaltracker.com/story/show/1223138)
50
+
51
+ * Fixed the silent option parsing problem.
52
+ (http://onestepback.org/redmine/issues/show/47)
53
+
54
+ * Fixed :verbose=>false flag on sh and ruby commands.
55
+
56
+ * Rake command line options may be given by default in a RAKEOPT
57
+ environment variable.
58
+
59
+ * Errors in Rake will now display the task invocation chain in effect
60
+ at the time of the error.
61
+
62
+ * Accepted change by warnickr to not expand test patterns in shell
63
+ (allowing more files in the test suite).
64
+
65
+ * Fixed that file tasks did not perform prereq lookups in scope
66
+ (Redmine #57).
67
+
4
68
  == Version 0.8.7
5
69
 
6
70
  * Fixed EXEEXT for JRuby on windows.
@@ -10,6 +74,10 @@
10
74
  * Minor fixes to the RDoc generation (removed dependency on darkfish
11
75
  and removed inline source option).
12
76
 
77
+ == PreVersion 0.8.6
78
+
79
+ * Now allow # comments to comment a task definition.
80
+
13
81
  == Version 0.8.5
14
82
 
15
83
  * Better support for the system command on Windows.
@@ -36,7 +104,7 @@
36
104
  * Fixed stray ARGV option problem that was interfering with
37
105
  Test::Unit::Runner.
38
106
 
39
- * Fixed default verbose mode (was accidently changed to false).
107
+ * Fixed default verbose mode (was accidently changed to false).
40
108
 
41
109
  * Removed reference to manage_gem to fix the warning produced by the
42
110
  gem package task.
@@ -49,7 +117,7 @@
49
117
  directory.
50
118
 
51
119
  * Added fix to handle ruby installations in directories with spaces in
52
- their name.
120
+ their name.
53
121
 
54
122
  == Version 0.8.2
55
123
 
@@ -66,7 +134,7 @@
66
134
  symbol/string differences. (Patch supplied by Edwin Pratomo)
67
135
 
68
136
  * Fixed bug with rules involving multiple source (Patch supplied by
69
- Emanuel Inderm�hle)
137
+ Emanuel Indermühle)
70
138
 
71
139
  * Switched from getoptlong to optparse (patches supplied by Edwin
72
140
  Pratomo)
@@ -87,7 +155,7 @@
87
155
 
88
156
  * Changed from using Mutex to Monitor. Evidently Mutex causes thread
89
157
  join errors when Ruby is compiled with -disable-pthreads. (Patch
90
- supplied by Ittay Dror)
158
+ supplied by Ittay Dror)
91
159
 
92
160
  * Fixed bug in makefile parser that had problems with extra spaces in
93
161
  file task names. (Patch supplied by Ittay Dror)
@@ -142,14 +210,14 @@
142
210
  * Fixed some bugs where the application object was going to the global
143
211
  appliation instead of using its own data.
144
212
  * Added square and curly bracket patterns to FileList#include (Tilman
145
- Sauerbeck).
213
+ Sauerbeck).
146
214
  * Added plain filename support to rule dependents (suggested by Nobu
147
- Nakada).
215
+ Nakada).
148
216
  * Added pathmap support to rule dependents.
149
217
  * Added a 'tasks' method to a namespace to get a list of tasks
150
218
  associated with the namespace.
151
219
  * Fixed the method name leak from FileUtils (bug found by Glenn
152
- Vanderburg).
220
+ Vanderburg).
153
221
  * Added rake_extension to handle detection of extension collisions.
154
222
  * Added test for noop, bad_option and verbose flags to sh command.
155
223
  * Removed dependency on internal fu_xxx functions from FileUtils.
@@ -270,7 +338,7 @@
270
338
  * Fixed a bug that prevented the TESTOPTS flag from working with the
271
339
  revised for 1.8.2 test task.
272
340
  * Updated the docs on --trace to indicate that it also enables a full
273
- backtrace on errors.
341
+ backtrace on errors.
274
342
 
275
343
  == Version 0.4.14
276
344
 
@@ -1,9 +1,13 @@
1
1
 
2
2
  = Drake Changelog
3
3
 
4
- == Version 0.8.7.0.2.4
4
+ == Version 0.9.0.0.3.0
5
5
 
6
- * Fix for kite-shaped dep graphs; based on a patch by Heath Kehoe.
6
+ * option -j without a value now allowed == no limit on number of threads
7
+ * improved --randomize[=SEED] option: auto-generates SEED if none given
8
+ (mirrors the randomizing functionality of minitest).
9
+ * --version now reports 'drake'
10
+ * update from mainline branch
7
11
 
8
12
  == Version 0.8.7.0.2.3
9
13
 
data/MIT-LICENSE CHANGED
@@ -1,5 +1,7 @@
1
1
  Copyright (c) 2003, 2004 Jim Weirich
2
2
 
3
+ Copyright (c) 2008-2011 James M. Lawrence
4
+
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
5
7
  "Software"), to deal in the Software without restriction, including
@@ -8,9 +8,9 @@ Run up to three tasks in parallel:
8
8
 
9
9
  % drake -j3
10
10
 
11
- or equivalently,
11
+ Run as many tasks in parallel as the dependencies allow:
12
12
 
13
- % drake --threads 3
13
+ % drake -j
14
14
 
15
15
  == Installation
16
16
 
@@ -18,13 +18,21 @@ or equivalently,
18
18
 
19
19
  == Notes
20
20
 
21
- See parallel.rdoc.
21
+ Drake is fully compatible with Rake. The code base is identical to
22
+ that of Rake except for the addition of the -j option.
23
+
24
+ For the purposes of this documentation, the 'rake' and 'drake'
25
+ commands are interchangeable. The drake gem will install the drake
26
+ executable. On your system you may alias or link drake to rake if
27
+ desired.
28
+
29
+ For more on parallelization with -j, see
30
+ parallel.rdoc[http://quix.github.com/rake/files/doc/parallel_rdoc.html].
22
31
 
23
32
  == Links
24
33
 
25
- * Download: http://rubyforge.org/frs/?group_id=6530
26
- * Documentation: http://drake.rubyforge.org
27
- * Rubyforge home: http://rubyforge.org/projects/drake
34
+ * Home: http://quix.github.com/rake
35
+ * Feature Requests, Bug Reports: http://github.com/quix/rake/issues
28
36
  * Repository: http://github.com/quix/rake
29
37
 
30
38
  == Author
@@ -33,9 +41,9 @@ See parallel.rdoc.
33
41
 
34
42
  == License
35
43
 
36
- Copyright (c) 2003, 2004 Jim Weirich
44
+ Copyright (c) 2003-2010 Jim Weirich
37
45
 
38
- Copyright (c) 2008 James M. Lawrence
46
+ Copyright (c) 2008-2011 James M. Lawrence
39
47
 
40
48
  Permission is hereby granted, free of charge, to any person obtaining
41
49
  a copy of this software and associated documentation files (the
@@ -56,9 +64,9 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
56
64
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
57
65
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58
66
 
59
- = RAKE -- Ruby Make -- <em>master branch</em>
67
+ = RAKE -- Ruby Make -- <em>mainline branch</em>
60
68
 
61
- Supporting Rake version: 0.8.6
69
+ Supporting Rake version: 0.8.7.
62
70
 
63
71
  This package contains Rake, a simple ruby build program with
64
72
  capabilities similar to make.
@@ -110,7 +118,7 @@ First, you must write a "Rakefile" file which contains the build rules. Here's
110
118
  a simple example:
111
119
 
112
120
  task :default => [:test]
113
-
121
+
114
122
  task :test do
115
123
  ruby "test/unittest.rb"
116
124
  end
@@ -147,7 +155,6 @@ Type "rake --help" for all available options.
147
155
  * For a glossary of terms, see
148
156
  doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
149
157
 
150
-
151
158
  == Development
152
159
 
153
160
  === Source Repository
@@ -161,6 +168,7 @@ http://github.com/jimweirich/rake. The public git clone URL is
161
168
 
162
169
  If you wish to run the unit and functional tests that come with Rake:
163
170
 
171
+ * Install the 'flexmock' gem
164
172
  * Install the 'session' gem in order to run the functional tests.
165
173
  * CD into the top project directory of rake.
166
174
  * Type one of the following:
@@ -170,14 +178,16 @@ If you wish to run the unit and functional tests that come with Rake:
170
178
 
171
179
  === Issues and Bug Reports
172
180
 
173
- Bugs, features requests and other issues can be logged at
181
+ Feature requests and bug reports can be made here
182
+
183
+ * http://onestepback.org/cgi-bin/bugs.cgi?project=rake
174
184
 
175
- * http://onestepback.org/redmine/projects/show/rake
185
+ No account is needed for posting requests. Or you can send me an
186
+ email (at jim dot weirich at gmail dot com)
176
187
 
177
- You will need an account to before you can post issues. Register at
178
- http://onestepback.org/redmine/account/register. Or you can send me
179
- an email (at jim dot weirich at gmail dot com)
188
+ Issues and bug reports can be tracked here:
180
189
 
190
+ * http://www.pivotaltracker.com/projects/28469
181
191
 
182
192
  == Online Resources
183
193
 
@@ -188,6 +198,8 @@ an email (at jim dot weirich at gmail dot com)
188
198
  * Rake API Documents: http://rake.rubyforge.org
189
199
  * Rake Source Code Repo: http://github.com/jimweirich/rake
190
200
  * Rake Git Repo Clone URL: git://github.com/jimweirich/rake.git
201
+ * Rake Issue Tracking: http://www.pivotaltracker.com/projects/28469
202
+ * Rake Bug Reports: http://onestepback.org/cgi-bin/bugs.cgi?project=rake
191
203
 
192
204
  === Presentations and Articles about Rake
193
205
 
@@ -229,7 +241,7 @@ The Rake homepage is http://rake.rubyforge.org. You can find the Rake
229
241
  RubyForge page at http://rubyforge.org/projects/rake.
230
242
 
231
243
  Feel free to submit commits or feature requests. If you send a patch,
232
- remember to update the corresponding unit tests. If fact, I prefer
244
+ remember to update the corresponding unit tests. In fact, I prefer
233
245
  new feature to be submitted in the form of new unit tests.
234
246
 
235
247
  For other information, feel free to ask on the ruby-talk mailing list
data/Rakefile CHANGED
@@ -1,22 +1,34 @@
1
1
  # Rakefile for rake -*- ruby -*-
2
2
 
3
3
  # Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
4
+ # Copyright 2008-2011 by James M. Lawrence (quixoticsycophant@gmail.com)
4
5
  # All rights reserved.
5
6
 
6
7
  # This file may be distributed under an MIT style license. See
7
8
  # MIT-LICENSE for details.
8
9
 
9
- begin
10
- require 'rubygems'
11
- require 'rake/gempackagetask'
12
- rescue Exception
13
- nil
10
+ require 'rbconfig'
11
+ require 'rubygems'
12
+
13
+ system_rake = File.join RbConfig::CONFIG['rubylibdir'], 'rake.rb'
14
+
15
+ # Use our rake, not the installed rake from system
16
+ if $".include? system_rake then
17
+ exec Gem.ruby, '-Ilib', 'bin/rake', *ARGV
14
18
  end
19
+
20
+ require 'rubygems/package_task'
21
+
15
22
  require 'rake/clean'
16
23
  require 'rake/testtask'
17
- require 'rake/rdoctask'
18
24
 
19
- CLEAN.include('**/*.o', '*.dot', '**/.*.rbc')
25
+ begin
26
+ gem 'rdoc'
27
+ require 'rdoc/task'
28
+ rescue Gem::LoadError
29
+ end
30
+
31
+ CLEAN.include('**/*.o', '*.dot', '**/*.rbc')
20
32
  CLOBBER.include('doc/example/main', 'testdata')
21
33
  CLOBBER.include('test/data/**/temp_*')
22
34
  CLOBBER.include('test/data/chains/play.*')
@@ -34,7 +46,7 @@ end
34
46
 
35
47
  # Determine the current version of the software
36
48
 
37
- if `ruby -Ilib ./bin/drake --version` =~ /rake, version ([0-9.]+)$/
49
+ if `ruby -Ilib ./bin/drake --version` =~ /rake, version ([0-9a-z.]+)$/
38
50
  CURRENT_VERSION = $1
39
51
  else
40
52
  CURRENT_VERSION = "0.0.0"
@@ -47,84 +59,100 @@ SRC_RB = FileList['lib/**/*.rb']
47
59
  # The default task is run if rake is given no explicit arguments.
48
60
 
49
61
  desc "Default Task"
50
- task :default => :test_all
51
-
52
- load 'Rakefile.drake'
62
+ task :default => "test:all"
53
63
 
54
64
  # Test Tasks ---------------------------------------------------------
55
- task :dbg do |t|
56
- puts "Arguments are: #{t.args.join(', ')}"
57
- end
58
65
 
59
66
  # Common Abbreviations ...
60
67
 
61
- task :ta => :test_all
62
- task :tf => :test_functional
63
- task :tu => :test_units
64
- task :tc => :test_contribs
65
- task :test => :test_units
66
- task :test_all => [:test_serial, :test_parallel]
67
-
68
- test_files = FileList[
69
- 'test/test*.rb',
70
- 'test/contrib/test*.rb',
71
- 'test/fun*.rb'
72
- ]
73
-
74
- Rake::TestTask.new(:test_serial) do |t|
75
- t.test_files = ['test/serial_setup.rb'] + test_files
76
- t.warning = true
77
- t.verbose = false
68
+ task :ta => "test:all"
69
+ task :tf => "test:functional"
70
+ task :tu => "test:units"
71
+ task :tc => "test:contribs"
72
+ task :test => "test:units"
73
+
74
+ module TestFiles
75
+ UNIT = FileList['test/lib/*_test.rb']
76
+ FUNCTIONAL = FileList['test/functional/*_test.rb']
77
+ CONTRIB = FileList['test/contrib/test*.rb']
78
+ TOP = FileList['test/*_test.rb']
79
+ ALL = TOP + UNIT + FUNCTIONAL + CONTRIB
78
80
  end
79
81
 
80
- Rake::TestTask.new(:test_parallel) do |t|
81
- t.test_files = ['test/parallel_setup.rb'] + test_files
82
- t.warning = true
83
- t.verbose = false
84
- end
82
+ namespace :test do
83
+ task :all => [:serial, :parallel]
85
84
 
86
- Rake::TestTask.new(:test_units) do |t|
87
- t.test_files = FileList['test/test*.rb']
88
- t.warning = true
89
- t.verbose = false
90
- end
85
+ Rake::TestTask.new(:serial) do |t|
86
+ t.test_files = ['test/serial_setup.rb'] + TestFiles::ALL
87
+ t.libs << "."
88
+ t.warning = true
89
+ end
90
+
91
+ Rake::TestTask.new(:parallel) do |t|
92
+ t.test_files = ['test/parallel_setup.rb'] + TestFiles::ALL
93
+ t.libs << "."
94
+ t.warning = true
95
+ end
91
96
 
92
- Rake::TestTask.new(:test_functional) do |t|
93
- t.test_files = FileList['test/fun*.rb']
94
- t.warning = true
95
- t.verbose = false
96
- end
97
+ Rake::TestTask.new(:units) do |t|
98
+ t.test_files = TestFiles::UNIT
99
+ t.libs << "."
100
+ t.warning = true
101
+ end
102
+
103
+ Rake::TestTask.new(:functional) do |t|
104
+ t.test_files = TestFiles::FUNCTIONAL
105
+ t.libs << "."
106
+ t.warning = true
107
+ end
97
108
 
98
- Rake::TestTask.new(:test_contribs) do |t|
99
- t.test_files = FileList['test/contrib/test*.rb']
100
- t.warning = true
101
- t.verbose = false
109
+ Rake::TestTask.new(:contribs) do |t|
110
+ t.test_files = TestFiles::CONTRIB
111
+ t.libs << "."
112
+ t.warning = true
113
+ end
102
114
  end
103
115
 
104
116
  begin
105
117
  require 'rcov/rcovtask'
118
+ IGNORE_COVERAGE_IN = FileList[
119
+ 'lib/rake/rdoctask.rb',
120
+ 'lib/rake/testtask.rb',
121
+ 'lib/rake/packagetask.rb',
122
+ 'lib/rake/clean.rb',
123
+ ]
124
+
125
+ unless File::ALT_SEPARATOR
126
+ IGNORE_COVERAGE_IN.include(
127
+ 'lib/rake/alt_system.rb',
128
+ 'lib/rake/win32.rb')
129
+ end
106
130
 
107
131
  Rcov::RcovTask.new do |t|
108
132
  t.libs << "test"
109
- dot_rakes =
110
133
  t.rcov_opts = [
111
134
  '-xRakefile', '-xrakefile', '-xpublish.rf',
112
- '-xlib/rake/contrib', '-x/Library',
135
+ '-xlib/rake/contrib', '-x/Library', '-x.rvm',
113
136
  '--text-report',
114
137
  '--sort coverage'
115
- ] + FileList['rakelib/*.rake'].pathmap("-x%p")
138
+ ] + FileList['rakelib/*.rake'].pathmap("-x%p") +
139
+ IGNORE_COVERAGE_IN.map { |fn| "-x#{fn}" }
116
140
  t.test_files = FileList[
117
- 'test/test*.rb', 'test/functional.rb'
141
+ 'test/lib/*_test.rb',
142
+ 'test/contrib/*_test.rb',
143
+ 'test/functional/*_test.rb'
118
144
  ]
119
145
  t.output_dir = 'coverage'
120
146
  t.verbose = true
121
147
  end
122
148
  rescue LoadError
123
- puts "RCov is not available"
149
+ task :rcov do
150
+ puts "RCov is not available"
151
+ end
124
152
  end
125
153
 
126
154
  directory 'testdata'
127
- [:test_all, :test_units, :test_contribs, :test_functional].each do |t|
155
+ ["test:all", :test_units, :test_contribs, :test_functional].each do |t|
128
156
  task t => ['testdata']
129
157
  end
130
158
 
@@ -139,28 +167,24 @@ end
139
167
 
140
168
  # Create a task to build the RDOC documentation tree.
141
169
 
142
- begin
143
- require 'darkfish-rdoc'
144
- DARKFISH_ENABLED = true
145
- rescue LoadError => ex
146
- DARKFISH_ENABLED = false
147
- end
148
-
149
170
  BASE_RDOC_OPTIONS = [
150
- '--line-numbers',
151
- '--main', 'README',
152
- '--title', 'Drake: Distributed Rake',
171
+ '--line-numbers', '--show-hash',
172
+ '--main', 'README.rdoc',
173
+ '--title', 'Drake: Distributed Rake'
153
174
  ]
154
175
 
155
- rd = Rake::RDocTask.new("rdoc") do |rdoc|
156
- rdoc.rdoc_dir = 'html'
157
- rdoc.template = 'doc/jamis.rb'
158
- rdoc.title = "Drake: Distributed Rake"
159
- rdoc.options = BASE_RDOC_OPTIONS.dup
160
- rdoc.options << '-SHN' << '-f' << 'darkfish' if DARKFISH_ENABLED
161
- rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
162
- rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
163
- rdoc.rdoc_files.exclude(/\bcontrib\b/)
176
+ if defined?(RDoc::Task) then
177
+ RDoc::Task.new do |rdoc|
178
+ rdoc.rdoc_dir = 'html'
179
+ rdoc.title = "Drake -- Distributed Rake"
180
+ rdoc.options = BASE_RDOC_OPTIONS.dup
181
+
182
+ rdoc.rdoc_files.include('README.rdoc', 'MIT-LICENSE', 'TODO', 'CHANGES', 'CHANGES-drake')
183
+ rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
184
+ rdoc.rdoc_files.exclude(/\bcontrib\b/)
185
+ end
186
+ else
187
+ warn "RDoc 2.4.2+ is required to build documentation"
164
188
  end
165
189
 
166
190
  # ====================================================================
@@ -168,14 +192,15 @@ end
168
192
  # tar, zip and gem files.
169
193
 
170
194
  PKG_FILES = FileList[
195
+ '.gemtest',
171
196
  'install.rb',
172
197
  '[A-Z]*',
173
198
  'bin/drake',
174
- 'lib/**/*.rb',
199
+ 'lib/**/*.rb',
175
200
  'test/**/*.rb',
176
201
  'test/**/*.rf',
177
202
  'test/**/*.mf',
178
- 'test/**/Rakefile*',
203
+ 'test/**/Rakefile',
179
204
  'test/**/subdir',
180
205
  'doc/**/*'
181
206
  ]
@@ -187,22 +212,24 @@ if ! defined?(Gem)
187
212
  puts "Package Target requires RubyGEMs"
188
213
  else
189
214
  SPEC = Gem::Specification.new do |s|
190
-
215
+
191
216
  #### Basic information.
192
217
 
193
218
  s.name = 'drake'
194
219
  s.version = $package_version
195
220
  s.summary = "A branch of Rake supporting automatic parallelizing of tasks."
196
221
  s.description = <<-EOF
197
- Rake is a Make-like program implemented in Ruby. Tasks
198
- and dependencies are specified in standard Ruby syntax.
222
+ Drake is an auto-parallelizing branch of Rake, a Make-like program
223
+ implemented in Ruby. Tasks and dependencies are specified in standard
224
+ Ruby syntax.
199
225
  EOF
200
226
 
201
227
  #### Dependencies and requirements.
228
+ s.add_dependency('comp_tree', '>= 1.1.3')
202
229
 
203
- s.add_dependency('comp_tree', '>= 0.7.3')
204
- #s.add_dependency('log4r', '> 1.0.4')
205
- #s.requirements << ""
230
+ s.required_rubygems_version = '>= 1.3.2'
231
+ s.add_development_dependency 'session', '~> 2.4'
232
+ s.add_development_dependency 'flexmock', '~> 0.8.11'
206
233
 
207
234
  #### Which files are to be included in this gem? Everything! (Except CVS directories.)
208
235
 
@@ -218,19 +245,25 @@ else
218
245
 
219
246
  s.bindir = "bin" # Use these for applications.
220
247
  s.executables = ["drake"]
221
- s.default_executable = "drake"
222
248
 
223
249
  #### Documentation and testing.
224
250
 
225
- s.has_rdoc = true
226
- s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
251
+ s.extra_rdoc_files = FileList[
252
+ 'README.rdoc',
253
+ 'MIT-LICENSE',
254
+ 'TODO',
255
+ 'CHANGES',
256
+ 'CHANGES-drake',
257
+ 'doc/**/*.rdoc'
258
+ ]
259
+
227
260
  s.rdoc_options = BASE_RDOC_OPTIONS
228
261
 
229
262
  #### Author and project details.
230
263
 
231
264
  s.author = "James M. Lawrence"
232
265
  s.email = "quixoticsycophant@gmail.com"
233
- s.homepage = "http://drake.rubyforge.org"
266
+ s.homepage = "http://quix.github.com/rake"
234
267
  s.rubyforge_project = "drake"
235
268
  # if ENV['CERT_DIR']
236
269
  # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
@@ -238,7 +271,7 @@ else
238
271
  # end
239
272
  end
240
273
 
241
- package_task = Rake::GemPackageTask.new(SPEC) do |pkg|
274
+ Gem::PackageTask.new(SPEC) do |pkg|
242
275
  pkg.need_zip = true
243
276
  pkg.need_tar = true
244
277
  end
@@ -254,6 +287,8 @@ end
254
287
 
255
288
  # Misc tasks =========================================================
256
289
 
290
+ load 'Rakefile-drake'
291
+
257
292
  def count_lines(filename)
258
293
  lines = 0
259
294
  codelines = 0
@@ -300,28 +335,13 @@ task :todo do
300
335
  RUBY_FILES.egrep(/#.*(FIXME|TODO|TBD)/)
301
336
  end
302
337
 
303
- desc "Look for Debugging print lines"
304
- task :dbg do
305
- RUBY_FILES.egrep(/\bDBG|\bbreakpoint\b/)
306
- end
307
-
308
338
  desc "List all ruby files"
309
- task :rubyfiles do
339
+ task :rubyfiles do
310
340
  puts RUBY_FILES
311
341
  puts FileList['bin/*'].exclude('bin/*.rb')
312
342
  end
313
343
  task :rf => :rubyfiles
314
344
 
315
- desc "Create a TAGS file"
316
- task :tags => "TAGS"
317
-
318
- TAGS = 'xctags -e'
319
-
320
- file "TAGS" => RUBY_FILES do
321
- puts "Makings TAGS"
322
- sh "#{TAGS} #{RUBY_FILES}", :verbose => false
323
- end
324
-
325
345
  # --------------------------------------------------------------------
326
346
  # Creating a release
327
347
 
@@ -333,32 +353,31 @@ task :noop
333
353
  #plugin "release_manager"
334
354
 
335
355
  desc "Make a new release"
336
- task :release, :rel, :reuse, :reltest,
337
- :needs => [
356
+ task :release, [:rel, :reuse, :reltest] => [
338
357
  :prerelease,
339
358
  :clobber,
340
- :test_all,
359
+ "test:all",
341
360
  :update_version,
342
361
  :package,
343
362
  :tag
344
363
  ] do
345
- announce
364
+ announce
346
365
  announce "**************************************************************"
347
366
  announce "* Release #{$package_version} Complete."
348
367
  announce "* Packages ready to upload."
349
368
  announce "**************************************************************"
350
- announce
369
+ announce
351
370
  end
352
371
 
353
372
  # Validate that everything is ready to go for a release.
354
373
  task :prerelease, :rel, :reuse, :reltest do |t, args|
355
374
  $package_version = args.rel
356
- announce
375
+ announce
357
376
  announce "**************************************************************"
358
377
  announce "* Making RubyGem Release #{$package_version}"
359
378
  announce "* (current version #{CURRENT_VERSION})"
360
379
  announce "**************************************************************"
361
- announce
380
+ announce
362
381
 
363
382
  # Is a release number supplied?
364
383
  unless args.rel
@@ -384,21 +403,20 @@ task :prerelease, :rel, :reuse, :reltest do |t, args|
384
403
  end
385
404
  end
386
405
 
387
- task :update_version, :rel, :reuse, :reltest,
388
- :needs => [:prerelease] do |t, args|
406
+ task :update_version, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
389
407
  if args.rel == CURRENT_VERSION
390
408
  announce "No version change ... skipping version update"
391
409
  else
392
410
  announce "Updating Rake version to #{args.rel}"
393
411
  open("lib/rake.rb") do |rakein|
394
412
  open("lib/rake.rb.new", "w") do |rakeout|
395
- rakein.each do |line|
396
- if line =~ /^RAKEVERSION\s*=\s*/
397
- rakeout.puts "RAKEVERSION = '#{args.rel}'"
398
- else
399
- rakeout.puts line
400
- end
401
- end
413
+ rakein.each do |line|
414
+ if line =~ /^RAKEVERSION\s*=\s*/
415
+ rakeout.puts "RAKEVERSION = '#{args.rel}'"
416
+ else
417
+ rakeout.puts line
418
+ end
419
+ end
402
420
  end
403
421
  end
404
422
  mv "lib/rake.rb.new", "lib/rake.rb"
@@ -411,8 +429,7 @@ task :update_version, :rel, :reuse, :reltest,
411
429
  end
412
430
 
413
431
  desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
414
- task :tag, :rel, :reuse, :reltest,
415
- :needs => [:prerelease] do |t, args|
432
+ task :tag, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
416
433
  reltag = "REL_#{args.rel.gsub(/\./, '_')}"
417
434
  reltag << args.reuse.gsub(/\./, '_') if args.reuse
418
435
  announce "Tagging Repository with [#{reltag}]"
@@ -423,14 +440,6 @@ task :tag, :rel, :reuse, :reltest,
423
440
  end
424
441
  end
425
442
 
426
- desc "Install the jamis RDoc template"
427
- task :install_jamis_template do
428
- require 'rbconfig'
429
- dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
430
- fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
431
- install "doc/jamis.rb", dest_dir, :verbose => true
432
- end
433
-
434
443
  # Require experimental XForge/Metaproject support.
435
444
 
436
445
  load 'xforge.rf' if File.exist?('xforge.rf')
@@ -439,3 +448,8 @@ desc "Where is the current directory. This task displays\nthe current rake dire
439
448
  task :where_am_i do
440
449
  puts Rake.original_dir
441
450
  end
451
+
452
+ task :failure => :really_fail
453
+ task :really_fail do
454
+ fail "oops"
455
+ end