build 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a584085143f5ed2e6ea2bc4dd34688402a07e09b86174342d40ecbbf4c3ca75
4
- data.tar.gz: f830204ab793ae014d4c78e28b50a9f0a7d9c890bf61f978e94e33a76ba8362f
3
+ metadata.gz: 9b25bab5ea87cc44e752b996feef7556f532917a44b5c8a806abcaa835a5be46
4
+ data.tar.gz: 6994d82f7e62c9b1755f4bfc1cd2e4d59cab5bb635157c289cb7f66cbf17e183
5
5
  SHA512:
6
- metadata.gz: 1ede532310d8e76e5565c35893e68924f3eb30b034d4dda3aececee3848920576f78c7ccaa50aab484e9c4d71fd953680c30ccf3cf88105797f8afc55b7c4e3f
7
- data.tar.gz: c60e8d539f50fdfcaeea102d325e61f0580f57f595d3edc4c0fa243aa591152f2502a4642750ceda2e8daa24f42b4587a6cc8153fb7cdbad0be4182871c29f04
6
+ metadata.gz: 5463598ea2a50099f0b7d5462fc231eb207009e2f75808da8dd99b976a5639ece50db6822dd36ed5c7674c4afae090098fc77a9d1e6da1c7893f77f3dae40ef2
7
+ data.tar.gz: 9efd1dc567f4532209c07eac0cb59bc7513bff228078563d58a0c052c29bda3a3eee9123bcc0a698973f5404281699824064ec81efcccb9ce84f1af9ad133d7c
@@ -25,9 +25,8 @@ require 'console/event/spawn'
25
25
 
26
26
  module Build
27
27
  class BuildNode < Graph::Node
28
- def initialize(environment, dependency, provisions, arguments)
28
+ def initialize(environment, provisions, arguments)
29
29
  @environment = environment
30
- @dependency = dependency
31
30
  @provisions = provisions
32
31
  @arguments = arguments
33
32
 
@@ -35,20 +34,18 @@ module Build
35
34
  end
36
35
 
37
36
  attr :environment
38
- attr :dependency
39
37
  attr :provisions
40
38
  attr :arguments
41
39
 
42
40
  def == other
43
41
  super and
44
42
  @environment == other.environment and
45
- @dependency == other.dependency and
46
43
  @provisions == other.provisions and
47
44
  @arguments == other.arguments
48
45
  end
49
46
 
50
47
  def hash
51
- super ^ @environment.hash ^ @dependency.hash ^ @provisions.hash ^ @arguments.hash
48
+ super ^ @environment.hash ^ @provisions.hash ^ @arguments.hash
52
49
  end
53
50
 
54
51
  def task_class(parent_task)
@@ -56,11 +53,11 @@ module Build
56
53
  end
57
54
 
58
55
  def initial_environment
59
- Build::Environment.new(@environment, name: @dependency.name)
56
+ Build::Environment.new(@environment)
60
57
  end
61
58
 
62
59
  def name
63
- @dependency.name
60
+ @environment.name
64
61
  end
65
62
 
66
63
  def apply!(task)
@@ -84,6 +84,20 @@ module Build
84
84
  def dependency_node_for(dependency)
85
85
  DependencyNode.new(@chain, dependency, @environment, @arguments)
86
86
  end
87
+
88
+ def print_dependencies(buffer = $stderr, level = 0)
89
+ self.provisions.each do |provision|
90
+ buffer.puts "#{" " * indentation}building #{provision.provider.name} which #{provision} which depends on:"
91
+
92
+ provision.each_dependency do |nested_dependency|
93
+ child = self.dependency_node_for(nested_dependency)
94
+
95
+ child.print_dependencies(buffer, level + 1)
96
+ end
97
+ end
98
+
99
+ return nil
100
+ end
87
101
  end
88
102
 
89
103
  class DependencyTask < Task
@@ -141,12 +155,12 @@ module Build
141
155
  # logger.debug {"Using #{environment}"}
142
156
  # end
143
157
 
144
- local_environment = Build::Environment.combine(*environments)&.evaluate || Build::Environment.new
158
+ local_environment = Build::Environment.combine(*environments)&.evaluate(name: dependency.name) || Build::Environment.new(name: dependency.name)
145
159
 
146
160
  # logger.debug("Local Environment: #{local_environment}")
147
161
 
148
162
  build_task = invoke(
149
- BuildNode.new(local_environment, dependency, @node.provisions, @node.arguments)
163
+ BuildNode.new(local_environment, @node.provisions, @node.arguments)
150
164
  )
151
165
 
152
166
  if wait_for_children?
data/lib/build/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Build
22
- VERSION = "2.5.1"
22
+ VERSION = "2.5.2"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-30 00:00:00.000000000 Z
11
+ date: 2019-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: build-graph