craigmarksmith-rake 0.8.3.100

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.
Files changed (104) hide show
  1. data/CHANGES +427 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +196 -0
  4. data/Rakefile +416 -0
  5. data/TODO +20 -0
  6. data/bin/rake +31 -0
  7. data/doc/command_line_usage.rdoc +102 -0
  8. data/doc/example/Rakefile1 +38 -0
  9. data/doc/example/Rakefile2 +35 -0
  10. data/doc/example/a.c +6 -0
  11. data/doc/example/b.c +6 -0
  12. data/doc/example/main.c +11 -0
  13. data/doc/glossary.rdoc +51 -0
  14. data/doc/jamis.rb +591 -0
  15. data/doc/proto_rake.rdoc +127 -0
  16. data/doc/rake.1.gz +0 -0
  17. data/doc/rakefile.rdoc +534 -0
  18. data/doc/rational.rdoc +151 -0
  19. data/doc/release_notes/rake-0.4.14.rdoc +23 -0
  20. data/doc/release_notes/rake-0.4.15.rdoc +35 -0
  21. data/doc/release_notes/rake-0.5.0.rdoc +53 -0
  22. data/doc/release_notes/rake-0.5.3.rdoc +78 -0
  23. data/doc/release_notes/rake-0.5.4.rdoc +46 -0
  24. data/doc/release_notes/rake-0.6.0.rdoc +141 -0
  25. data/doc/release_notes/rake-0.7.0.rdoc +119 -0
  26. data/doc/release_notes/rake-0.7.1.rdoc +59 -0
  27. data/doc/release_notes/rake-0.7.2.rdoc +121 -0
  28. data/doc/release_notes/rake-0.7.3.rdoc +47 -0
  29. data/doc/release_notes/rake-0.8.0.rdoc +114 -0
  30. data/doc/release_notes/rake-0.8.2.rdoc +165 -0
  31. data/doc/release_notes/rake-0.8.3.rdoc +112 -0
  32. data/doc/release_notes/rake-0.8.4.rdoc +147 -0
  33. data/install.rb +88 -0
  34. data/lib/rake/classic_namespace.rb +8 -0
  35. data/lib/rake/clean.rb +33 -0
  36. data/lib/rake/contrib/compositepublisher.rb +24 -0
  37. data/lib/rake/contrib/ftptools.rb +153 -0
  38. data/lib/rake/contrib/publisher.rb +75 -0
  39. data/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  40. data/lib/rake/contrib/sshpublisher.rb +47 -0
  41. data/lib/rake/contrib/sys.rb +209 -0
  42. data/lib/rake/gempackagetask.rb +97 -0
  43. data/lib/rake/loaders/makefile.rb +42 -0
  44. data/lib/rake/packagetask.rb +184 -0
  45. data/lib/rake/rake_test_loader.rb +5 -0
  46. data/lib/rake/rdoctask.rb +209 -0
  47. data/lib/rake/ruby182_test_unit_fix.rb +23 -0
  48. data/lib/rake/runtest.rb +23 -0
  49. data/lib/rake/tasklib.rb +23 -0
  50. data/lib/rake/testtask.rb +161 -0
  51. data/lib/rake/win32.rb +55 -0
  52. data/lib/rake.rb +2519 -0
  53. data/test/capture_stdout.rb +26 -0
  54. data/test/check_expansion.rb +5 -0
  55. data/test/contrib/test_sys.rb +47 -0
  56. data/test/data/chains/Rakefile +15 -0
  57. data/test/data/default/Rakefile +19 -0
  58. data/test/data/dryrun/Rakefile +22 -0
  59. data/test/data/file_creation_task/Rakefile +33 -0
  60. data/test/data/imports/Rakefile +19 -0
  61. data/test/data/imports/deps.mf +1 -0
  62. data/test/data/multidesc/Rakefile +17 -0
  63. data/test/data/namespace/Rakefile +57 -0
  64. data/test/data/rakelib/test1.rb +3 -0
  65. data/test/data/rbext/rakefile.rb +3 -0
  66. data/test/data/sample.mf +14 -0
  67. data/test/data/statusreturn/Rakefile +8 -0
  68. data/test/data/unittest/Rakefile +1 -0
  69. data/test/filecreation.rb +32 -0
  70. data/test/functional.rb +15 -0
  71. data/test/in_environment.rb +30 -0
  72. data/test/rake_test_setup.rb +24 -0
  73. data/test/reqfile.rb +3 -0
  74. data/test/reqfile2.rb +3 -0
  75. data/test/session_functional.rb +339 -0
  76. data/test/shellcommand.rb +3 -0
  77. data/test/test_application.rb +690 -0
  78. data/test/test_clean.rb +14 -0
  79. data/test/test_definitions.rb +85 -0
  80. data/test/test_earlytime.rb +35 -0
  81. data/test/test_extension.rb +63 -0
  82. data/test/test_file_creation_task.rb +62 -0
  83. data/test/test_file_task.rb +143 -0
  84. data/test/test_filelist.rb +623 -0
  85. data/test/test_fileutils.rb +251 -0
  86. data/test/test_ftp.rb +59 -0
  87. data/test/test_invocation_chain.rb +81 -0
  88. data/test/test_makefile_loader.rb +26 -0
  89. data/test/test_multitask.rb +45 -0
  90. data/test/test_namespace.rb +55 -0
  91. data/test/test_package_task.rb +118 -0
  92. data/test/test_pathmap.rb +210 -0
  93. data/test/test_rake.rb +41 -0
  94. data/test/test_rdoc_task.rb +88 -0
  95. data/test/test_require.rb +35 -0
  96. data/test/test_rules.rb +349 -0
  97. data/test/test_task_arguments.rb +89 -0
  98. data/test/test_task_manager.rb +173 -0
  99. data/test/test_tasklib.rb +12 -0
  100. data/test/test_tasks.rb +374 -0
  101. data/test/test_test_task.rb +77 -0
  102. data/test/test_top_level_functions.rb +86 -0
  103. data/test/test_win32.rb +72 -0
  104. metadata +186 -0
data/Rakefile ADDED
@@ -0,0 +1,416 @@
1
+ # Rakefile for rake -*- ruby -*-
2
+
3
+ # Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
4
+ # All rights reserved.
5
+
6
+ # This file may be distributed under an MIT style license. See
7
+ # MIT-LICENSE for details.
8
+
9
+ begin
10
+ require 'rubygems'
11
+ require 'rake/gempackagetask'
12
+ rescue Exception
13
+ nil
14
+ end
15
+ require 'rake/clean'
16
+ require 'rake/testtask'
17
+ require 'rake/rdoctask'
18
+
19
+ CLEAN.include('**/*.o', '*.dot', '**/.*.rbc')
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', 'rcov_aggregate')
27
+
28
+ # Prevent OS X from including extended attribute junk in the tar output
29
+ ENV['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
30
+
31
+ def announce(msg='')
32
+ STDERR.puts msg
33
+ end
34
+
35
+ # Determine the current version of the software
36
+
37
+ if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9.]+)$/
38
+ CURRENT_VERSION = $1
39
+ else
40
+ CURRENT_VERSION = "0.0.0"
41
+ end
42
+
43
+ $package_version = CURRENT_VERSION
44
+
45
+ SRC_RB = FileList['lib/**/*.rb']
46
+
47
+ # The default task is run if rake is given no explicit arguments.
48
+
49
+ desc "Default Task"
50
+ task :default => :test_all
51
+
52
+ # Test Tasks ---------------------------------------------------------
53
+ task :dbg do |t|
54
+ puts "Arguments are: #{t.args.join(', ')}"
55
+ end
56
+
57
+ # Common Abbreviations ...
58
+
59
+ task :ta => :test_all
60
+ task :tf => :test_functional
61
+ task :tu => :test_units
62
+ task :tc => :test_contribs
63
+ task :test => :test_units
64
+
65
+ Rake::TestTask.new(:test_all) do |t|
66
+ t.test_files = FileList[
67
+ 'test/test*.rb',
68
+ 'test/contrib/test*.rb',
69
+ 'test/fun*.rb'
70
+ ]
71
+ t.warning = true
72
+ t.verbose = false
73
+ end
74
+
75
+ Rake::TestTask.new(:test_units) do |t|
76
+ t.test_files = FileList['test/test*.rb']
77
+ t.warning = true
78
+ t.verbose = false
79
+ end
80
+
81
+ Rake::TestTask.new(:test_functional) do |t|
82
+ t.test_files = FileList['test/fun*.rb']
83
+ t.warning = true
84
+ t.verbose = false
85
+ end
86
+
87
+ Rake::TestTask.new(:test_contribs) do |t|
88
+ t.test_files = FileList['test/contrib/test*.rb']
89
+ t.warning = true
90
+ t.verbose = false
91
+ end
92
+
93
+ begin
94
+ require 'rcov/rcovtask'
95
+
96
+ Rcov::RcovTask.new do |t|
97
+ t.libs << "test"
98
+ dot_rakes =
99
+ t.rcov_opts = [
100
+ '-xRakefile', '-xrakefile', '-xpublish.rf',
101
+ '-xlib/rake/contrib', '-x/Library',
102
+ '--text-report',
103
+ '--sort coverage'
104
+ ] + FileList['rakelib/*.rake'].pathmap("-x%p")
105
+ t.test_files = FileList[
106
+ 'test/test*.rb', 'test/functional.rb'
107
+ ]
108
+ t.output_dir = 'coverage'
109
+ t.verbose = true
110
+ end
111
+ rescue LoadError
112
+ puts "RCov is not available"
113
+ end
114
+
115
+ directory 'testdata'
116
+ [:test_all, :test_units, :test_contribs, :test_functional].each do |t|
117
+ task t => ['testdata']
118
+ end
119
+
120
+ # CVS Tasks ----------------------------------------------------------
121
+
122
+ # Install rake using the standard install.rb script.
123
+
124
+ desc "Install the application"
125
+ task :install do
126
+ ruby "install.rb"
127
+ end
128
+
129
+ # Create a task to build the RDOC documentation tree.
130
+
131
+ rd = Rake::RDocTask.new("rdoc") { |rdoc|
132
+ rdoc.rdoc_dir = 'html'
133
+ rdoc.template = 'doc/jamis.rb'
134
+ rdoc.title = "Rake -- Ruby Make"
135
+ rdoc.options << '--line-numbers' << '--inline-source' <<
136
+ '--main' << 'README' <<
137
+ '--title' << 'Rake -- Ruby Make'
138
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
139
+ rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
140
+ rdoc.rdoc_files.exclude(/\bcontrib\b/)
141
+ }
142
+
143
+ # ====================================================================
144
+ # Create a task that will package the Rake software into distributable
145
+ # tar, zip and gem files.
146
+
147
+ PKG_FILES = FileList[
148
+ 'install.rb',
149
+ '[A-Z]*',
150
+ 'bin/**/*',
151
+ 'lib/**/*.rb',
152
+ 'test/**/*.rb',
153
+ 'test/**/*.rf',
154
+ 'test/**/*.mf',
155
+ 'test/**/Rakefile',
156
+ 'test/**/subdir',
157
+ 'doc/**/*'
158
+ ]
159
+ PKG_FILES.exclude('doc/example/*.o')
160
+ PKG_FILES.exclude(%r{doc/example/main$})
161
+
162
+ if ! defined?(Gem)
163
+ puts "Package Target requires RubyGEMs"
164
+ else
165
+ SPEC = Gem::Specification.new do |s|
166
+
167
+ #### Basic information.
168
+
169
+ s.name = 'rake'
170
+ s.version = $package_version
171
+ s.summary = "Ruby based make-like utility."
172
+ s.description = <<-EOF
173
+ Rake is a Make-like program implemented in Ruby. Tasks
174
+ and dependencies are specified in standard Ruby syntax.
175
+ EOF
176
+
177
+ #### Dependencies and requirements.
178
+
179
+ #s.add_dependency('log4r', '> 1.0.4')
180
+ #s.requirements << ""
181
+
182
+ #### Which files are to be included in this gem? Everything! (Except CVS directories.)
183
+
184
+ s.files = PKG_FILES.to_a
185
+
186
+ #### C code extensions.
187
+
188
+ #s.extensions << "ext/rmagic/extconf.rb"
189
+
190
+ #### Load-time details: library and application (you will need one or both).
191
+
192
+ s.require_path = 'lib' # Use these for libraries.
193
+
194
+ s.bindir = "bin" # Use these for applications.
195
+ s.executables = ["rake"]
196
+ s.default_executable = "rake"
197
+
198
+ #### Documentation and testing.
199
+
200
+ s.has_rdoc = true
201
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
202
+ s.rdoc_options = rd.options
203
+
204
+ #### Author and project details.
205
+
206
+ s.author = "Jim Weirich"
207
+ s.email = "jim@weirichhouse.org"
208
+ s.homepage = "http://rake.rubyforge.org"
209
+ s.rubyforge_project = "rake"
210
+ # if ENV['CERT_DIR']
211
+ # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
212
+ # s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
213
+ # end
214
+ end
215
+
216
+ package_task = Rake::GemPackageTask.new(SPEC) do |pkg|
217
+ pkg.need_zip = true
218
+ pkg.need_tar = true
219
+ end
220
+
221
+ file "rake.gemspec" => ["Rakefile", "lib/rake.rb"] do |t|
222
+ require 'yaml'
223
+ open(t.name, "w") { |f| f.puts SPEC.to_yaml }
224
+ end
225
+
226
+ desc "Create a stand-alone gemspec"
227
+ task :gemspec => "rake.gemspec"
228
+ end
229
+
230
+ # Misc tasks =========================================================
231
+
232
+ def count_lines(filename)
233
+ lines = 0
234
+ codelines = 0
235
+ open(filename) { |f|
236
+ f.each do |line|
237
+ lines += 1
238
+ next if line =~ /^\s*$/
239
+ next if line =~ /^\s*#/
240
+ codelines += 1
241
+ end
242
+ }
243
+ [lines, codelines]
244
+ end
245
+
246
+ def show_line(msg, lines, loc)
247
+ printf "%6s %6s %s\n", lines.to_s, loc.to_s, msg
248
+ end
249
+
250
+ desc "Count lines in the main rake file"
251
+ task :lines do
252
+ total_lines = 0
253
+ total_code = 0
254
+ show_line("File Name", "LINES", "LOC")
255
+ SRC_RB.each do |fn|
256
+ lines, codelines = count_lines(fn)
257
+ show_line(fn, lines, codelines)
258
+ total_lines += lines
259
+ total_code += codelines
260
+ end
261
+ show_line("TOTAL", total_lines, total_code)
262
+ end
263
+
264
+ # Define an optional publish target in an external file. If the
265
+ # publish.rf file is not found, the publish targets won't be defined.
266
+
267
+ load "publish.rf" if File.exist? "publish.rf"
268
+
269
+ # Support Tasks ------------------------------------------------------
270
+
271
+ RUBY_FILES = FileList['**/*.rb'].exclude('pkg')
272
+
273
+ desc "Look for TODO and FIXME tags in the code"
274
+ task :todo do
275
+ RUBY_FILES.egrep(/#.*(FIXME|TODO|TBD)/)
276
+ end
277
+
278
+ desc "Look for Debugging print lines"
279
+ task :dbg do
280
+ RUBY_FILES.egrep(/\bDBG|\bbreakpoint\b/)
281
+ end
282
+
283
+ desc "List all ruby files"
284
+ task :rubyfiles do
285
+ puts RUBY_FILES
286
+ puts FileList['bin/*'].exclude('bin/*.rb')
287
+ end
288
+ task :rf => :rubyfiles
289
+
290
+ desc "Create a TAGS file"
291
+ task :tags => "TAGS"
292
+
293
+ TAGS = 'xctags -e'
294
+
295
+ file "TAGS" => RUBY_FILES do
296
+ puts "Makings TAGS"
297
+ sh "#{TAGS} #{RUBY_FILES}", :verbose => false
298
+ end
299
+
300
+ # --------------------------------------------------------------------
301
+ # Creating a release
302
+
303
+ def plugin(plugin_name)
304
+ require "rake/plugins/#{plugin_name}"
305
+ end
306
+
307
+ task :noop
308
+ #plugin "release_manager"
309
+
310
+ desc "Make a new release"
311
+ task :release, :rel, :reuse, :reltest,
312
+ :needs => [
313
+ :prerelease,
314
+ :clobber,
315
+ :test_all,
316
+ :update_version,
317
+ :package,
318
+ :tag
319
+ ] do
320
+ announce
321
+ announce "**************************************************************"
322
+ announce "* Release #{$package_version} Complete."
323
+ announce "* Packages ready to upload."
324
+ announce "**************************************************************"
325
+ announce
326
+ end
327
+
328
+ # Validate that everything is ready to go for a release.
329
+ task :prerelease, :rel, :reuse, :reltest do |t, args|
330
+ $package_version = args.rel
331
+ announce
332
+ announce "**************************************************************"
333
+ announce "* Making RubyGem Release #{$package_version}"
334
+ announce "* (current version #{CURRENT_VERSION})"
335
+ announce "**************************************************************"
336
+ announce
337
+
338
+ # Is a release number supplied?
339
+ unless args.rel
340
+ fail "Usage: rake release[X.Y.Z] [REUSE=tag_suffix]"
341
+ end
342
+
343
+ # Is the release different than the current release.
344
+ # (or is REUSE set?)
345
+ if $package_version == CURRENT_VERSION && ! args.reuse
346
+ fail "Current version is #{$package_version}, must specify REUSE=tag_suffix to reuse version"
347
+ end
348
+
349
+ # Are all source files checked in?
350
+ if args.reltest
351
+ announce "Release Task Testing, skipping checked-in file test"
352
+ else
353
+ announce "Checking for unchecked-in files..."
354
+ data = `svn st`
355
+ unless data =~ /^$/
356
+ abort "svn status is not clean ... do you have unchecked-in files?"
357
+ end
358
+ announce "No outstanding checkins found ... OK"
359
+ end
360
+ end
361
+
362
+ task :update_version, :rel, :reuse, :reltest,
363
+ :needs => [:prerelease] do |t, args|
364
+ if args.rel == CURRENT_VERSION
365
+ announce "No version change ... skipping version update"
366
+ else
367
+ announce "Updating Rake version to #{args.rel}"
368
+ open("lib/rake.rb") do |rakein|
369
+ open("lib/rake.rb.new", "w") do |rakeout|
370
+ rakein.each do |line|
371
+ if line =~ /^RAKEVERSION\s*=\s*/
372
+ rakeout.puts "RAKEVERSION = '#{args.rel}'"
373
+ else
374
+ rakeout.puts line
375
+ end
376
+ end
377
+ end
378
+ end
379
+ mv "lib/rake.rb.new", "lib/rake.rb"
380
+ if args.reltest
381
+ announce "Release Task Testing, skipping commiting of new version"
382
+ else
383
+ sh %{svn commit -m "Updated to version #{args.rel}" lib/rake.rb} # "
384
+ end
385
+ end
386
+ end
387
+
388
+ desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
389
+ task :tag, :rel, :reuse, :reltest,
390
+ :needs => [:prerelease] do |t, args|
391
+ reltag = "REL_#{args.rel.gsub(/\./, '_')}"
392
+ reltag << args.reuse.gsub(/\./, '_') if args.reuse
393
+ announce "Tagging Repository with [#{reltag}]"
394
+ if args.reltest
395
+ announce "Release Task Testing, skipping CVS tagging"
396
+ else
397
+ sh %{svn copy svn+ssh://rubyforge.org/var/svn/rake/trunk svn+ssh://rubyforge.org/var/svn/rake/tags/#{reltag} -m 'Commiting release #{reltag}'} ###'
398
+ end
399
+ end
400
+
401
+ desc "Install the jamis RDoc template"
402
+ task :install_jamis_template do
403
+ require 'rbconfig'
404
+ dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
405
+ fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
406
+ install "doc/jamis.rb", dest_dir, :verbose => true
407
+ end
408
+
409
+ # Require experimental XForge/Metaproject support.
410
+
411
+ load 'xforge.rf' if File.exist?('xforge.rf')
412
+
413
+ desc "Where is the current directory. This task displays\nthe current rake directory"
414
+ task :where_am_i do
415
+ puts Rake.original_dir
416
+ end
data/TODO ADDED
@@ -0,0 +1,20 @@
1
+ = Rake Project -- To Do List
2
+
3
+ Send suggestions for this list to mailto:jim@weirichhouse.org or on
4
+ the rake-devel@rubyforge.org mailing list.
5
+
6
+ === To Do
7
+ * Need a nice API for accessing tasks in namespaces, namespaces in an app, etc.
8
+ * Provide a way to disable -w warning mode.
9
+ * Define a set of default rules that work in the absense of any Rakefile
10
+ * What about cyclic dependencies?
11
+ * Java support utilities
12
+ * Installation support utilities
13
+ * Check out installpkg.rb
14
+ * Autogenerate Dependencies
15
+ * Rules should apply to existing tasks if no actions are defined.
16
+ * How to create multiple package tasks without task name collision?
17
+ * Trap "ln -s" commands that fail and use "cp" instead (SMB mounted
18
+ drives have problems with "ln -s".
19
+
20
+ (moved DONE list to CHANGES file)
data/bin/rake ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #--
4
+ # Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to
8
+ # deal in the Software without restriction, including without limitation the
9
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ # sell copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ # IN THE SOFTWARE.
23
+ #++
24
+
25
+ begin
26
+ require 'rake'
27
+ rescue LoadError
28
+ require 'rubygems'
29
+ require 'rake'
30
+ end
31
+ Rake.application.run