rake 13.0.1 → 13.3.1
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.
- checksums.yaml +4 -4
- data/History.rdoc +88 -2
- data/README.rdoc +19 -19
- data/doc/command_line_usage.rdoc +13 -0
- data/lib/rake/application.rb +50 -20
- data/lib/rake/backtrace.rb +1 -0
- data/lib/rake/clean.rb +1 -1
- data/lib/rake/cpu_counter.rb +20 -5
- data/lib/rake/dsl_definition.rb +4 -3
- data/lib/rake/ext/string.rb +1 -1
- data/lib/rake/file_creation_task.rb +2 -2
- data/lib/rake/file_list.rb +3 -3
- data/lib/rake/file_task.rb +10 -6
- data/lib/rake/file_utils.rb +0 -2
- data/lib/rake/file_utils_ext.rb +1 -1
- data/lib/rake/packagetask.rb +3 -3
- data/lib/rake/phony.rb +1 -1
- data/lib/rake/rake_test_loader.rb +17 -17
- data/lib/rake/task.rb +3 -3
- data/lib/rake/task_arguments.rb +4 -0
- data/lib/rake/task_manager.rb +4 -4
- data/lib/rake/tasklib.rb +1 -1
- data/lib/rake/testtask.rb +3 -38
- data/lib/rake/thread_history_display.rb +1 -1
- data/lib/rake/thread_pool.rb +3 -9
- data/lib/rake/version.rb +1 -1
- data/lib/rake.rb +27 -30
- data/rake.gemspec +86 -28
- metadata +7 -23
- data/.github/workflows/macos.yml +0 -22
- data/.github/workflows/ubuntu-rvm.yml +0 -28
- data/.github/workflows/ubuntu.yml +0 -20
- data/.github/workflows/windows.yml +0 -20
- data/CONTRIBUTING.rdoc +0 -43
- data/Gemfile +0 -10
- data/Rakefile +0 -41
- data/bin/bundle +0 -105
- data/bin/console +0 -7
- data/bin/rake +0 -29
- data/bin/rdoc +0 -29
- data/bin/rubocop +0 -29
- data/bin/setup +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8030dccf89834bd1723f61768994c7030a66fefaca1876f02a125fd04d81330
|
|
4
|
+
data.tar.gz: 44bde676fa9c925cbebb0aa8b3267206af091ea23f3ee5e1cb292d5605c0d68b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e165577cdf53a95c575be0e796550a40dfd0dfd4a0447e25bdb2722a0bd74f9565dd226a94fecedf3bf44ffa2c571477f4c9d4521d9c4a3f99afaa557f76898c
|
|
7
|
+
data.tar.gz: 2ae064597810412e682db5083f596c5fae7bc182b13b676abda7fbc273ff6ee460c812aae731933d794007b5e79a60fa249c1e898f2b38fcaba9e9d76603034d
|
data/History.rdoc
CHANGED
|
@@ -1,8 +1,94 @@
|
|
|
1
|
+
=== 13.2.1
|
|
2
|
+
|
|
3
|
+
* Suppressed "internal:array:52:in 'Array#each'" from backtrace by @hsbt in #554
|
|
4
|
+
* Bump actions/configure-pages from 4 to 5 by @dependabot in #553
|
|
5
|
+
|
|
6
|
+
=== 13.2.0
|
|
7
|
+
|
|
8
|
+
* Fix rule example to be correct by @zenspider in #525
|
|
9
|
+
* Switch to use test-unit by @hsbt in #536
|
|
10
|
+
* Removed redundant block by @hsbt in #537
|
|
11
|
+
* Use Struct instead of OpenStruct. by @hsbt in #545
|
|
12
|
+
* Accept FileList object as directory task's target by @gemmaro in #530
|
|
13
|
+
* Fix exception when exception has nil backtrace by @janbiedermann in #451
|
|
14
|
+
* Add TruffleRuby on CI by @andrykonchin in #551
|
|
15
|
+
|
|
16
|
+
=== 13.1.0
|
|
17
|
+
|
|
18
|
+
* Added dependabot.yml for actions by @hsbt in #416
|
|
19
|
+
* Add Ruby 3.1 to the CI matrix by @petergoldstein in #415
|
|
20
|
+
* (Performance) Remove unnecessary I/O syscalls for FileTasks by @da2x in #393
|
|
21
|
+
* Skip test failure with JRuby by @hsbt in #418
|
|
22
|
+
* Remove bin/rdoc by @tnir in #421
|
|
23
|
+
* Remove bin/rake by @tnir in #422
|
|
24
|
+
* Remove bin/bundle by @tnir in #425
|
|
25
|
+
* Apply RuboCop linting for Ruby 2.3 by @tnir in #423
|
|
26
|
+
* Update rubocop to work with Ruby 2.4 compatible by @tnir in #424
|
|
27
|
+
* chore: fix typo in comments by @tnir in #429
|
|
28
|
+
* Use 'test' as workflow name on Actions by @tnir in #427
|
|
29
|
+
* docs: update CONTRIBUTING.rdoc by @tnir in #428
|
|
30
|
+
* Add RuboCop job to Actions by @tnir in #426
|
|
31
|
+
* Lock minitest-5.15.0 for Ruby 2.2 by @hsbt in #442
|
|
32
|
+
* Eagerly require set in thread_pool.rb by @jeremyevans in #440
|
|
33
|
+
* Avoid creating an unnecessary thread pool by @jeremyevans in #441
|
|
34
|
+
* Add credit for maintenance in Rake 12/13 by @tnir in #443
|
|
35
|
+
* Sh fully echoes commands which error exit by @MarkDBlackwell in #147
|
|
36
|
+
* Correct RuboCop offenses by @deivid-rodriguez in #444
|
|
37
|
+
* [StepSecurity] ci: Harden GitHub Actions by @step-security-bot in #450
|
|
38
|
+
* Add ruby 3.2 to test matrix by @hanneskaeufler in #458
|
|
39
|
+
* Missing 'do' on example by @zzak in #467
|
|
40
|
+
* Try to use dependabot automerge by @hsbt in #470
|
|
41
|
+
* Rewrite auto-merge feature for dependabot by @hsbt in #471
|
|
42
|
+
* Update bundler in Dependabot by @ono-max in #472
|
|
43
|
+
* Fix grammar in help text by @mebezac in #381
|
|
44
|
+
* Try to use ruby/ruby/.github/workflows/ruby_versions.yml@master by @hsbt in #475
|
|
45
|
+
* Use GitHub Pages Action for generating rdoc page by @hsbt in #477
|
|
46
|
+
* Support #detailed_message when task failed by @ksss in #486
|
|
47
|
+
* Debug at stop when task fail by @ksss in #489
|
|
48
|
+
* Drop to support Ruby 2.2 by @hsbt in #492
|
|
49
|
+
* Bump up setup-ruby by @hsbt in #497
|
|
50
|
+
* Update development dependencies by @hsbt in #505
|
|
51
|
+
|
|
52
|
+
=== 13.0.6
|
|
53
|
+
|
|
54
|
+
* Additional fix for #389
|
|
55
|
+
Pull request #390 by hsbt
|
|
56
|
+
|
|
57
|
+
=== 13.0.5
|
|
58
|
+
|
|
59
|
+
* Fixed the regression of #388
|
|
60
|
+
Pull request #389 by hsbt
|
|
61
|
+
|
|
62
|
+
=== 13.0.4
|
|
63
|
+
|
|
64
|
+
* Fix rake test loader swallowing useful error information.
|
|
65
|
+
Pull request #367 by deivid-rodriguez
|
|
66
|
+
* Add -C/--directory option the same as GNU make.
|
|
67
|
+
Pull request #376 by nobu
|
|
68
|
+
|
|
69
|
+
=== 13.0.3
|
|
70
|
+
|
|
71
|
+
* Fix breaking change of execution order on TestTask.
|
|
72
|
+
Pull request #368 by ysakasin
|
|
73
|
+
|
|
74
|
+
=== 13.0.2
|
|
75
|
+
|
|
76
|
+
==== Enhancements
|
|
77
|
+
|
|
78
|
+
* Fix tests to work with current FileUtils
|
|
79
|
+
Pull Request #358 by jeremyevans
|
|
80
|
+
* Simplify default rake test loader
|
|
81
|
+
Pull Request #357 by deivid-rodriguez
|
|
82
|
+
* Update rdoc
|
|
83
|
+
Pull Request #366 by bahasalien
|
|
84
|
+
* Update broken links to rake articles from Avdi in README
|
|
85
|
+
Pull Request #360 by svl7
|
|
86
|
+
|
|
1
87
|
=== 13.0.1
|
|
2
88
|
|
|
3
89
|
==== Bug fixes
|
|
4
90
|
|
|
5
|
-
* Fixed bug: Reenabled task raises previous exception on second invokation
|
|
91
|
+
* Fixed bug: Reenabled task raises previous exception on second invokation
|
|
6
92
|
Pull Request #271 by thorsteneckel
|
|
7
93
|
* Fix an incorrectly resolved arg pattern
|
|
8
94
|
Pull Request #327 by mjbellantoni
|
|
@@ -13,7 +99,7 @@
|
|
|
13
99
|
|
|
14
100
|
* Follows recent changes on keyword arguments in ruby 2.7.
|
|
15
101
|
Pull Request #326 by nobu
|
|
16
|
-
* Make `PackageTask` be able to omit parent directory while packing files
|
|
102
|
+
* Make `PackageTask` be able to omit parent directory while packing files
|
|
17
103
|
Pull Request #310 by tonytonyjan
|
|
18
104
|
* Add order only dependency
|
|
19
105
|
Pull Request #269 by take-cheeze
|
data/README.rdoc
CHANGED
|
@@ -74,35 +74,35 @@ Type "rake --help" for all available options.
|
|
|
74
74
|
|
|
75
75
|
=== Rake Information
|
|
76
76
|
|
|
77
|
-
* {Rake command-line}[
|
|
78
|
-
* {Writing Rakefiles}[
|
|
79
|
-
* The original {Rake announcement}[
|
|
80
|
-
* Rake {glossary}[
|
|
77
|
+
* {Rake command-line}[rdoc-ref:doc/command_line_usage.rdoc]
|
|
78
|
+
* {Writing Rakefiles}[rdoc-ref:doc/rakefile.rdoc]
|
|
79
|
+
* The original {Rake announcement}[rdoc-ref:doc/rational.rdoc]
|
|
80
|
+
* Rake {glossary}[rdoc-ref:doc/glossary.rdoc]
|
|
81
81
|
|
|
82
82
|
=== Presentations and Articles about Rake
|
|
83
83
|
|
|
84
84
|
* Avdi Grimm's rake series:
|
|
85
|
-
1. {Rake Basics}[
|
|
86
|
-
2. {Rake File Lists}[
|
|
87
|
-
3. {Rake Rules}[
|
|
88
|
-
4. {Rake Pathmap}[
|
|
89
|
-
5. {File Operations}[
|
|
90
|
-
6. {Clean and Clobber}[
|
|
91
|
-
7. {MultiTask}[
|
|
92
|
-
* {Jim Weirich's 2003 RubyConf presentation}[
|
|
93
|
-
* Martin Fowler's article on Rake:
|
|
85
|
+
1. {Rake Basics}[https://avdi.codes/rake-part-1-basics/]
|
|
86
|
+
2. {Rake File Lists}[https://avdi.codes/rake-part-2-file-lists-2/]
|
|
87
|
+
3. {Rake Rules}[https://avdi.codes/rake-part-3-rules/]
|
|
88
|
+
4. {Rake Pathmap}[https://avdi.codes/rake-part-4-pathmap/]
|
|
89
|
+
5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/]
|
|
90
|
+
6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/]
|
|
91
|
+
7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/]
|
|
92
|
+
* {Jim Weirich's 2003 RubyConf presentation}[https://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/]
|
|
93
|
+
* Martin Fowler's article on Rake: https://martinfowler.com/articles/rake.html
|
|
94
94
|
|
|
95
95
|
== Other Make Re-envisionings ...
|
|
96
96
|
|
|
97
97
|
Rake is a late entry in the make replacement field. Here are links to
|
|
98
98
|
other projects with similar (and not so similar) goals.
|
|
99
99
|
|
|
100
|
-
*
|
|
100
|
+
* https://directory.fsf.org/wiki/Bras -- Bras, one of earliest
|
|
101
101
|
implementations of "make in a scripting language".
|
|
102
102
|
* http://www.a-a-p.org -- Make in Python
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* https://ant.apache.org -- The Ant project
|
|
104
|
+
* https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
|
|
105
|
+
* https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool.
|
|
106
106
|
|
|
107
107
|
== Credits
|
|
108
108
|
|
|
@@ -116,7 +116,7 @@ other projects with similar (and not so similar) goals.
|
|
|
116
116
|
|
|
117
117
|
[<b>Eric Hodel</b>] For aid in maintaining rake.
|
|
118
118
|
|
|
119
|
-
[<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10
|
|
119
|
+
[<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10 and later
|
|
120
120
|
|
|
121
121
|
== License
|
|
122
122
|
|
|
@@ -148,7 +148,7 @@ February 2014. This repository was originally hosted at
|
|
|
148
148
|
with his passing, has been moved to {ruby/rake}[https://github.com/ruby/rake].
|
|
149
149
|
|
|
150
150
|
You can view Jim's last commit here:
|
|
151
|
-
https://github.com/jimweirich/rake/
|
|
151
|
+
https://github.com/jimweirich/rake/commit/336559f28f55bce418e2ebcc0a57548dcbac4025
|
|
152
152
|
|
|
153
153
|
You can {read more about Jim}[https://en.wikipedia.org/wiki/Jim_Weirich] at Wikipedia.
|
|
154
154
|
|
data/doc/command_line_usage.rdoc
CHANGED
|
@@ -153,6 +153,19 @@ Options are:
|
|
|
153
153
|
[<tt>--no-deprecation-warnings</tt> (-X)]
|
|
154
154
|
Do not display the deprecation warnings.
|
|
155
155
|
|
|
156
|
+
== Environment Variables
|
|
157
|
+
|
|
158
|
+
[<tt>RAKEOPT</tt>]
|
|
159
|
+
Command line options can be specified in the <tt>RAKEOPT</tt>
|
|
160
|
+
environment variable. These options will be processed as if they
|
|
161
|
+
were given on the command line. This is useful for setting default
|
|
162
|
+
options that you want to use with every rake invocation.
|
|
163
|
+
|
|
164
|
+
For example, setting:
|
|
165
|
+
export RAKEOPT="-s --trace"
|
|
166
|
+
|
|
167
|
+
would cause rake to run silently with tracing enabled by default.
|
|
168
|
+
|
|
156
169
|
In addition, any command line option of the form
|
|
157
170
|
<em>VAR</em>=<em>VALUE</em> will be added to the environment hash
|
|
158
171
|
<tt>ENV</tt> and may be tested in the Rakefile.
|
data/lib/rake/application.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
require "optparse"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
require_relative "task_manager"
|
|
5
|
+
require_relative "file_list"
|
|
6
|
+
require_relative "thread_pool"
|
|
7
|
+
require_relative "thread_history_display"
|
|
8
|
+
require_relative "trace_output"
|
|
9
|
+
require_relative "win32"
|
|
10
10
|
|
|
11
11
|
module Rake
|
|
12
12
|
|
|
@@ -94,10 +94,32 @@ module Rake
|
|
|
94
94
|
# Backward compatibility for capistrano
|
|
95
95
|
args = handle_options
|
|
96
96
|
end
|
|
97
|
+
load_debug_at_stop_feature
|
|
97
98
|
collect_command_line_tasks(args)
|
|
98
99
|
end
|
|
99
100
|
end
|
|
100
101
|
|
|
102
|
+
def load_debug_at_stop_feature
|
|
103
|
+
return unless ENV["RAKE_DEBUG"]
|
|
104
|
+
require "debug/session"
|
|
105
|
+
DEBUGGER__::start no_sigint_hook: true, nonstop: true
|
|
106
|
+
Rake::Task.prepend Module.new {
|
|
107
|
+
def execute(*)
|
|
108
|
+
exception = DEBUGGER__::SESSION.capture_exception_frames(/(exe|bin|lib)\/rake/) do
|
|
109
|
+
super
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if exception
|
|
113
|
+
STDERR.puts exception.message
|
|
114
|
+
DEBUGGER__::SESSION.enter_postmortem_session exception
|
|
115
|
+
raise exception
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
}
|
|
119
|
+
rescue LoadError
|
|
120
|
+
end
|
|
121
|
+
private :load_debug_at_stop_feature
|
|
122
|
+
|
|
101
123
|
# Find the rakefile and then load it and any pending imports.
|
|
102
124
|
def load_rakefile
|
|
103
125
|
standard_exception_handling do
|
|
@@ -124,7 +146,7 @@ module Rake
|
|
|
124
146
|
|
|
125
147
|
yield
|
|
126
148
|
|
|
127
|
-
thread_pool.join
|
|
149
|
+
thread_pool.join if defined?(@thread_pool)
|
|
128
150
|
if options.job_stats
|
|
129
151
|
stats = thread_pool.statistics
|
|
130
152
|
puts "Maximum active threads: #{stats[:max_active_threads]} + main"
|
|
@@ -143,7 +165,13 @@ module Rake
|
|
|
143
165
|
|
|
144
166
|
# Application options from the command line
|
|
145
167
|
def options
|
|
146
|
-
@options ||=
|
|
168
|
+
@options ||= Struct.new(
|
|
169
|
+
:always_multitask, :backtrace, :build_all, :dryrun,
|
|
170
|
+
:ignore_deprecate, :ignore_system, :job_stats, :load_system,
|
|
171
|
+
:nosearch, :rakelib, :show_all_tasks, :show_prereqs,
|
|
172
|
+
:show_task_pattern, :show_tasks, :silent, :suppress_backtrace_pattern,
|
|
173
|
+
:thread_pool_size, :trace, :trace_output, :trace_rules
|
|
174
|
+
).new
|
|
147
175
|
end
|
|
148
176
|
|
|
149
177
|
# Return the thread pool used for multithreaded processing.
|
|
@@ -215,7 +243,7 @@ module Rake
|
|
|
215
243
|
display_exception_details_seen << ex
|
|
216
244
|
|
|
217
245
|
display_exception_message_details(ex)
|
|
218
|
-
display_exception_backtrace(ex)
|
|
246
|
+
display_exception_backtrace(ex) if ex.backtrace
|
|
219
247
|
display_cause_details(ex.cause) if has_cause?(ex)
|
|
220
248
|
end
|
|
221
249
|
|
|
@@ -237,6 +265,8 @@ module Rake
|
|
|
237
265
|
def display_exception_message_details(ex) # :nodoc:
|
|
238
266
|
if ex.instance_of?(RuntimeError)
|
|
239
267
|
trace ex.message
|
|
268
|
+
elsif ex.respond_to?(:detailed_message)
|
|
269
|
+
trace "#{ex.class.name}: #{ex.detailed_message(highlight: false)}"
|
|
240
270
|
else
|
|
241
271
|
trace "#{ex.class.name}: #{ex.message}"
|
|
242
272
|
end
|
|
@@ -433,6 +463,13 @@ module Rake
|
|
|
433
463
|
select_tasks_to_show(options, :describe, value)
|
|
434
464
|
}
|
|
435
465
|
],
|
|
466
|
+
["--directory", "-C [DIRECTORY]",
|
|
467
|
+
"Change to DIRECTORY before doing anything.",
|
|
468
|
+
lambda { |value|
|
|
469
|
+
Dir.chdir value
|
|
470
|
+
@original_dir = Dir.pwd
|
|
471
|
+
}
|
|
472
|
+
],
|
|
436
473
|
["--dry-run", "-n",
|
|
437
474
|
"Do a dry run without executing actions.",
|
|
438
475
|
lambda { |value|
|
|
@@ -568,7 +605,7 @@ module Rake
|
|
|
568
605
|
["--tasks", "-T [PATTERN]",
|
|
569
606
|
"Display the tasks (matching optional PATTERN) " +
|
|
570
607
|
"with descriptions, then exit. " +
|
|
571
|
-
"-AT combination displays all
|
|
608
|
+
"-AT combination displays all the tasks, including those without descriptions.",
|
|
572
609
|
lambda { |value|
|
|
573
610
|
select_tasks_to_show(options, :tasks, value)
|
|
574
611
|
}
|
|
@@ -654,7 +691,7 @@ module Rake
|
|
|
654
691
|
|
|
655
692
|
# Similar to the regular Ruby +require+ command, but will check
|
|
656
693
|
# for *.rake files in addition to *.rb files.
|
|
657
|
-
def rake_require(file_name, paths=$LOAD_PATH, loaded=$
|
|
694
|
+
def rake_require(file_name, paths=$LOAD_PATH, loaded=$LOADED_FEATURES) # :nodoc:
|
|
658
695
|
fn = file_name + ".rake"
|
|
659
696
|
return false if loaded.include?(fn)
|
|
660
697
|
paths.each do |path|
|
|
@@ -718,14 +755,7 @@ module Rake
|
|
|
718
755
|
|
|
719
756
|
# The directory path containing the system wide rakefiles.
|
|
720
757
|
def system_dir # :nodoc:
|
|
721
|
-
@system_dir ||=
|
|
722
|
-
begin
|
|
723
|
-
if ENV["RAKE_SYSTEM"]
|
|
724
|
-
ENV["RAKE_SYSTEM"]
|
|
725
|
-
else
|
|
726
|
-
standard_system_dir
|
|
727
|
-
end
|
|
728
|
-
end
|
|
758
|
+
@system_dir ||= ENV["RAKE_SYSTEM"] || standard_system_dir
|
|
729
759
|
end
|
|
730
760
|
|
|
731
761
|
# The standard directory containing system wide rake files.
|
|
@@ -735,7 +765,7 @@ module Rake
|
|
|
735
765
|
end
|
|
736
766
|
else
|
|
737
767
|
def standard_system_dir #:nodoc:
|
|
738
|
-
File.join(
|
|
768
|
+
File.join(Dir.home, ".rake")
|
|
739
769
|
end
|
|
740
770
|
end
|
|
741
771
|
private :standard_system_dir
|
data/lib/rake/backtrace.rb
CHANGED
|
@@ -10,6 +10,7 @@ module Rake
|
|
|
10
10
|
map { |f| File.expand_path(f) }.
|
|
11
11
|
reject { |s| s.nil? || s =~ /^ *$/ }
|
|
12
12
|
SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|")
|
|
13
|
+
SUPPRESSED_PATHS_RE << "|^<internal:\\w+>"
|
|
13
14
|
SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if
|
|
14
15
|
Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == "jruby"
|
|
15
16
|
|
data/lib/rake/clean.rb
CHANGED
data/lib/rake/cpu_counter.rb
CHANGED
|
@@ -58,11 +58,20 @@ unless Rake::CpuCounter.method_defined?(:count)
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def count_via_win32
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
# Get-CimInstance introduced in PowerShell 3 or earlier: https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0
|
|
62
|
+
result = run_win32(
|
|
63
|
+
'powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores ' \
|
|
64
|
+
'| Select-Object -Property NumberOfCores"'
|
|
65
|
+
)
|
|
66
|
+
if !result || $?.exitstatus != 0
|
|
67
|
+
# fallback to deprecated wmic for older systems
|
|
68
|
+
result = run_win32("wmic cpu get NumberOfCores")
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# powershell: "\nNumberOfCores\n-------------\n 4\n\n\n"
|
|
72
|
+
# wmic: "NumberOfCores \n\n4 \n\n\n\n"
|
|
73
|
+
result.scan(/\d+/).map(&:to_i).reduce(:+) if result
|
|
74
|
+
rescue StandardError
|
|
66
75
|
nil
|
|
67
76
|
end
|
|
68
77
|
|
|
@@ -87,6 +96,12 @@ unless Rake::CpuCounter.method_defined?(:count)
|
|
|
87
96
|
end
|
|
88
97
|
end
|
|
89
98
|
|
|
99
|
+
def run_win32(command, *args)
|
|
100
|
+
IO.popen(command, &:read)
|
|
101
|
+
rescue Errno::ENOENT
|
|
102
|
+
nil
|
|
103
|
+
end
|
|
104
|
+
|
|
90
105
|
def resolve_command(command)
|
|
91
106
|
look_for_command("/usr/sbin", command) ||
|
|
92
107
|
look_for_command("/sbin", command) ||
|
data/lib/rake/dsl_definition.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# Rake DSL functions.
|
|
3
|
-
|
|
3
|
+
require_relative "file_utils_ext"
|
|
4
4
|
|
|
5
5
|
module Rake
|
|
6
6
|
|
|
@@ -90,6 +90,7 @@ module Rake
|
|
|
90
90
|
# directory "testdata/doc"
|
|
91
91
|
#
|
|
92
92
|
def directory(*args, &block) # :doc:
|
|
93
|
+
args = args.flat_map { |arg| arg.is_a?(FileList) ? arg.to_a.flatten : arg }
|
|
93
94
|
result = file_create(*args, &block)
|
|
94
95
|
dir, _ = *Rake.application.resolve_args(args)
|
|
95
96
|
dir = Rake.from_pathname(dir)
|
|
@@ -145,7 +146,7 @@ module Rake
|
|
|
145
146
|
#
|
|
146
147
|
# Example:
|
|
147
148
|
# rule '.o' => '.c' do |t|
|
|
148
|
-
# sh 'cc', '-o', t.name, t.source
|
|
149
|
+
# sh 'cc', '-c', '-o', t.name, t.source
|
|
149
150
|
# end
|
|
150
151
|
#
|
|
151
152
|
def rule(*args, &block) # :doc:
|
|
@@ -158,7 +159,7 @@ module Rake
|
|
|
158
159
|
#
|
|
159
160
|
# Example:
|
|
160
161
|
# desc "Run the Unit Tests"
|
|
161
|
-
# task test: [:build]
|
|
162
|
+
# task test: [:build] do
|
|
162
163
|
# # ... run tests
|
|
163
164
|
# end
|
|
164
165
|
#
|
data/lib/rake/ext/string.rb
CHANGED
data/lib/rake/file_list.rb
CHANGED
data/lib/rake/file_task.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
require_relative "task"
|
|
3
|
+
require_relative "early_time"
|
|
4
4
|
|
|
5
5
|
module Rake
|
|
6
6
|
|
|
@@ -14,14 +14,18 @@ module Rake
|
|
|
14
14
|
# Is this file task needed? Yes if it doesn't exist, or if its time stamp
|
|
15
15
|
# is out of date.
|
|
16
16
|
def needed?
|
|
17
|
-
|
|
17
|
+
begin
|
|
18
|
+
out_of_date?(File.mtime(name)) || @application.options.build_all
|
|
19
|
+
rescue Errno::ENOENT
|
|
20
|
+
true
|
|
21
|
+
end
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
# Time stamp for file task.
|
|
21
25
|
def timestamp
|
|
22
|
-
|
|
23
|
-
File.mtime(name
|
|
24
|
-
|
|
26
|
+
begin
|
|
27
|
+
File.mtime(name)
|
|
28
|
+
rescue Errno::ENOENT
|
|
25
29
|
Rake::LATE
|
|
26
30
|
end
|
|
27
31
|
end
|
data/lib/rake/file_utils.rb
CHANGED
|
@@ -60,8 +60,6 @@ module FileUtils
|
|
|
60
60
|
|
|
61
61
|
def create_shell_runner(cmd) # :nodoc:
|
|
62
62
|
show_command = sh_show_command cmd
|
|
63
|
-
show_command = show_command[0, 42] + "..." unless $trace
|
|
64
|
-
|
|
65
63
|
lambda do |ok, status|
|
|
66
64
|
ok or
|
|
67
65
|
fail "Command failed with status (#{status.exitstatus}): " +
|
data/lib/rake/file_utils_ext.rb
CHANGED
data/lib/rake/packagetask.rb
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# Define a package task library to aid in the definition of
|
|
3
3
|
# redistributable package files.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
require_relative "../rake"
|
|
6
|
+
require_relative "tasklib"
|
|
7
7
|
|
|
8
8
|
module Rake
|
|
9
9
|
|
|
@@ -79,7 +79,7 @@ module Rake
|
|
|
79
79
|
# Zip command for zipped archives. The default is 'zip'.
|
|
80
80
|
attr_accessor :zip_command
|
|
81
81
|
|
|
82
|
-
# True if parent directory should be
|
|
82
|
+
# True if parent directory should be omitted (default is false)
|
|
83
83
|
attr_accessor :without_parent_dir
|
|
84
84
|
|
|
85
85
|
# Create a Package Task with the given name and version. Use +:noversion+
|
data/lib/rake/phony.rb
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
require_relative "file_list"
|
|
3
4
|
|
|
4
5
|
# Load the test files from the command line.
|
|
5
6
|
argv = ARGV.select do |argument|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
end
|
|
7
|
+
case argument
|
|
8
|
+
when /^-/ then
|
|
9
|
+
argument
|
|
10
|
+
when /\*/ then
|
|
11
|
+
Rake::FileList[argument].to_a.each do |file|
|
|
12
|
+
require File.expand_path file
|
|
13
|
+
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
false
|
|
16
|
+
else
|
|
17
|
+
path = File.expand_path argument
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
abort "\nFile does not exist: #{path}\n\n" unless File.exist?(path)
|
|
20
|
+
|
|
21
|
+
require path
|
|
22
|
+
|
|
23
|
+
false
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
data/lib/rake/task.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
require_relative "invocation_exception_mixin"
|
|
3
3
|
|
|
4
4
|
module Rake
|
|
5
5
|
|
|
@@ -276,9 +276,9 @@ module Rake
|
|
|
276
276
|
application.trace "** Execute #{name}" if application.options.trace
|
|
277
277
|
application.enhance_with_matching_rule(name) if @actions.empty?
|
|
278
278
|
if opts = Hash.try_convert(args) and !opts.empty?
|
|
279
|
-
@actions.each { |act| act.call(self, args, **opts)}
|
|
279
|
+
@actions.each { |act| act.call(self, args, **opts) }
|
|
280
280
|
else
|
|
281
|
-
@actions.each { |act| act.call(self, args)}
|
|
281
|
+
@actions.each { |act| act.call(self, args) }
|
|
282
282
|
end
|
|
283
283
|
end
|
|
284
284
|
|
data/lib/rake/task_arguments.rb
CHANGED
data/lib/rake/task_manager.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Rake
|
|
|
35
35
|
task.set_arg_names(arg_names) unless arg_names.empty?
|
|
36
36
|
if Rake::TaskManager.record_task_metadata
|
|
37
37
|
add_location(task)
|
|
38
|
-
task.add_description(get_description
|
|
38
|
+
task.add_description(get_description)
|
|
39
39
|
end
|
|
40
40
|
task.enhance(Task.format_deps(deps), &block)
|
|
41
41
|
task | order_only unless order_only.nil?
|
|
@@ -300,8 +300,8 @@ module Rake
|
|
|
300
300
|
when /^\./
|
|
301
301
|
source = task_name.sub(task_pattern, ext)
|
|
302
302
|
source == ext ? task_name.ext(ext) : source
|
|
303
|
-
when String
|
|
304
|
-
ext
|
|
303
|
+
when String, Symbol
|
|
304
|
+
ext.to_s
|
|
305
305
|
when Proc, Method
|
|
306
306
|
if ext.arity == 1
|
|
307
307
|
ext.call(task_name)
|
|
@@ -316,7 +316,7 @@ module Rake
|
|
|
316
316
|
end
|
|
317
317
|
|
|
318
318
|
# Return the current description, clearing it in the process.
|
|
319
|
-
def get_description
|
|
319
|
+
def get_description
|
|
320
320
|
desc = @last_description
|
|
321
321
|
@last_description = nil
|
|
322
322
|
desc
|