refinement 0.3.1 → 0.4.0

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: 42b43f8f3081cf4cca09c0a24956f5f12acdf6a9d4d6118c50e633be98314eed
4
- data.tar.gz: 0c3146bb128a1c914a0d8ada40bb822f6e2fb6ea808c9f375d5cfc2bd28d971b
3
+ metadata.gz: 04d0fd04129396944f17c5efc66a89026b71c0b43a7c38d083f0d520c119c422
4
+ data.tar.gz: 7b063936dffb285e47ae5caa5f62de942467f0b28dc030cfdf4a1d3470b123ae
5
5
  SHA512:
6
- metadata.gz: b317658245f639d73554c56bc25db74305f046376b5b966b2cc9a443c379390ace4fe5e8ccbbe7318f18722d707271439211d2b0635ce7b418191a4f471f4b6f
7
- data.tar.gz: 40fe0d269f5dbf305ac152eb3bbcd9961f596e4dde117602154dbf2f4b0266c44a856770d709e437010efec9d8bbd4f772e278c4c1d63fa743b618b67a84f446
6
+ metadata.gz: 4ef024baa70c295bed8d38332a731b694dd0d5f3b33dace25369a7d0fb3addc9e3b8ccbd03ed8b3ea4d8b6cd4329b329e0622979a2958d64b82ee189e039fbf7
7
+ data.tar.gz: 487a66ddbd2db6944e2ca1b38b1d6cfb34d3c6941a246c783e4ea1826acdded0fa2136b9a033a8857a2474e1209c9a764c882b69d74ccc19df81bb6176f1ffa9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
@@ -77,25 +77,38 @@ module Refinement
77
77
  "Given: #{filter_scheme_for_build_action.inspect}."
78
78
  end
79
79
 
80
- if filter_when_scheme_has_changed ||
81
- !UsedPath.new(path: Pathname(scheme_path), inclusion_reason: 'scheme').find_in_changeset(changeset)
80
+ if !filter_when_scheme_has_changed &&
81
+ UsedPath.new(path: Pathname(scheme_path), inclusion_reason: 'scheme').find_in_changeset(changeset)
82
+ return scheme
83
+ end
82
84
 
83
- changes_by_suite_name = Hash[annotate_targets!
84
- .map { |at| [at.xcode_target.name, at.change_reason(level: change_level)] }]
85
+ changes_by_suite_name = Hash[annotate_targets!
86
+ .map { |at| [at.xcode_target.name, at.change_reason(level: change_level)] }]
85
87
 
86
- doc = scheme.doc
88
+ doc = scheme.doc
87
89
 
88
- xpaths = sections_to_filter.map { |section| "//*/#{section}/BuildableReference" }
89
- xpaths.each do |xpath|
90
- doc.get_elements(xpath).to_a.each do |buildable_reference|
91
- suite_name = buildable_reference.attributes['BlueprintName']
92
- if (change_reason = changes_by_suite_name[suite_name])
93
- puts "#{suite_name} changed because #{change_reason}" if log_changes
94
- next
95
- end
96
- puts "#{suite_name} did not change, removing from scheme" if log_changes
97
- buildable_reference.parent.remove
90
+ xpaths = sections_to_filter.map { |section| "//*/#{section}/BuildableReference" }
91
+ xpaths.each do |xpath|
92
+ doc.get_elements(xpath).to_a.each do |buildable_reference|
93
+ suite_name = buildable_reference.attributes['BlueprintName']
94
+ if (change_reason = changes_by_suite_name[suite_name])
95
+ puts "#{suite_name} changed because #{change_reason}" if log_changes
96
+ next
97
+ end
98
+ puts "#{suite_name} did not change, removing from scheme" if log_changes
99
+ buildable_reference.parent.remove
100
+ end
101
+ end
102
+
103
+ if filter_scheme_for_build_action == :testing
104
+ doc.get_elements('//*/BuildActionEntry/BuildableReference').to_a.each do |buildable_reference|
105
+ suite_name = buildable_reference.attributes['BlueprintName']
106
+ if (change_reason = changes_by_suite_name[suite_name])
107
+ puts "#{suite_name} changed because #{change_reason}" if log_changes
108
+ next
98
109
  end
110
+ puts "#{suite_name} did not change, setting to not build for testing" if log_changes
111
+ buildable_reference.parent.attributes['buildForTesting'] = 'NO'
99
112
  end
100
113
  end
101
114
 
@@ -57,7 +57,9 @@ module Refinement
57
57
  change_reason = direct_change_reason
58
58
  if distance_from_target.positive?
59
59
  change_reason ||= Refinement.map_find(dependencies) do |dependency|
60
- next unless (dependency_change_reason = dependency.change_reason(level: [:at_most_n_away, level.last.pred]))
60
+ unless (dependency_change_reason = dependency.change_reason(level: [:at_most_n_away, level.last.pred]))
61
+ next
62
+ end
61
63
 
62
64
  "dependency #{dependency} changed because #{dependency_change_reason}"
63
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-20 00:00:00.000000000 Z
11
+ date: 2020-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj