rake 0.4.8 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +183 -0
- data/README +47 -14
- data/Rakefile +212 -44
- data/bin/rake +2 -3
- data/doc/jamis.rb +591 -0
- data/doc/rake.1.gz +0 -0
- data/doc/rakefile.rdoc +180 -3
- data/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/lib/rake/classic_namespace.rb +8 -0
- data/lib/rake/clean.rb +3 -1
- data/lib/rake/contrib/ftptools.rb +21 -21
- data/lib/rake/contrib/rubyforgepublisher.rb +3 -3
- data/lib/rake/contrib/sshpublisher.rb +1 -1
- data/lib/rake/contrib/sys.rb +20 -21
- data/lib/rake/gempackagetask.rb +12 -9
- data/lib/rake/loaders/makefile.rb +40 -0
- data/lib/rake/packagetask.rb +65 -33
- data/lib/rake/rake_test_loader.rb +5 -0
- data/lib/rake/rdoctask.rb +34 -15
- data/lib/rake/ruby182_test_unit_fix.rb +23 -0
- data/lib/rake/runtest.rb +4 -4
- data/lib/rake/tasklib.rb +3 -9
- data/lib/rake/testtask.rb +67 -24
- data/lib/rake.rb +1600 -552
- data/test/capture_stdout.rb +26 -0
- data/test/data/chains/Rakefile +15 -0
- data/test/data/default/Rakefile +19 -0
- data/test/data/dryrun/Rakefile +22 -0
- data/test/data/file_creation_task/Rakefile +30 -0
- data/test/data/imports/Rakefile +19 -0
- data/test/data/imports/deps.mf +1 -0
- data/test/data/multidesc/Rakefile +14 -0
- data/test/data/namespace/Rakefile +57 -0
- data/test/data/rakelib/test1.rb +3 -0
- data/test/data/sample.mf +9 -0
- data/test/data/unittest/Rakefile +1 -0
- data/test/filecreation.rb +18 -10
- data/test/functional.rb +3 -72
- data/test/reqfile.rb +3 -0
- data/test/reqfile2.rb +3 -0
- data/test/session_functional.rb +218 -0
- data/test/shellcommand.rb +3 -0
- data/test/test_application.rb +425 -0
- data/test/{testclean.rb → test_clean.rb} +1 -0
- data/test/test_definitions.rb +82 -0
- data/test/test_earlytime.rb +35 -0
- data/test/test_file_creation_task.rb +62 -0
- data/test/test_file_task.rb +139 -0
- data/test/test_filelist.rb +574 -0
- data/test/test_fileutils.rb +230 -0
- data/test/test_makefile_loader.rb +23 -0
- data/test/test_multitask.rb +45 -0
- data/test/test_namespace.rb +32 -0
- data/test/test_package_task.rb +130 -0
- data/test/test_pathmap.rb +188 -0
- data/test/test_rake.rb +34 -0
- data/test/test_require.rb +33 -0
- data/test/test_rules.rb +305 -0
- data/test/test_task_manager.rb +148 -0
- data/test/test_tasks.rb +146 -0
- data/test/{testtesttask.rb → test_test_task.rb} +5 -0
- data/test/test_top_level_functions.rb +79 -0
- metadata +134 -68
- data/test/testfilelist.rb +0 -255
- data/test/testfileutils.rb +0 -55
- data/test/testpackagetask.rb +0 -81
- data/test/testtasks.rb +0 -371
- /data/test/{testftp.rb → test_ftp.rb} +0 -0
data/CHANGES
CHANGED
|
@@ -1,5 +1,188 @@
|
|
|
1
1
|
= Rake Changelog
|
|
2
2
|
|
|
3
|
+
== Pre-version 0.7.3
|
|
4
|
+
|
|
5
|
+
* Added existing and existing! methods to FileList
|
|
6
|
+
* FileLists now claim to be Arrays (via is_a?) to get better support
|
|
7
|
+
from the FileUtil module.
|
|
8
|
+
* Added init and top_level for custom rake applications.
|
|
9
|
+
|
|
10
|
+
== Version 0.7.2
|
|
11
|
+
|
|
12
|
+
* Error messages are now send to stderr rather than stdout (from
|
|
13
|
+
Payton Quackenbush).
|
|
14
|
+
* Better error handling on invalid command line arguments (from Payton
|
|
15
|
+
Quackenbush).
|
|
16
|
+
* Added rcov task and updated unit testing for better code coverage.
|
|
17
|
+
* Fixed some bugs where the application object was going to the global
|
|
18
|
+
appliation instead of using its own data.
|
|
19
|
+
* Added square and curly bracket patterns to FileList#include (Tilman
|
|
20
|
+
Sauerbeck).
|
|
21
|
+
* Added plain filename support to rule dependents (suggested by Nobu
|
|
22
|
+
Nakada).
|
|
23
|
+
* Added pathmap support to rule dependents.
|
|
24
|
+
* Added a 'tasks' method to a namespace to get a list of tasks
|
|
25
|
+
associated with the namespace.
|
|
26
|
+
* Fixed the method name leak from FileUtils (bug found by Glenn
|
|
27
|
+
Vanderburg).
|
|
28
|
+
* Added rake_extension to handle detection of extension collisions.
|
|
29
|
+
* Added test for noop, bad_option and verbose flags to sh command.
|
|
30
|
+
* Removed dependency on internal fu_xxx functions from FileUtils.
|
|
31
|
+
* Added a 'shame' task to the Rakefile.
|
|
32
|
+
* Added tar_command and zip_command options to the Package task.
|
|
33
|
+
* Added a description to the gem task in GemPackageTask.
|
|
34
|
+
* Fixed a bug when rules have multiple prerequisites (patch by Joel
|
|
35
|
+
VanderWerf)
|
|
36
|
+
* Added a protected 'require "rubygems"' to test/test_application to
|
|
37
|
+
unbreak cruisecontrol.rb.
|
|
38
|
+
* Added the handful of RakeFileUtils to the private method as well.
|
|
39
|
+
* Added block based exclusion.
|
|
40
|
+
* The clean task will no longer delete 'core' if it is a directory.
|
|
41
|
+
* Removed rake_dup. Now we just simply rescue a bad dup.
|
|
42
|
+
* Refactored the FileList reject logic to remove duplication.
|
|
43
|
+
* Removed if __FILE__ at the end of the rake.rb file.
|
|
44
|
+
|
|
45
|
+
== Version 0.7.1
|
|
46
|
+
|
|
47
|
+
* Added optional filter parameter to the --tasks command line option.
|
|
48
|
+
* Added flatten to allow rule transform procs to return lists of
|
|
49
|
+
prereqs (Joel VanderWerf provided patch).
|
|
50
|
+
* Added pathmap to String and FileList.
|
|
51
|
+
* The -r option will now load .rake files (but a straight require
|
|
52
|
+
doesn't yet). NOTE: This is experimental ... it may be
|
|
53
|
+
discontinued.
|
|
54
|
+
* The -f option without a value will disable the search for a
|
|
55
|
+
Rakefile. The assumption is that the -r files are adequate.
|
|
56
|
+
* Fixed the safe_ln function to fall back to cp in more error
|
|
57
|
+
scenarios.
|
|
58
|
+
|
|
59
|
+
== Version 0.7.0
|
|
60
|
+
|
|
61
|
+
* Added Rake.original_dir to return the original starting directory of
|
|
62
|
+
the rake application.
|
|
63
|
+
* Added safe_ln support for openAFS (from Ludvig Omholt).
|
|
64
|
+
* Added --trace reminder on short exception messages (David Heinemeier
|
|
65
|
+
Hansson suggestion).
|
|
66
|
+
* Added multitask declaration that executes prerequisites in
|
|
67
|
+
parallel. (Doug Young providied an initial implementation).
|
|
68
|
+
* Fixed missing_const hack to be compatible with Rails. (Jamis Buck
|
|
69
|
+
supplied test case).
|
|
70
|
+
* Made the RDoc task default to internal (in-process) RDoc formatting.
|
|
71
|
+
The old behavior is still available by setting the +external+ flag
|
|
72
|
+
to true.
|
|
73
|
+
* Rakefiles are now loaded with the expanded path to prevent
|
|
74
|
+
accidental polution from the Ruby load path.
|
|
75
|
+
* The +namespace+ command now returns a NameSpace object that can be
|
|
76
|
+
used to lookup tasks defined in that namespace. This allows for
|
|
77
|
+
better anonymous namespace behavior.
|
|
78
|
+
* Task objects my now be used in prerequisite lists directly.
|
|
79
|
+
|
|
80
|
+
== Version 0.6.1
|
|
81
|
+
|
|
82
|
+
* Rebuilt 0.6.0 gem without signing.
|
|
83
|
+
|
|
84
|
+
== Version 0.6.0
|
|
85
|
+
|
|
86
|
+
* Fixed file creation bug in the unit tests (caused infinite loop on
|
|
87
|
+
windows).
|
|
88
|
+
* Fixed bug where session based functional tests were run under
|
|
89
|
+
windows.
|
|
90
|
+
* Fixed bug in directory tasks so that updating a directory will not
|
|
91
|
+
retrigger file tasks depending on the directory (see
|
|
92
|
+
FileCreationTask and EarlyTime).
|
|
93
|
+
* Added egrep to FileList
|
|
94
|
+
* ruby command now runs same ruby version as rake.
|
|
95
|
+
* Added investigation to task object. (suggested by Martin Fowler)
|
|
96
|
+
* Added ruby_opts to the test task to allow arbitrary ruby options to
|
|
97
|
+
be passed to the test script. (Greg Fast)
|
|
98
|
+
* Fixed the test loader to ignore options. (Greg Fast)
|
|
99
|
+
* Moved Task, FileTask, FileCreationTask and RakeApp into the Rake
|
|
100
|
+
module namespace. Old style namespace behavior can be invoked via
|
|
101
|
+
the --classic-namespace option. (requested by Kelly Felkins).
|
|
102
|
+
* GemTask is now sensitive to the gem platform (Masao Mutoh).
|
|
103
|
+
* A non-existing file prerequisite will no longer cause an exception
|
|
104
|
+
(Philipp Neubeck).
|
|
105
|
+
* Multiple prerequisites on Rake rules now allowed (initial patch
|
|
106
|
+
supplied by Stuart Jansen).
|
|
107
|
+
|
|
108
|
+
== Version 0.5.4
|
|
109
|
+
|
|
110
|
+
* Added double quotes to the test runner.
|
|
111
|
+
* Added .svn to default ignore list.
|
|
112
|
+
* Updated FileList#include to support nested arrays and filelists.
|
|
113
|
+
|
|
114
|
+
== Version 0.5.3
|
|
115
|
+
|
|
116
|
+
* Added support for importing Rakefile and other dependencies.
|
|
117
|
+
* Fixed bug so that now rules can chain off of existing tasks as well
|
|
118
|
+
as existing files.
|
|
119
|
+
* Fixed verbose flag bug in the testing task. Shortened some failure
|
|
120
|
+
messages.
|
|
121
|
+
* Make FileUtils methods private at the top level module to avoid
|
|
122
|
+
accidental method leaking into other objects.
|
|
123
|
+
* Added test loader option to test task. "testrb" is no longer the
|
|
124
|
+
default test loader. It is now eating syntax errors that should
|
|
125
|
+
halt the unit tests.
|
|
126
|
+
* Revamped FileList so that it works more like and array (addressed
|
|
127
|
+
flatten bug). Added many tests around file list.
|
|
128
|
+
* Added +ext+ method to both String and FileList.
|
|
129
|
+
|
|
130
|
+
== Version 0.5.0
|
|
131
|
+
|
|
132
|
+
* Fixed documentation that was lacking the Rake module name (Tilman
|
|
133
|
+
Sauerbeck).
|
|
134
|
+
* Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck).
|
|
135
|
+
* Recursive rules are now supported (Tilman Sauerbeck).
|
|
136
|
+
* Added warning option for the Test Task (requested by Eric Hodel).
|
|
137
|
+
* The jamis rdoc template is only used if it exists.
|
|
138
|
+
* Added fix for Ruby 1.8.2 test/unit and rails problem.
|
|
139
|
+
* Added contributed rake man file (Jani Monoses).
|
|
140
|
+
* Added Brian Candler's fix for problems in --trace and --dry-run
|
|
141
|
+
mode.
|
|
142
|
+
|
|
143
|
+
== Version 0.4.15
|
|
144
|
+
|
|
145
|
+
* Fixed a bug that prevented the TESTOPTS flag from working with the
|
|
146
|
+
revised for 1.8.2 test task.
|
|
147
|
+
* Updated the docs on --trace to indicate that it also enables a full
|
|
148
|
+
backtrace on errors.
|
|
149
|
+
|
|
150
|
+
== Version 0.4.14
|
|
151
|
+
|
|
152
|
+
* Modified the TestTask to workaround the Ruby 1.8.2 change in
|
|
153
|
+
autoexecuting unit tests.
|
|
154
|
+
|
|
155
|
+
== Version 0.4.13
|
|
156
|
+
|
|
157
|
+
* Fixed the dry-run flag so it is operating again.
|
|
158
|
+
* Multiple arguments to sh and ruby commands will not be interpreted
|
|
159
|
+
by the shell (patch provided by Jonathan Paisley).
|
|
160
|
+
|
|
161
|
+
== Version 0.4.12
|
|
162
|
+
|
|
163
|
+
* Added --silent (-s) to suppress the (in directory) rake message.
|
|
164
|
+
|
|
165
|
+
== Version 0.4.11
|
|
166
|
+
|
|
167
|
+
* Changed the "don't know how to rake" message (finally)
|
|
168
|
+
* Changes references to a literal "Rakefile" to reference the global
|
|
169
|
+
variable $rakefile (which contains the actual name of the rakefile).
|
|
170
|
+
|
|
171
|
+
== Version 0.4.10
|
|
172
|
+
|
|
173
|
+
* Added block support to the "sh" command, allowing users to take
|
|
174
|
+
special actions on the result of the system call. E.g.
|
|
175
|
+
|
|
176
|
+
sh "shell_command" do |ok, res|
|
|
177
|
+
puts "Program returned #{res.exitstatus}" if ! ok
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
== Version 0.4.9
|
|
181
|
+
|
|
182
|
+
* Switched to Jamis Buck's RDoc template.
|
|
183
|
+
* Removed autorequire from Rake's gem spec. This prevents the Rake
|
|
184
|
+
libraries from loading while using rails.
|
|
185
|
+
|
|
3
186
|
== Version 0.4.8
|
|
4
187
|
|
|
5
188
|
* Added support for .rb versions of Rakefile.
|
data/README
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
= RAKE -- Ruby Make
|
|
2
2
|
|
|
3
|
+
Supporting Rake version: 0.7.x
|
|
4
|
+
|
|
3
5
|
This package contains Rake, a simple ruby build program with
|
|
4
6
|
capabilities similar to make.
|
|
5
7
|
|
|
@@ -13,9 +15,11 @@ Rake has the following features:
|
|
|
13
15
|
|
|
14
16
|
* Rake supports rule patterns to sythesize implicit tasks.
|
|
15
17
|
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
* Flexible FileLists that act like arrays but know about manipulating
|
|
19
|
+
file names and paths.
|
|
20
|
+
|
|
21
|
+
* A library of prepackaged tasks to make building rakefiles easier.
|
|
22
|
+
|
|
19
23
|
|
|
20
24
|
== Download
|
|
21
25
|
|
|
@@ -23,12 +27,6 @@ The latest version of rake can be found at
|
|
|
23
27
|
|
|
24
28
|
* http://rubyforge.org/project/showfiles.php?group_id=50
|
|
25
29
|
|
|
26
|
-
Online Resources can be found at ...
|
|
27
|
-
|
|
28
|
-
* Online Rake Documentation: http://rake.rubyforge.org
|
|
29
|
-
* Rake Project Page: http://rubyforge.org/projects/rake
|
|
30
|
-
* Rake Project Wiki: http://rake.rubyforge.org/wiki/wiki.pl
|
|
31
|
-
|
|
32
30
|
== Installation
|
|
33
31
|
|
|
34
32
|
=== Normal Installation
|
|
@@ -45,7 +43,30 @@ Download and install rake with the following.
|
|
|
45
43
|
|
|
46
44
|
gem install --remote rake
|
|
47
45
|
|
|
48
|
-
|
|
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
|
+
|
|
56
|
+
== Online Resources
|
|
57
|
+
|
|
58
|
+
== Rake References
|
|
59
|
+
|
|
60
|
+
* Rake Documentation Home: http://docs.rubyrake.org
|
|
61
|
+
* Rake Project Page: http://rubyforge.org/projects/rake
|
|
62
|
+
* Rake API Documents: http://rake.rubyforge.org
|
|
63
|
+
|
|
64
|
+
== Presentations and Articles about Rake
|
|
65
|
+
|
|
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
|
|
68
|
+
|
|
69
|
+
=== Road Map
|
|
49
70
|
|
|
50
71
|
* If you want to see how to invoke rake to build your projects, read on.
|
|
51
72
|
* If you want to see the format of a Rakefile, see
|
|
@@ -55,7 +76,6 @@ Download and install rake with the following.
|
|
|
55
76
|
* If you want to see a glossary of terms, see
|
|
56
77
|
doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
|
|
57
78
|
|
|
58
|
-
|
|
59
79
|
== Simple Example
|
|
60
80
|
|
|
61
81
|
Once installed, you can run rake as follows ...
|
|
@@ -88,11 +108,15 @@ package.
|
|
|
88
108
|
Rake is a late entry in the make replacement field. Here are links to
|
|
89
109
|
other projects with similar (and not so similar) goals.
|
|
90
110
|
|
|
111
|
+
* http://directory.fsf.org/bras.html -- Bras, one of earliest
|
|
112
|
+
implementations of "make in a scripting language".
|
|
91
113
|
* http://www.a-a-p.org -- Make in Python
|
|
92
114
|
* http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make
|
|
93
115
|
* http://ant.apache.org -- The Ant project
|
|
94
|
-
* http://
|
|
95
|
-
|
|
116
|
+
* http://ppt.perl.org/commands/make/index.html -- Make from the Perl
|
|
117
|
+
Power Tools implementation.
|
|
118
|
+
* http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
|
|
119
|
+
* http://make.rubyforge.org -- Rant, another Ruby make tool.
|
|
96
120
|
|
|
97
121
|
== Credits
|
|
98
122
|
|
|
@@ -100,6 +124,8 @@ other projects with similar (and not so similar) goals.
|
|
|
100
124
|
|
|
101
125
|
[<b>nobu.nokada@softhome.net</b>] For the initial patch for rule support.
|
|
102
126
|
|
|
127
|
+
[<b>Tilman Sauerbeck <tilman@code-monkey.de></b>] For the recursive rule patch.
|
|
128
|
+
|
|
103
129
|
== License
|
|
104
130
|
|
|
105
131
|
Rake is available under an MIT-style license.
|
|
@@ -134,6 +160,13 @@ Options are:
|
|
|
134
160
|
during the execution of the <b>rake</b> command. You can access
|
|
135
161
|
the value by using ENV['<em>name</em>'].
|
|
136
162
|
|
|
163
|
+
[<tt>--classic-namespace</tt> (-n)]
|
|
164
|
+
Import the Task, FileTask, and FileCreateTask into the top-level
|
|
165
|
+
scope to be compatible with older versions of Rake. Alternatively
|
|
166
|
+
you can include the line <code>require
|
|
167
|
+
'rake/classic_namespace'</code> in your Rakefile to get the
|
|
168
|
+
classic behavior.
|
|
169
|
+
|
|
137
170
|
[<tt>--dry-run</tt> (-n)]
|
|
138
171
|
Do a dry run. Print the tasks invoked and executed, but do not
|
|
139
172
|
actually execute any of the actions.
|
|
@@ -169,7 +202,7 @@ Options are:
|
|
|
169
202
|
are defined using the "desc" command.
|
|
170
203
|
|
|
171
204
|
[<tt>--trace</tt> (-t)]
|
|
172
|
-
Turn on invoke/execute tracing.
|
|
205
|
+
Turn on invoke/execute tracing. Also enable full backtrace on errors.
|
|
173
206
|
|
|
174
207
|
[<tt>--usage</tt> (-h)]
|
|
175
208
|
Display a usage message and exit.
|
data/Rakefile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
# This file
|
|
6
|
+
# This file may be distributed under an MIT style license. See
|
|
7
7
|
# MIT-LICENSE for details.
|
|
8
8
|
|
|
9
9
|
begin
|
|
@@ -16,15 +16,31 @@ require 'rake/clean'
|
|
|
16
16
|
require 'rake/testtask'
|
|
17
17
|
require 'rake/rdoctask'
|
|
18
18
|
|
|
19
|
-
CLEAN.include('**/*.o')
|
|
20
|
-
CLOBBER.include('doc/example/main')
|
|
19
|
+
CLEAN.include('**/*.o', '*.dot')
|
|
20
|
+
CLOBBER.include('doc/example/main', 'testdata')
|
|
21
|
+
CLOBBER.include('test/data/**/temp_*')
|
|
22
|
+
CLOBBER.include('test/data/chains/play.*')
|
|
23
|
+
CLOBBER.include('test/data/file_creation_task/build')
|
|
24
|
+
CLOBBER.include('test/data/file_creation_task/src')
|
|
25
|
+
CLOBBER.include('TAGS')
|
|
26
|
+
CLOBBER.include('coverage')
|
|
27
|
+
|
|
28
|
+
def announce(msg='')
|
|
29
|
+
STDERR.puts msg
|
|
30
|
+
end
|
|
21
31
|
|
|
22
32
|
# Determine the current version of the software
|
|
23
33
|
|
|
24
|
-
if `ruby -Ilib ./bin/rake --version` =~
|
|
25
|
-
|
|
34
|
+
if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9.]+)$/
|
|
35
|
+
CURRENT_VERSION = $1
|
|
36
|
+
else
|
|
37
|
+
CURRENT_VERSION = "0.0.0"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
if ENV['REL']
|
|
41
|
+
PKG_VERSION = ENV['REL']
|
|
26
42
|
else
|
|
27
|
-
PKG_VERSION =
|
|
43
|
+
PKG_VERSION = CURRENT_VERSION
|
|
28
44
|
end
|
|
29
45
|
|
|
30
46
|
SRC_RB = FileList['lib/**/*.rb']
|
|
@@ -32,48 +48,69 @@ SRC_RB = FileList['lib/**/*.rb']
|
|
|
32
48
|
# The default task is run if rake is given no explicit arguments.
|
|
33
49
|
|
|
34
50
|
desc "Default Task"
|
|
35
|
-
task :default => :
|
|
51
|
+
task :default => :test_all
|
|
36
52
|
|
|
37
53
|
# Test Tasks ---------------------------------------------------------
|
|
38
54
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
# Common Abbreviations ...
|
|
56
|
+
|
|
57
|
+
task :ta => :test_all
|
|
58
|
+
task :tf => :test_functional
|
|
59
|
+
task :tu => :test_units
|
|
60
|
+
task :tc => :test_contribs
|
|
61
|
+
task :test => :test_units
|
|
62
|
+
|
|
63
|
+
Rake::TestTask.new(:test_all) do |t|
|
|
64
|
+
t.test_files = FileList[
|
|
65
|
+
'test/test*.rb',
|
|
66
|
+
'test/contrib/test*.rb',
|
|
67
|
+
'test/fun*.rb'
|
|
68
|
+
]
|
|
69
|
+
t.warning = true
|
|
70
|
+
t.verbose = false
|
|
42
71
|
end
|
|
43
72
|
|
|
44
|
-
Rake::TestTask.new(:
|
|
45
|
-
t.
|
|
46
|
-
t.
|
|
73
|
+
Rake::TestTask.new(:test_units) do |t|
|
|
74
|
+
t.test_files = FileList['test/test*.rb']
|
|
75
|
+
t.warning = true
|
|
76
|
+
t.verbose = false
|
|
47
77
|
end
|
|
48
78
|
|
|
49
|
-
Rake::TestTask.new(:
|
|
50
|
-
t.
|
|
51
|
-
t.
|
|
79
|
+
Rake::TestTask.new(:test_functional) do |t|
|
|
80
|
+
t.test_files = FileList['test/fun*.rb']
|
|
81
|
+
t.warning = true
|
|
82
|
+
t.warning = true
|
|
52
83
|
end
|
|
53
84
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
85
|
+
Rake::TestTask.new(:test_contribs) do |t|
|
|
86
|
+
t.test_files = FileList['test/contrib/test*.rb']
|
|
87
|
+
t.verbose = false
|
|
88
|
+
t.warning = true
|
|
89
|
+
end
|
|
59
90
|
|
|
60
|
-
|
|
91
|
+
begin
|
|
92
|
+
require 'rcov/rcovtask'
|
|
93
|
+
|
|
94
|
+
Rcov::RcovTask.new do |t|
|
|
95
|
+
t.libs << "test"
|
|
96
|
+
t.rcov_opts = ['-xRakefile', '-xrakefile', '-xpublish.rf', '--text-report']
|
|
97
|
+
t.test_files = FileList[
|
|
98
|
+
'test/test*.rb',
|
|
99
|
+
'test/contrib/test*.rb'
|
|
100
|
+
]
|
|
101
|
+
t.verbose = true
|
|
102
|
+
end
|
|
103
|
+
rescue LoadError
|
|
104
|
+
# No rcov available
|
|
105
|
+
end
|
|
61
106
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
task
|
|
107
|
+
directory 'testdata'
|
|
108
|
+
[:test_all, :test_units, :test_contribs, :test_functional].each do |t|
|
|
109
|
+
task t => ['testdata']
|
|
110
|
+
end
|
|
65
111
|
|
|
66
112
|
# CVS Tasks ----------------------------------------------------------
|
|
67
113
|
|
|
68
|
-
desc "Tag all the CVS files with the latest release number (TAG=x)"
|
|
69
|
-
task :tag do
|
|
70
|
-
rel = "REL_" + PKG_VERSION.gsub(/\./, '_')
|
|
71
|
-
rel << ENV['TAG'] if ENV['TAG']
|
|
72
|
-
puts rel
|
|
73
|
-
sh %{cvs commit -m 'pre-tag commit'}
|
|
74
|
-
sh %{cvs tag #{rel}}
|
|
75
|
-
end
|
|
76
|
-
|
|
77
114
|
# Install rake using the standard install.rb script.
|
|
78
115
|
|
|
79
116
|
desc "Install the application"
|
|
@@ -87,8 +124,11 @@ rd = Rake::RDocTask.new("rdoc") { |rdoc|
|
|
|
87
124
|
rdoc.rdoc_dir = 'html'
|
|
88
125
|
# rdoc.template = 'kilmer'
|
|
89
126
|
# rdoc.template = 'css2'
|
|
127
|
+
rdoc.template = 'doc/jamis.rb'
|
|
90
128
|
rdoc.title = "Rake -- Ruby Make"
|
|
91
|
-
rdoc.options << '--line-numbers' << '--inline-source' <<
|
|
129
|
+
rdoc.options << '--line-numbers' << '--inline-source' <<
|
|
130
|
+
'--main' << 'README' <<
|
|
131
|
+
'--title' << 'Rake -- Ruby Make'
|
|
92
132
|
rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
|
|
93
133
|
rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
|
|
94
134
|
rdoc.rdoc_files.exclude(/\bcontrib\b/)
|
|
@@ -104,6 +144,9 @@ PKG_FILES = FileList[
|
|
|
104
144
|
'bin/**/*',
|
|
105
145
|
'lib/**/*.rb',
|
|
106
146
|
'test/**/*.rb',
|
|
147
|
+
'test/**/*.rf',
|
|
148
|
+
'test/**/*.mf',
|
|
149
|
+
'test/**/Rakefile',
|
|
107
150
|
'doc/**/*'
|
|
108
151
|
]
|
|
109
152
|
PKG_FILES.exclude('doc/example/*.o')
|
|
@@ -140,7 +183,6 @@ else
|
|
|
140
183
|
#### Load-time details: library and application (you will need one or both).
|
|
141
184
|
|
|
142
185
|
s.require_path = 'lib' # Use these for libraries.
|
|
143
|
-
s.autorequire = 'rake'
|
|
144
186
|
|
|
145
187
|
s.bindir = "bin" # Use these for applications.
|
|
146
188
|
s.executables = ["rake"]
|
|
@@ -150,21 +192,22 @@ else
|
|
|
150
192
|
|
|
151
193
|
s.has_rdoc = true
|
|
152
194
|
s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
|
153
|
-
s.rdoc_options
|
|
154
|
-
'--title' << 'Rake -- Ruby Make' <<
|
|
155
|
-
'--main' << 'README' <<
|
|
156
|
-
'--line-numbers'
|
|
195
|
+
s.rdoc_options = rd.options
|
|
157
196
|
|
|
158
197
|
#### Author and project details.
|
|
159
198
|
|
|
160
199
|
s.author = "Jim Weirich"
|
|
161
200
|
s.email = "jim@weirichhouse.org"
|
|
162
|
-
s.homepage = "http://
|
|
201
|
+
s.homepage = "http://rake.rubyforge.org"
|
|
163
202
|
s.rubyforge_project = "rake"
|
|
203
|
+
# if ENV['CERT_DIR']
|
|
204
|
+
# s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
|
|
205
|
+
# s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
|
|
206
|
+
# end
|
|
164
207
|
end
|
|
165
208
|
|
|
166
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
|
167
|
-
|
|
209
|
+
package_task = Rake::GemPackageTask.new(spec) do |pkg|
|
|
210
|
+
pkg.need_zip = true
|
|
168
211
|
pkg.need_tar = true
|
|
169
212
|
end
|
|
170
213
|
end
|
|
@@ -213,3 +256,128 @@ end
|
|
|
213
256
|
# publish.rf file is not found, the publish targets won't be defined.
|
|
214
257
|
|
|
215
258
|
load "publish.rf" if File.exist? "publish.rf"
|
|
259
|
+
|
|
260
|
+
# Support Tasks ------------------------------------------------------
|
|
261
|
+
|
|
262
|
+
desc "Look for TODO and FIXME tags in the code"
|
|
263
|
+
task :todo do
|
|
264
|
+
FileList['**/*.rb'].exclude('pkg').egrep(/#.*(FIXME|TODO|TBD)/)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
desc "Look for Debugging print lines"
|
|
268
|
+
task :dbg do
|
|
269
|
+
FileList['**/*.rb'].egrep(/\bDBG|\bbreakpoint\b/)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
desc "List all ruby files"
|
|
273
|
+
task :rubyfiles do
|
|
274
|
+
puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
|
|
275
|
+
puts Dir['bin/*'].reject { |fn| fn =~ /CVS|(~$)|(\.rb$)/ }
|
|
276
|
+
end
|
|
277
|
+
task :rf => :rubyfiles
|
|
278
|
+
|
|
279
|
+
# --------------------------------------------------------------------
|
|
280
|
+
# Creating a release
|
|
281
|
+
|
|
282
|
+
desc "Make a new release"
|
|
283
|
+
task :release => [
|
|
284
|
+
:prerelease,
|
|
285
|
+
:clobber,
|
|
286
|
+
:test_all,
|
|
287
|
+
:update_version,
|
|
288
|
+
:package,
|
|
289
|
+
:tag] do
|
|
290
|
+
|
|
291
|
+
announce
|
|
292
|
+
announce "**************************************************************"
|
|
293
|
+
announce "* Release #{PKG_VERSION} Complete."
|
|
294
|
+
announce "* Packages ready to upload."
|
|
295
|
+
announce "**************************************************************"
|
|
296
|
+
announce
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Validate that everything is ready to go for a release.
|
|
300
|
+
task :prerelease do
|
|
301
|
+
announce
|
|
302
|
+
announce "**************************************************************"
|
|
303
|
+
announce "* Making RubyGem Release #{PKG_VERSION}"
|
|
304
|
+
announce "* (current version #{CURRENT_VERSION})"
|
|
305
|
+
announce "**************************************************************"
|
|
306
|
+
announce
|
|
307
|
+
|
|
308
|
+
# Is a release number supplied?
|
|
309
|
+
unless ENV['REL']
|
|
310
|
+
fail "Usage: rake release REL=x.y.z [REUSE=tag_suffix]"
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Is the release different than the current release.
|
|
314
|
+
# (or is REUSE set?)
|
|
315
|
+
if PKG_VERSION == CURRENT_VERSION && ! ENV['REUSE']
|
|
316
|
+
fail "Current version is #{PKG_VERSION}, must specify REUSE=tag_suffix to reuse version"
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Are all source files checked in?
|
|
320
|
+
if ENV['RELTEST']
|
|
321
|
+
announce "Release Task Testing, skipping checked-in file test"
|
|
322
|
+
else
|
|
323
|
+
announce "Checking for unchecked-in files..."
|
|
324
|
+
data = `cvs -q update`
|
|
325
|
+
unless data =~ /^$/
|
|
326
|
+
fail "CVS update is not clean ... do you have unchecked-in files?"
|
|
327
|
+
end
|
|
328
|
+
announce "No outstanding checkins found ... OK"
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
task :update_version => [:prerelease] do
|
|
333
|
+
if PKG_VERSION == CURRENT_VERSION
|
|
334
|
+
announce "No version change ... skipping version update"
|
|
335
|
+
else
|
|
336
|
+
announce "Updating Rake version to #{PKG_VERSION}"
|
|
337
|
+
open("lib/rake.rb") do |rakein|
|
|
338
|
+
open("lib/rake.rb.new", "w") do |rakeout|
|
|
339
|
+
rakein.each do |line|
|
|
340
|
+
if line =~ /^RAKEVERSION\s*=\s*/
|
|
341
|
+
rakeout.puts "RAKEVERSION = '#{PKG_VERSION}'"
|
|
342
|
+
else
|
|
343
|
+
rakeout.puts line
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
mv "lib/rake.rb.new", "lib/rake.rb"
|
|
349
|
+
if ENV['RELTEST']
|
|
350
|
+
announce "Release Task Testing, skipping commiting of new version"
|
|
351
|
+
else
|
|
352
|
+
sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rake.rb} # "
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
|
|
358
|
+
task :tag => [:prerelease] do
|
|
359
|
+
reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
|
|
360
|
+
reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
|
|
361
|
+
announce "Tagging CVS with [#{reltag}]"
|
|
362
|
+
if ENV['RELTEST']
|
|
363
|
+
announce "Release Task Testing, skipping CVS tagging"
|
|
364
|
+
else
|
|
365
|
+
sh %{cvs tag #{reltag}}
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
desc "Install the jamis RDoc template"
|
|
370
|
+
task :install_jamis_template do
|
|
371
|
+
require 'rbconfig'
|
|
372
|
+
dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
|
|
373
|
+
fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
|
|
374
|
+
install "doc/jamis.rb", dest_dir, :verbose => true
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Require experimental XForge/Metaproject support.
|
|
378
|
+
|
|
379
|
+
load 'xforge.rf' if File.exist?('xforge.rf')
|
|
380
|
+
|
|
381
|
+
task :where_am_i do
|
|
382
|
+
puts Rake.original_dir
|
|
383
|
+
end
|