rake-funnel 0.18.0 → 0.19.0
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/.rspec +1 -0
- data/.simplecov +24 -0
- data/Gemfile +27 -19
- data/README.md +1 -1
- data/lib/rake/funnel/ambiguous_file_error.rb +1 -0
- data/lib/rake/funnel/execution_error.rb +1 -0
- data/lib/rake/funnel/extensions/common_path.rb +5 -4
- data/lib/rake/funnel/extensions/shell.rb +3 -2
- data/lib/rake/funnel/integration/progress_report.rb +3 -2
- data/lib/rake/funnel/integration/sync_output.rb +1 -0
- data/lib/rake/funnel/integration/teamcity/nunit_plugin.rb +2 -1
- data/lib/rake/funnel/integration/teamcity/progress_report.rb +1 -1
- data/lib/rake/funnel/integration/teamcity/service_messages.rb +8 -3
- data/lib/rake/funnel/integration/teamcity/teamcity.rb +5 -4
- data/lib/rake/funnel/support/argument_mapper/styles/default.rb +5 -4
- data/lib/rake/funnel/support/argument_mapper/styles/msbuild.rb +6 -5
- data/lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb +13 -12
- data/lib/rake/funnel/support/argument_mapper/styles/nunit.rb +6 -5
- data/lib/rake/funnel/support/assembly_version/from_version_files.rb +2 -1
- data/lib/rake/funnel/support/assembly_version_writer.rb +1 -0
- data/lib/rake/funnel/support/binary_version_reader.rb +14 -7
- data/lib/rake/funnel/support/copier.rb +1 -0
- data/lib/rake/funnel/support/environments/loader.rb +13 -8
- data/lib/rake/funnel/support/internal/finder.rb +2 -1
- data/lib/rake/funnel/support/internal/instantiate_symbol.rb +9 -4
- data/lib/rake/funnel/support/mapper.rb +7 -6
- data/lib/rake/funnel/support/mono.rb +1 -3
- data/lib/rake/funnel/support/msbuild/build_tool.rb +35 -12
- data/lib/rake/funnel/support/msdeploy/registry_patch.rb +14 -17
- data/lib/rake/funnel/support/patch.rb +1 -0
- data/lib/rake/funnel/support/specs_remover.rb +14 -11
- data/lib/rake/funnel/support/template_engine.rb +1 -0
- data/lib/rake/funnel/support/timing/report.rb +11 -10
- data/lib/rake/funnel/support/version_info.rb +8 -9
- data/lib/rake/funnel/support/zipper.rb +1 -0
- data/lib/rake/funnel/tasks/assembly_version.rb +4 -3
- data/lib/rake/funnel/tasks/bin_path.rb +3 -2
- data/lib/rake/funnel/tasks/copy.rb +2 -1
- data/lib/rake/funnel/tasks/environments.rb +13 -9
- data/lib/rake/funnel/tasks/msbuild.rb +4 -6
- data/lib/rake/funnel/tasks/msdeploy.rb +6 -5
- data/lib/rake/funnel/tasks/nunit.rb +3 -2
- data/lib/rake/funnel/tasks/paket.rb +2 -1
- data/lib/rake/funnel/tasks/quick_template.rb +3 -2
- data/lib/rake/funnel/tasks/side_by_side_specs.rb +2 -1
- data/lib/rake/funnel/tasks/timing.rb +7 -6
- data/lib/rake/funnel/tasks/zip.rb +3 -2
- data/lib/rake/funnel/version.rb +1 -1
- data/rake-funnel.gemspec +11 -11
- data/spec/rake/funnel/execution_error_spec.rb +2 -2
- data/spec/rake/funnel/extensions/rexml_spec.rb +5 -2
- data/spec/rake/funnel/extensions/shell_spec.rb +26 -17
- data/spec/rake/funnel/integration/progress_report_spec.rb +32 -36
- data/spec/rake/funnel/integration/sync_output_spec.rb +5 -5
- data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +32 -20
- data/spec/rake/funnel/integration/teamcity/progress_report_spec.rb +31 -25
- data/spec/rake/funnel/integration/teamcity/service_messages_spec.rb +56 -20
- data/spec/rake/funnel/integration/teamcity/teamcity_spec.rb +7 -5
- data/spec/rake/funnel/support/argument_mapper/styles/msdeploy_spec.rb +2 -0
- data/spec/rake/funnel/support/argument_mapper/styles/nunit_spec.rb +6 -4
- data/spec/rake/funnel/support/argument_mapper/styles/styles_spec.rb +76 -67
- data/spec/rake/funnel/support/assembly_version/from_version_files_spec.rb +17 -19
- data/spec/rake/funnel/support/assembly_version_writer_spec.rb +49 -52
- data/spec/rake/funnel/support/binary_version_reader_spec.rb +2 -2
- data/spec/rake/funnel/support/copier_spec.rb +5 -5
- data/spec/rake/funnel/support/environments/loader_spec.rb +32 -32
- data/spec/rake/funnel/support/internal/finder_spec.rb +8 -6
- data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +27 -27
- data/spec/rake/funnel/support/mapper_spec.rb +4 -3
- data/spec/rake/funnel/support/mono_spec.rb +7 -7
- data/spec/rake/funnel/support/msbuild/build_tool_spec.rb +13 -10
- data/spec/rake/funnel/support/msdeploy/registry_patch_spec.rb +47 -41
- data/spec/rake/funnel/support/patch_spec.rb +11 -11
- data/spec/rake/funnel/support/specs_remover/project/paket.references +3 -3
- data/spec/rake/funnel/support/specs_remover/project/uncompiled-code/paket.references +3 -3
- data/spec/rake/funnel/support/specs_remover/project-specific paket.references/Sample.csproj.paket.references +3 -3
- data/spec/rake/funnel/support/specs_remover/project-specific paket.references/paket.references +3 -3
- data/spec/rake/funnel/support/specs_remover_spec.rb +31 -33
- data/spec/rake/funnel/support/template_engine_spec.rb +6 -3
- data/spec/rake/funnel/support/timing/report_spec.rb +19 -20
- data/spec/rake/funnel/support/trace_spec.rb +6 -6
- data/spec/rake/funnel/support/version_info_spec.rb +8 -6
- data/spec/rake/funnel/support/which_spec.rb +7 -7
- data/spec/rake/funnel/support/zipper_spec.rb +8 -8
- data/spec/rake/funnel/tasks/assembly_version_spec.rb +9 -9
- data/spec/rake/funnel/tasks/bin_path_spec.rb +23 -21
- data/spec/rake/funnel/tasks/copy_spec.rb +10 -10
- data/spec/rake/funnel/tasks/environments_spec.rb +48 -46
- data/spec/rake/funnel/tasks/msbuild_spec.rb +21 -17
- data/spec/rake/funnel/tasks/msdeploy_spec.rb +31 -31
- data/spec/rake/funnel/tasks/nunit_spec.rb +12 -10
- data/spec/rake/funnel/tasks/paket_spec.rb +25 -21
- data/spec/rake/funnel/tasks/quick_template_spec.rb +7 -7
- data/spec/rake/funnel/tasks/side_by_side_specs_spec.rb +12 -12
- data/spec/rake/funnel/tasks/timing_spec.rb +12 -12
- data/spec/rake/funnel/tasks/zip_spec.rb +16 -16
- data/spec/spec_helper.rb +5 -31
- metadata +7 -6
@@ -5,22 +5,45 @@ module Rake
|
|
5
5
|
class BuildTool
|
6
6
|
class << self
|
7
7
|
def find
|
8
|
-
return 'xbuild' unless Rake::Win32.windows?
|
8
|
+
return 'xbuild'.freeze unless Rake::Win32.windows?
|
9
9
|
|
10
|
-
|
10
|
+
from_registry.compact.first
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
11
14
|
|
12
|
-
|
13
|
-
key = "SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\#{version}"
|
15
|
+
KEY = 'SOFTWARE\Microsoft\MSBuild\ToolsVersions'.freeze
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
next
|
17
|
+
def from_registry
|
18
|
+
return nil unless require_registry
|
19
|
+
|
20
|
+
versions.map do |version|
|
21
|
+
version_key(version) do |reg|
|
22
|
+
candidate = File.join(reg['MSBuildToolsPath'] || '', 'msbuild.exe')
|
23
|
+
next candidate if File.exist?(candidate)
|
22
24
|
end
|
23
|
-
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def versions
|
29
|
+
%w(14.0 12.0 4.0 3.5 2.0)
|
30
|
+
end
|
31
|
+
|
32
|
+
def require_registry
|
33
|
+
require 'win32/registry'
|
34
|
+
true
|
35
|
+
rescue LoadError
|
36
|
+
false
|
37
|
+
end
|
38
|
+
|
39
|
+
def version_key(version)
|
40
|
+
key = KEY + '\\' + version
|
41
|
+
|
42
|
+
::Win32::Registry::HKEY_LOCAL_MACHINE.open(key) do |reg|
|
43
|
+
yield(reg) if block_given?
|
44
|
+
end
|
45
|
+
rescue ::Win32::Registry::Error
|
46
|
+
nil
|
24
47
|
end
|
25
48
|
end
|
26
49
|
end
|
@@ -6,20 +6,19 @@ module Rake
|
|
6
6
|
KEYS = [
|
7
7
|
'SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3',
|
8
8
|
'SOFTWARE\Wow6432Node\Microsoft\IIS Extensions\MSDeploy\3'
|
9
|
-
]
|
10
|
-
VERSION_VALUE = 'Version'
|
11
|
-
FAKE_VERSION = '99.0.0.0'
|
9
|
+
].freeze
|
10
|
+
VERSION_VALUE = 'Version'.freeze
|
11
|
+
FAKE_VERSION = '99.0.0.0'.freeze
|
12
12
|
|
13
13
|
def initialize(&block)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
patch.revert!
|
19
|
-
end
|
14
|
+
patch.apply!
|
15
|
+
yield block if block_given?
|
16
|
+
ensure
|
17
|
+
patch.revert!
|
20
18
|
end
|
21
19
|
|
22
20
|
private
|
21
|
+
|
23
22
|
def patch
|
24
23
|
@patch ||= create_patch
|
25
24
|
end
|
@@ -32,23 +31,23 @@ module Rake
|
|
32
31
|
return nil unless key.created?
|
33
32
|
|
34
33
|
keyname = key.keyname
|
35
|
-
proc
|
34
|
+
proc do
|
36
35
|
root.create(File.dirname(keyname)) do |r|
|
37
36
|
r.delete_key(File.basename(keyname), true)
|
38
37
|
end
|
39
|
-
|
38
|
+
end
|
40
39
|
end
|
41
40
|
|
42
41
|
def delete_value(key, value)
|
43
42
|
keyname = key.keyname
|
44
|
-
proc
|
43
|
+
proc do
|
45
44
|
root.create(keyname) do |r|
|
46
45
|
r.delete_value(value)
|
47
46
|
end
|
48
|
-
|
47
|
+
end
|
49
48
|
end
|
50
49
|
|
51
|
-
def create_patch
|
50
|
+
def create_patch # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
52
51
|
begin
|
53
52
|
require 'win32/registry'
|
54
53
|
rescue LoadError
|
@@ -81,9 +80,7 @@ module Rake
|
|
81
80
|
end
|
82
81
|
|
83
82
|
p.reset do
|
84
|
-
resets.compact.each
|
85
|
-
reset.call
|
86
|
-
end
|
83
|
+
resets.compact.each(&:call)
|
87
84
|
end
|
88
85
|
end
|
89
86
|
end
|
@@ -18,7 +18,8 @@ module Rake
|
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
|
-
|
21
|
+
|
22
|
+
def remove(projects, references, specs) # rubocop:disable Metrics/MethodLength
|
22
23
|
Dir[*projects].map do |project|
|
23
24
|
Trace.message("Processing #{project} with references #{references} and specs #{specs}")
|
24
25
|
|
@@ -45,25 +46,25 @@ module Rake
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def remove_references(references, xml)
|
48
|
-
deleted = references.
|
49
|
+
deleted = references.flat_map do |ref|
|
49
50
|
query = "/Project//Reference[starts-with(lower-case(@Include), '#{ref.downcase}')]"
|
50
51
|
xml.elements.delete_all(query)
|
51
|
-
|
52
|
-
.flatten
|
53
|
-
.tap { |d| Trace.message("Removed references: #{d.inspect}") }
|
52
|
+
end
|
54
53
|
|
55
|
-
deleted.
|
54
|
+
deleted.each { |d| Trace.message("Removed references: #{d.inspect}") }
|
55
|
+
|
56
|
+
deleted = deleted.flat_map do |d|
|
56
57
|
d.get_elements('/HintPath').map(&:text)
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
end
|
59
|
+
|
60
|
+
deleted.each { |d| Trace.message("HintPaths: #{d}") }
|
60
61
|
end
|
61
62
|
|
62
63
|
def remove_specs(specs, xml)
|
63
|
-
deleted = specs.map
|
64
|
+
deleted = specs.map do |glob|
|
64
65
|
query = "/Project//Compile[matches(lower-case(@Include), '#{glob}')]"
|
65
66
|
xml.elements.delete_all(query)
|
66
|
-
|
67
|
+
end
|
67
68
|
|
68
69
|
deleted
|
69
70
|
.flatten
|
@@ -116,6 +117,7 @@ module Rake
|
|
116
117
|
end
|
117
118
|
|
118
119
|
private
|
120
|
+
|
119
121
|
def paket_references_for(project)
|
120
122
|
project_specific = project + '.paket.references'
|
121
123
|
global = File.join(File.dirname(project), 'paket.references')
|
@@ -145,6 +147,7 @@ module Rake
|
|
145
147
|
end
|
146
148
|
|
147
149
|
private
|
150
|
+
|
148
151
|
def list(args)
|
149
152
|
([] << args).flatten.compact
|
150
153
|
end
|
@@ -8,14 +8,14 @@ module Rake
|
|
8
8
|
class Column
|
9
9
|
attr_reader :header
|
10
10
|
|
11
|
-
def initialize(stats: [], header: '', accessor: ->
|
11
|
+
def initialize(stats: [], header: '', accessor: ->(_) { '' })
|
12
12
|
@stats = stats
|
13
13
|
@header = header
|
14
14
|
@accessor = accessor
|
15
15
|
end
|
16
16
|
|
17
17
|
def width
|
18
|
-
longest_value = @stats.map { |s| @accessor.call(s) }.max_by
|
18
|
+
longest_value = @stats.map { |s| @accessor.call(s) }.max_by(&:length) || ''
|
19
19
|
width = longest_value.length
|
20
20
|
width = @header.length if width < @header.length
|
21
21
|
width
|
@@ -45,19 +45,20 @@ module Rake
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def columns
|
48
|
-
@columns ||=
|
49
|
-
Column.new(stats: @stats, header: 'Target', accessor: ->
|
50
|
-
Column.new(stats: @stats, header: 'Duration', accessor: ->
|
51
|
-
]
|
48
|
+
@columns ||= begin [
|
49
|
+
Column.new(stats: @stats, header: 'Target', accessor: ->(timing) { timing[:task].name }),
|
50
|
+
Column.new(stats: @stats, header: 'Duration', accessor: ->(timing) { format(timing[:time]) })
|
51
|
+
] end
|
52
52
|
end
|
53
53
|
|
54
54
|
private
|
55
|
-
|
55
|
+
|
56
|
+
def header # rubocop:disable Metrics/AbcSize
|
56
57
|
puts '-' * HEADER_WIDTH
|
57
58
|
puts 'Build time report'
|
58
59
|
puts '-' * HEADER_WIDTH
|
59
60
|
|
60
|
-
puts columns.map
|
61
|
+
puts columns.map(&:format_header).join(' ' * SPACE)
|
61
62
|
puts columns.map { |c| c.format_header.gsub(/./, '-') }.join(' ' * SPACE)
|
62
63
|
end
|
63
64
|
|
@@ -67,7 +68,7 @@ module Rake
|
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
|
-
def footer
|
71
|
+
def footer # rubocop:disable Metrics/AbcSize
|
71
72
|
puts '-' * HEADER_WIDTH
|
72
73
|
puts 'Total'.ljust(columns[0].width) + ' ' * SPACE + format(Time.now - @stats.started_at)
|
73
74
|
status_message
|
@@ -78,7 +79,7 @@ module Rake
|
|
78
79
|
Time.at(seconds).utc.strftime('%H:%M:%S')
|
79
80
|
end
|
80
81
|
|
81
|
-
def status_message
|
82
|
+
def status_message # rubocop:disable Metrics/AbcSize
|
82
83
|
status = @opts[:failed] ? 'Failed' : 'OK'
|
83
84
|
status = 'Status'.ljust(columns[0].width) + ' ' * SPACE + status
|
84
85
|
|
@@ -16,11 +16,9 @@ module Rake
|
|
16
16
|
|
17
17
|
class << self
|
18
18
|
def parse(context)
|
19
|
-
VersionInfo.new(
|
20
|
-
|
21
|
-
|
22
|
-
assembly_informational_version: assembly_informational_version(context)
|
23
|
-
})
|
19
|
+
VersionInfo.new(assembly_version: assembly_version(context),
|
20
|
+
assembly_file_version: assembly_file_version(context),
|
21
|
+
assembly_informational_version: assembly_informational_version(context))
|
24
22
|
end
|
25
23
|
|
26
24
|
def read_version_from(file)
|
@@ -28,12 +26,13 @@ module Rake
|
|
28
26
|
end
|
29
27
|
|
30
28
|
private
|
29
|
+
|
31
30
|
def default_version(context)
|
32
31
|
context[:version].to_s || '0'
|
33
32
|
end
|
34
33
|
|
35
34
|
def pad(version, parts)
|
36
|
-
numerics = version.split('.').take(parts).map
|
35
|
+
numerics = version.split('.').take(parts).map(&:to_i)
|
37
36
|
|
38
37
|
template = Array.new(parts) { 0 }.map.with_index do |part, index|
|
39
38
|
numerics[index] || part
|
@@ -58,7 +57,7 @@ module Rake
|
|
58
57
|
nil
|
59
58
|
end
|
60
59
|
|
61
|
-
def assembly_informational_version(context)
|
60
|
+
def assembly_informational_version(context) # rubocop:disable Metrics/MethodLength
|
62
61
|
version = default_version(context)
|
63
62
|
numeric_version = pad(version, 3)
|
64
63
|
alpha_version = version.sub(/^[\d\.]*/, '')
|
@@ -85,9 +84,9 @@ module Rake
|
|
85
84
|
def metadata(context)
|
86
85
|
metadata = context.fetch(:metadata, {}).reject { |k, _| k == :pre }
|
87
86
|
|
88
|
-
metadata = metadata.map
|
87
|
+
metadata = metadata.map do |key, value|
|
89
88
|
[key.to_s, value.to_s] if value
|
90
|
-
|
89
|
+
end.compact
|
91
90
|
|
92
91
|
return nil if metadata.empty?
|
93
92
|
metadata.join('.')
|
@@ -19,22 +19,23 @@ module Rake
|
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
|
+
|
22
23
|
def setup_ivars(args)
|
23
24
|
@name = args.shift || :version
|
24
25
|
|
25
26
|
@language = :cs
|
26
27
|
@source = :FromVersionFiles
|
27
28
|
@source_args = {}
|
28
|
-
@target_path = proc
|
29
|
+
@target_path = proc do |language, version_info, source|
|
29
30
|
next_to_source(language, version_info, source)
|
30
|
-
|
31
|
+
end
|
31
32
|
end
|
32
33
|
|
33
34
|
def define(args, &task_block)
|
34
35
|
desc 'Generate version info' unless Rake.application.last_description
|
35
36
|
|
36
37
|
task(name, *args) do |_, task_args|
|
37
|
-
|
38
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
38
39
|
|
39
40
|
writer = AssemblyVersionWriter.new(source, source_args)
|
40
41
|
writer.write(target_path, language)
|
@@ -13,17 +13,18 @@ module Rake
|
|
13
13
|
end
|
14
14
|
|
15
15
|
private
|
16
|
+
|
16
17
|
def setup_ivars(args)
|
17
18
|
@name = args.shift || :bin_path
|
18
19
|
@search_pattern = %w(tools/* tools/*/bin packages/**/tools)
|
19
20
|
@path_modifier = proc { |paths| paths }
|
20
21
|
end
|
21
22
|
|
22
|
-
def define(args, &task_block)
|
23
|
+
def define(args, &task_block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
23
24
|
desc 'Add local binaries to PATH environment variable' unless Rake.application.last_description
|
24
25
|
|
25
26
|
task(name, *args) do |_, task_args|
|
26
|
-
|
27
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
27
28
|
|
28
29
|
next unless paths.any?
|
29
30
|
|
@@ -15,6 +15,7 @@ module Rake
|
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
+
|
18
19
|
def setup_ivars(args)
|
19
20
|
@name = args.shift || :copy
|
20
21
|
|
@@ -26,7 +27,7 @@ module Rake
|
|
26
27
|
desc 'Copy files' unless Rake.application.last_description
|
27
28
|
|
28
29
|
task(name, *args) do |_, task_args|
|
29
|
-
|
30
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
30
31
|
|
31
32
|
Copier.copy(files, target)
|
32
33
|
end
|
@@ -16,6 +16,7 @@ module Rake
|
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
|
+
|
19
20
|
def setup_ivars(_args)
|
20
21
|
@store = configatron
|
21
22
|
@default_env = nil
|
@@ -25,7 +26,7 @@ module Rake
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def define(args, &task_block)
|
28
|
-
|
29
|
+
yield(*[self].slice(0, task_block.arity)) if task_block
|
29
30
|
|
30
31
|
environments.each do |env|
|
31
32
|
desc "Configure for the #{env[:name]} environment"
|
@@ -38,7 +39,7 @@ module Rake
|
|
38
39
|
default_environment_setup
|
39
40
|
end
|
40
41
|
|
41
|
-
def environments
|
42
|
+
def environments # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
42
43
|
default = File.join(base_dir, config_ext(default_config))
|
43
44
|
local = File.join(base_dir, config_ext(local_config))
|
44
45
|
|
@@ -60,17 +61,17 @@ module Rake
|
|
60
61
|
"#{name}.yaml"
|
61
62
|
end
|
62
63
|
|
63
|
-
def default_environment_setup
|
64
|
+
def default_environment_setup # rubocop:disable Metrics/MethodLength
|
64
65
|
return unless default_env
|
65
66
|
|
66
|
-
|
67
|
-
if
|
67
|
+
envs = top_level_env_tasks
|
68
|
+
if envs.empty?
|
68
69
|
task = Rake.application.current_scope.path_with_task_name(default_env)
|
69
70
|
prepend_task(task)
|
70
71
|
else
|
71
|
-
|
72
|
-
Rake.application.top_level_tasks.delete(
|
73
|
-
prepend_task(
|
72
|
+
envs.each do |env|
|
73
|
+
Rake.application.top_level_tasks.delete(env)
|
74
|
+
prepend_task(env)
|
74
75
|
end
|
75
76
|
end
|
76
77
|
end
|
@@ -80,7 +81,10 @@ module Rake
|
|
80
81
|
end
|
81
82
|
|
82
83
|
def top_level_env_tasks
|
83
|
-
expect_user_defined = environments.map
|
84
|
+
expect_user_defined = environments.map do |env|
|
85
|
+
Rake.application.current_scope.path_with_task_name(env[:name])
|
86
|
+
end
|
87
|
+
|
84
88
|
Rake.application.top_level_tasks.select { |t| expect_user_defined.include?(t) }
|
85
89
|
end
|
86
90
|
end
|
@@ -8,6 +8,7 @@ module Rake
|
|
8
8
|
include Rake::Funnel::Support::MSBuild
|
9
9
|
|
10
10
|
attr_accessor :name, :msbuild, :project_or_solution, :args, :search_pattern
|
11
|
+
attr_writer :project_or_solution
|
11
12
|
|
12
13
|
def initialize(*args, &task_block)
|
13
14
|
setup_ivars(args)
|
@@ -19,11 +20,8 @@ module Rake
|
|
19
20
|
Finder.new(@project_or_solution || search_pattern, self, 'No projects or more than one project found.')
|
20
21
|
end
|
21
22
|
|
22
|
-
def project_or_solution=(value)
|
23
|
-
@project_or_solution = value
|
24
|
-
end
|
25
|
-
|
26
23
|
private
|
24
|
+
|
27
25
|
def setup_ivars(args)
|
28
26
|
@name = args.shift || :compile
|
29
27
|
|
@@ -32,11 +30,11 @@ module Rake
|
|
32
30
|
@search_pattern = %w(**/*.sln)
|
33
31
|
end
|
34
32
|
|
35
|
-
def define(args, &task_block)
|
33
|
+
def define(args, &task_block) # rubocop:disable Metrics/MethodLength
|
36
34
|
desc 'Compile MSBuild projects' unless Rake.application.last_description
|
37
35
|
|
38
36
|
task(name, *args) do |_, task_args|
|
39
|
-
|
37
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
40
38
|
|
41
39
|
cmd = [
|
42
40
|
msbuild,
|
@@ -16,6 +16,7 @@ module Rake
|
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
|
+
|
19
20
|
def setup_ivars(args)
|
20
21
|
@name = args.shift || :msdeploy
|
21
22
|
|
@@ -24,16 +25,16 @@ module Rake
|
|
24
25
|
@log_file = "#{@name}.log"
|
25
26
|
end
|
26
27
|
|
27
|
-
def define(args, &task_block)
|
28
|
+
def define(args, &task_block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
28
29
|
desc 'Deploy application' unless Rake.application.last_description
|
29
30
|
|
30
31
|
task(name, *args) do |_, task_args|
|
31
|
-
|
32
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
32
33
|
|
33
34
|
mapper = Mapper.new(:MSDeploy)
|
34
35
|
cmd = [quote(msdeploy), mapper.map(@args)]
|
35
|
-
|
36
|
-
|
36
|
+
.flatten
|
37
|
+
.join(' ')
|
37
38
|
|
38
39
|
RegistryPatch.new do
|
39
40
|
shell(cmd, log_file: log_file, error_lines: /^(error|[\w\.]*exception)/i)
|
@@ -45,7 +46,7 @@ module Rake
|
|
45
46
|
|
46
47
|
def quote(value)
|
47
48
|
value = value.gsub(/"/, '""') if value.is_a?(String)
|
48
|
-
return %
|
49
|
+
return %("#{value}") if value =~ /\s/
|
49
50
|
value
|
50
51
|
end
|
51
52
|
end
|
@@ -15,6 +15,7 @@ module Rake
|
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
+
|
18
19
|
def setup_ivars(args)
|
19
20
|
@name = args.shift || :test
|
20
21
|
|
@@ -23,11 +24,11 @@ module Rake
|
|
23
24
|
@files = %w(build/specs/**/*.dll build/specs/**/*.exe)
|
24
25
|
end
|
25
26
|
|
26
|
-
def define(args, &task_block)
|
27
|
+
def define(args, &task_block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
27
28
|
desc "Test #{test_assemblies.all_or_default.join(', ')}" unless Rake.application.last_description
|
28
29
|
|
29
30
|
task(name, *args) do |_, task_args|
|
30
|
-
|
31
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
31
32
|
|
32
33
|
Rake::Funnel::Integration::TeamCity::NUnitPlugin.setup(nunit)
|
33
34
|
|
@@ -15,6 +15,7 @@ module Rake
|
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
+
|
18
19
|
def setup_ivars(args)
|
19
20
|
@name = args.shift || :paket
|
20
21
|
|
@@ -29,7 +30,7 @@ module Rake
|
|
29
30
|
desc 'Restore packages' unless Rake.application.last_description
|
30
31
|
|
31
32
|
task(name, *args) do |_, task_args|
|
32
|
-
|
33
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
33
34
|
|
34
35
|
sh(*bootstrapper_cmd) unless File.exist?(paket)
|
35
36
|
sh(*paket_cmd)
|
@@ -16,6 +16,7 @@ module Rake
|
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
|
+
|
19
20
|
def setup_ivars(args)
|
20
21
|
@name = args.shift || :template
|
21
22
|
|
@@ -23,10 +24,10 @@ module Rake
|
|
23
24
|
@context = binding
|
24
25
|
end
|
25
26
|
|
26
|
-
def define(args, &task_block)
|
27
|
+
def define(args, &task_block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
27
28
|
desc 'Generate templates' unless Rake.application.last_description
|
28
29
|
task(name, *args) do |_, task_args|
|
29
|
-
|
30
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
30
31
|
|
31
32
|
templates.all_or_default.each do |template|
|
32
33
|
target = result_filename(template)
|
@@ -15,6 +15,7 @@ module Rake
|
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
+
|
18
19
|
def setup_ivars(args)
|
19
20
|
@name = args.shift || :compile
|
20
21
|
|
@@ -28,7 +29,7 @@ module Rake
|
|
28
29
|
def define(args, &task_block)
|
29
30
|
desc 'Remove tests from projects' unless Rake.application.last_description
|
30
31
|
task(name, *args) do |_, task_args|
|
31
|
-
|
32
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
32
33
|
|
33
34
|
next unless enabled
|
34
35
|
|
@@ -20,19 +20,20 @@ module Rake
|
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
|
+
|
23
24
|
def setup_ivars(args)
|
24
25
|
@name = args.shift || :timing
|
25
26
|
|
26
27
|
@stats = Statistics.new
|
27
28
|
end
|
28
29
|
|
29
|
-
def define(_args, &task_block)
|
30
|
+
def define(_args, &task_block) # rubocop:disable Metrics/AbcSize
|
30
31
|
patches.each(&:apply!)
|
31
32
|
|
32
33
|
desc 'Output task timing information' unless Rake.application.last_description
|
33
34
|
|
34
35
|
task name, :failed do |_, task_args|
|
35
|
-
|
36
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
36
37
|
|
37
38
|
Report.new(@stats, task_args).render
|
38
39
|
end
|
@@ -47,9 +48,9 @@ module Rake
|
|
47
48
|
@patches ||= [report, benchmark]
|
48
49
|
end
|
49
50
|
|
50
|
-
def report
|
51
|
+
def report # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
51
52
|
Rake::Funnel::Support::Patch.new do |p|
|
52
|
-
report_invoker = ->
|
53
|
+
report_invoker = ->(opts) { Report.new(@stats, opts).render }
|
53
54
|
|
54
55
|
p.setup do
|
55
56
|
Rake::Application.class_eval do
|
@@ -75,9 +76,9 @@ module Rake
|
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
78
|
-
def benchmark
|
79
|
+
def benchmark # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
79
80
|
Rake::Funnel::Support::Patch.new do |p|
|
80
|
-
benchmark_invoker = ->
|
81
|
+
benchmark_invoker = ->(task, &block) { @stats.benchmark(task, &block) }
|
81
82
|
|
82
83
|
p.setup do
|
83
84
|
Rake::Task.class_eval do
|