rake 12.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.rdoc +43 -0
  3. data/Gemfile +3 -0
  4. data/History.rdoc +2344 -0
  5. data/MIT-LICENSE +21 -0
  6. data/README.rdoc +156 -0
  7. data/Rakefile +41 -0
  8. data/azure-pipelines.yml +11 -0
  9. data/bin/bundle +105 -0
  10. data/bin/console +7 -0
  11. data/bin/rake +29 -0
  12. data/bin/rdoc +29 -0
  13. data/bin/rubocop +29 -0
  14. data/bin/setup +6 -0
  15. data/doc/command_line_usage.rdoc +158 -0
  16. data/doc/example/Rakefile1 +38 -0
  17. data/doc/example/Rakefile2 +35 -0
  18. data/doc/example/a.c +6 -0
  19. data/doc/example/b.c +6 -0
  20. data/doc/example/main.c +11 -0
  21. data/doc/glossary.rdoc +42 -0
  22. data/doc/jamis.rb +592 -0
  23. data/doc/proto_rake.rdoc +127 -0
  24. data/doc/rake.1 +156 -0
  25. data/doc/rakefile.rdoc +622 -0
  26. data/doc/rational.rdoc +151 -0
  27. data/exe/rake +27 -0
  28. data/lib/rake.rb +71 -0
  29. data/lib/rake/application.rb +824 -0
  30. data/lib/rake/backtrace.rb +24 -0
  31. data/lib/rake/clean.rb +78 -0
  32. data/lib/rake/cloneable.rb +17 -0
  33. data/lib/rake/cpu_counter.rb +107 -0
  34. data/lib/rake/default_loader.rb +15 -0
  35. data/lib/rake/dsl_definition.rb +195 -0
  36. data/lib/rake/early_time.rb +22 -0
  37. data/lib/rake/ext/core.rb +26 -0
  38. data/lib/rake/ext/string.rb +176 -0
  39. data/lib/rake/file_creation_task.rb +25 -0
  40. data/lib/rake/file_list.rb +435 -0
  41. data/lib/rake/file_task.rb +54 -0
  42. data/lib/rake/file_utils.rb +137 -0
  43. data/lib/rake/file_utils_ext.rb +145 -0
  44. data/lib/rake/invocation_chain.rb +57 -0
  45. data/lib/rake/invocation_exception_mixin.rb +17 -0
  46. data/lib/rake/late_time.rb +18 -0
  47. data/lib/rake/linked_list.rb +112 -0
  48. data/lib/rake/loaders/makefile.rb +54 -0
  49. data/lib/rake/multi_task.rb +14 -0
  50. data/lib/rake/name_space.rb +38 -0
  51. data/lib/rake/packagetask.rb +207 -0
  52. data/lib/rake/phony.rb +16 -0
  53. data/lib/rake/private_reader.rb +21 -0
  54. data/lib/rake/promise.rb +100 -0
  55. data/lib/rake/pseudo_status.rb +30 -0
  56. data/lib/rake/rake_module.rb +67 -0
  57. data/lib/rake/rake_test_loader.rb +27 -0
  58. data/lib/rake/rule_recursion_overflow_error.rb +20 -0
  59. data/lib/rake/scope.rb +43 -0
  60. data/lib/rake/task.rb +413 -0
  61. data/lib/rake/task_argument_error.rb +8 -0
  62. data/lib/rake/task_arguments.rb +109 -0
  63. data/lib/rake/task_manager.rb +324 -0
  64. data/lib/rake/tasklib.rb +12 -0
  65. data/lib/rake/testtask.rb +224 -0
  66. data/lib/rake/thread_history_display.rb +49 -0
  67. data/lib/rake/thread_pool.rb +163 -0
  68. data/lib/rake/trace_output.rb +23 -0
  69. data/lib/rake/version.rb +10 -0
  70. data/lib/rake/win32.rb +51 -0
  71. data/rake.gemspec +42 -0
  72. metadata +199 -0
@@ -0,0 +1,21 @@
1
+ Copyright (c) Jim Weirich
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
@@ -0,0 +1,156 @@
1
+ = RAKE -- Ruby Make
2
+
3
+ home :: https://github.com/ruby/rake
4
+ bugs :: https://github.com/ruby/rake/issues
5
+ docs :: https://ruby.github.io/rake
6
+ build status :: {<img src="https://travis-ci.org/ruby/rake.svg?branch=master" alt="travis-ci">}[https://travis-ci.org/ruby/rake] {<img src="https://ci.appveyor.com/api/projects/status/github/ruby/rake?branch=master&svg=true" alt="appveyor">}[https://ci.appveyor.com/project/ruby/rake]
7
+
8
+ == Description
9
+
10
+ Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
11
+ specified in standard Ruby syntax.
12
+
13
+ Rake has the following features:
14
+
15
+ * Rakefiles (rake's version of Makefiles) are completely defined in
16
+ standard Ruby syntax. No XML files to edit. No quirky Makefile
17
+ syntax to worry about (is that a tab or a space?)
18
+
19
+ * Users can specify tasks with prerequisites.
20
+
21
+ * Rake supports rule patterns to synthesize implicit tasks.
22
+
23
+ * Flexible FileLists that act like arrays but know about manipulating
24
+ file names and paths.
25
+
26
+ * A library of prepackaged tasks to make building rakefiles easier. For example,
27
+ tasks for building tarballs. (Formerly
28
+ tasks for building RDoc, Gems, and publishing to FTP were included in rake but they're now
29
+ available in RDoc, RubyGems, and rake-contrib respectively.)
30
+
31
+ * Supports parallel execution of tasks.
32
+
33
+ == Installation
34
+
35
+ === Gem Installation
36
+
37
+ Download and install rake with the following.
38
+
39
+ gem install rake
40
+
41
+ == Usage
42
+
43
+ === Simple Example
44
+
45
+ First, you must write a "Rakefile" file which contains the build rules. Here's
46
+ a simple example:
47
+
48
+ task default: %w[test]
49
+
50
+ task :test do
51
+ ruby "test/unittest.rb"
52
+ end
53
+
54
+ This Rakefile has two tasks:
55
+
56
+ * A task named "test", which -- upon invocation -- will run a unit test file
57
+ in Ruby.
58
+ * A task named "default". This task does nothing by itself, but it has exactly
59
+ one dependency, namely the "test" task. Invoking the "default" task will
60
+ cause Rake to invoke the "test" task as well.
61
+
62
+ Running the "rake" command without any options will cause it to run the
63
+ "default" task in the Rakefile:
64
+
65
+ % ls
66
+ Rakefile test/
67
+ % rake
68
+ (in /home/some_user/Projects/rake)
69
+ ruby test/unittest.rb
70
+ ....unit test output here...
71
+
72
+ Type "rake --help" for all available options.
73
+
74
+ == Resources
75
+
76
+ === Rake Information
77
+
78
+ * {Rake command-line}[link:doc/command_line_usage.rdoc]
79
+ * {Writing Rakefiles}[link:doc/rakefile.rdoc]
80
+ * The original {Rake announcement}[link:doc/rational.rdoc]
81
+ * Rake {glossary}[link:doc/glossary.rdoc]
82
+
83
+ === Presentations and Articles about Rake
84
+
85
+ * Avdi Grimm's rake series:
86
+ 1. {Rake Basics}[http://devblog.avdi.org/2014/04/21/rake-part-1-basics/]
87
+ 2. {Rake File Lists}[http://devblog.avdi.org/2014/04/22/rake-part-2-file-lists/]
88
+ 3. {Rake Rules}[http://devblog.avdi.org/2014/04/23/rake-part-3-rules/]
89
+ 4. {Rake Pathmap}[http://devblog.avdi.org/2014/04/24/rake-part-4-pathmap/]
90
+ 5. {File Operations}[http://devblog.avdi.org/2014/04/25/rake-part-5-file-operations/]
91
+ 6. {Clean and Clobber}[http://devblog.avdi.org/2014/04/28/rake-part-6-clean-and-clobber/]
92
+ 7. {MultiTask}[http://devblog.avdi.org/2014/04/29/rake-part-7-multitask/]
93
+ * {Jim Weirich's 2003 RubyConf presentation}[http://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/]
94
+ * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
95
+
96
+ == Other Make Re-envisionings ...
97
+
98
+ Rake is a late entry in the make replacement field. Here are links to
99
+ other projects with similar (and not so similar) goals.
100
+
101
+ * http://directory.fsf.org/wiki/Bras -- Bras, one of earliest
102
+ implementations of "make in a scripting language".
103
+ * http://www.a-a-p.org -- Make in Python
104
+ * http://ant.apache.org -- The Ant project
105
+ * http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
106
+ * http://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool.
107
+
108
+ == Credits
109
+
110
+ [<b>Jim Weirich</b>] Who originally created Rake.
111
+
112
+ [<b>Ryan Dlugosz</b>] For the initial conversation that sparked Rake.
113
+
114
+ [<b>Nobuyoshi Nakada <nobu@ruby-lang.org></b>] For the initial patch for rule support.
115
+
116
+ [<b>Tilman Sauerbeck <tilman@code-monkey.de></b>] For the recursive rule patch.
117
+
118
+ [<b>Eric Hodel</b>] For aid in maintaining rake.
119
+
120
+ [<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10.X and Rake 11.X
121
+
122
+ == License
123
+
124
+ Rake is available under an MIT-style license.
125
+
126
+ :include: MIT-LICENSE
127
+
128
+ ---
129
+
130
+ = Other stuff
131
+
132
+ Author:: Jim Weirich <jim.weirich@gmail.com>
133
+ Requires:: Ruby 2.0.0 or later
134
+ License:: Copyright Jim Weirich.
135
+ Released under an MIT-style license. See the MIT-LICENSE
136
+ file included in the distribution.
137
+
138
+ == Warranty
139
+
140
+ This software is provided "as is" and without any express or implied
141
+ warranties, including, without limitation, the implied warranties of
142
+ merchantability and fitness for a particular purpose.
143
+
144
+ == Historical
145
+
146
+ Rake was originally created by Jim Weirich, who unfortunately passed away in
147
+ February 2014. This repository was originally hosted at
148
+ {github.com/jimweirich/rake}[https://github.com/jimweirich/rake/], however
149
+ with his passing, has been moved to {ruby/rake}[https://github.com/ruby/rake].
150
+
151
+ You can view Jim's last commit here:
152
+ https://github.com/jimweirich/rake/tree/336559f28f55bce418e2ebcc0a57548dcbac4025
153
+
154
+ You can {read more about Jim}[https://en.wikipedia.org/wiki/Jim_Weirich] at Wikipedia.
155
+
156
+ Thank you for this great tool, Jim. We'll remember you.
@@ -0,0 +1,41 @@
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
+ lib = File.expand_path("../lib", __FILE__)
10
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
11
+
12
+ begin
13
+ require "bundler/gem_tasks"
14
+ rescue LoadError
15
+ end
16
+
17
+ require "rake/testtask"
18
+ Rake::TestTask.new(:test) do |t|
19
+ t.libs << "test"
20
+ t.verbose = true
21
+ t.test_files = FileList["test/**/test_*.rb"]
22
+ end
23
+
24
+ require "rdoc/task"
25
+ RDoc::Task.new do |doc|
26
+ doc.main = "README.rdoc"
27
+ doc.title = "Rake -- Ruby Make"
28
+ doc.rdoc_files = FileList.new %w[lib MIT-LICENSE doc/**/*.rdoc *.rdoc]
29
+ doc.rdoc_dir = "html"
30
+ end
31
+
32
+ task ghpages: :rdoc do
33
+ %x[git checkout gh-pages]
34
+ require "fileutils"
35
+ FileUtils.rm_rf "/tmp/html"
36
+ FileUtils.mv "html", "/tmp"
37
+ FileUtils.rm_rf "*"
38
+ FileUtils.cp_r Dir.glob("/tmp/html/*"), "."
39
+ end
40
+
41
+ task default: :test
@@ -0,0 +1,11 @@
1
+ jobs:
2
+ - job: macOS
3
+ pool:
4
+ vmImage: 'macos-10.13'
5
+ steps:
6
+ - script: |
7
+ gem install bundler
8
+ bundle install --retry=3 --jobs=4
9
+ displayName: 'bundle install'
10
+ - script: ruby -Ilib exe/rake
11
+ displayName: 'ruby -Ilib exe/rake'
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1 || ">= 0.a"
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../../Gemfile", __FILE__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_version
64
+ @bundler_version ||= begin
65
+ env_var_version || cli_arg_version ||
66
+ lockfile_version || "#{Gem::Requirement.default}.a"
67
+ end
68
+ end
69
+
70
+ def load_bundler!
71
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
72
+
73
+ # must dup string for RG < 1.8 compatibility
74
+ activate_bundler(bundler_version.dup)
75
+ end
76
+
77
+ def activate_bundler(bundler_version)
78
+ if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
79
+ bundler_version = "< 2"
80
+ end
81
+ gem_error = activation_error_handling do
82
+ gem "bundler", bundler_version
83
+ end
84
+ return if gem_error.nil?
85
+ require_error = activation_error_handling do
86
+ require "bundler/version"
87
+ end
88
+ return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
89
+ warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
90
+ exit 42
91
+ end
92
+
93
+ def activation_error_handling
94
+ yield
95
+ nil
96
+ rescue StandardError, LoadError => e
97
+ e
98
+ end
99
+ end
100
+
101
+ m.load_bundler!
102
+
103
+ if m.invoked_as_script?
104
+ load Gem.bin_path("bundler", "bundle")
105
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rake"
5
+
6
+ require "irb"
7
+ IRB.start
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rake", "rake")
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rdoc' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rdoc", "rdoc")
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rubocop", "rubocop")
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install