xcodeproj 1.5.9 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcodeproj/config.rb +11 -3
- data/lib/xcodeproj/constants.rb +6 -4
- data/lib/xcodeproj/gem_version.rb +1 -1
- data/lib/xcodeproj/project.rb +17 -2
- data/lib/xcodeproj/project/object/build_phase.rb +14 -0
- data/lib/xcodeproj/project/object/file_reference.rb +7 -0
- data/lib/xcodeproj/project/object/helpers/groupable_helper.rb +27 -2
- data/lib/xcodeproj/project/object/native_target.rb +1 -1
- data/lib/xcodeproj/project/object_attributes.rb +8 -5
- data/lib/xcodeproj/project/project_helper.rb +32 -8
- data/lib/xcodeproj/project/uuid_generator.rb +2 -1
- data/lib/xcodeproj/scheme/buildable_reference.rb +1 -1
- data/lib/xcodeproj/scheme/test_action.rb +90 -6
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 965a58aaa67ae7f0816637cadffecc3e53d6794b7ebe97d21a562b8ceeefd7dc
|
4
|
+
data.tar.gz: f2331d54681cec7fa80abab0f9d7f8ca21e04dae8d75fd037d6d71b757cf87e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7ec36d7eeda318e9c8d0eec8755fcbfe5a522abd650f173a86de627072fe200e05efa63125a4d56b4c5a880bf53abf07a649a41cf3c87152730eda0d57f77b5
|
7
|
+
data.tar.gz: 65ccb89e5efea8092af076619a8077f324084fc258132bf9763e7f8b27ce0a7e9827ee1e0d1a79700ec48b79c6f6c0d1c0f40c6f45138386969ff85d7b98e759
|
data/lib/xcodeproj/config.rb
CHANGED
@@ -27,6 +27,13 @@ module Xcodeproj
|
|
27
27
|
= # The assignment operator
|
28
28
|
(.*) # The value
|
29
29
|
/x
|
30
|
+
private_constant :KEY_VALUE_PATTERN
|
31
|
+
|
32
|
+
INHERITED = %w($(inherited) ${inherited}).freeze
|
33
|
+
private_constant :INHERITED
|
34
|
+
|
35
|
+
INHERITED_REGEXP = Regexp.union(INHERITED)
|
36
|
+
private_constant :INHERITED_REGEXP
|
30
37
|
|
31
38
|
# @return [Hash{String => String}] The attributes of the settings file
|
32
39
|
# excluding frameworks, weak_framework and libraries.
|
@@ -132,8 +139,7 @@ module Xcodeproj
|
|
132
139
|
|
133
140
|
result = attributes.dup
|
134
141
|
result['OTHER_LDFLAGS'] = list.join(' ') unless list.empty?
|
135
|
-
|
136
|
-
result.reject! { |_, v| inherited.any? { |i| i == v.to_s.strip } }
|
142
|
+
result.reject! { |_, v| INHERITED.any? { |i| i == v.to_s.strip } }
|
137
143
|
|
138
144
|
result = @includes.map do |incl|
|
139
145
|
path = File.expand_path(incl, @filepath.dirname)
|
@@ -272,7 +278,9 @@ module Xcodeproj
|
|
272
278
|
@includes.push include
|
273
279
|
else
|
274
280
|
key, value = extract_key_value(uncommented_line)
|
275
|
-
|
281
|
+
next unless key
|
282
|
+
value.gsub!(INHERITED_REGEXP) { |m| hash.fetch(key, m) }
|
283
|
+
hash[key] = value
|
276
284
|
end
|
277
285
|
end
|
278
286
|
hash
|
data/lib/xcodeproj/constants.rb
CHANGED
@@ -29,7 +29,7 @@ module Xcodeproj
|
|
29
29
|
|
30
30
|
# @return [String] The last known object version to Xcodeproj.
|
31
31
|
#
|
32
|
-
LAST_KNOWN_OBJECT_VERSION =
|
32
|
+
LAST_KNOWN_OBJECT_VERSION = 51
|
33
33
|
|
34
34
|
# @return [String] The last known object version to Xcodeproj.
|
35
35
|
#
|
@@ -227,7 +227,8 @@ module Xcodeproj
|
|
227
227
|
'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => 'DEBUG',
|
228
228
|
}.freeze,
|
229
229
|
[:release, :swift] => {
|
230
|
-
'
|
230
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule',
|
231
|
+
'SWIFT_OPTIMIZATION_LEVEL' => '-O',
|
231
232
|
}.freeze,
|
232
233
|
[:debug, :static_library, :swift] => {
|
233
234
|
}.freeze,
|
@@ -371,6 +372,7 @@ module Xcodeproj
|
|
371
372
|
'GCC_WARN_UNINITIALIZED_AUTOS' => 'YES_AGGRESSIVE',
|
372
373
|
'GCC_WARN_UNUSED_FUNCTION' => 'YES',
|
373
374
|
'GCC_WARN_UNUSED_VARIABLE' => 'YES',
|
375
|
+
'MTL_FAST_MATH' => 'YES',
|
374
376
|
'PRODUCT_NAME' => '$(TARGET_NAME)',
|
375
377
|
},
|
376
378
|
:release => {
|
@@ -384,7 +386,7 @@ module Xcodeproj
|
|
384
386
|
'GCC_DYNAMIC_NO_PIC' => 'NO',
|
385
387
|
'GCC_OPTIMIZATION_LEVEL' => '0',
|
386
388
|
'GCC_PREPROCESSOR_DEFINITIONS' => ['DEBUG=1', '$(inherited)'],
|
387
|
-
'MTL_ENABLE_DEBUG_INFO' => '
|
389
|
+
'MTL_ENABLE_DEBUG_INFO' => 'INCLUDE_SOURCE',
|
388
390
|
'ONLY_ACTIVE_ARCH' => 'YES',
|
389
391
|
}.freeze,
|
390
392
|
}.freeze
|
@@ -414,7 +416,7 @@ module Xcodeproj
|
|
414
416
|
|
415
417
|
# @return [Array] The extensions which are associated with header files.
|
416
418
|
#
|
417
|
-
HEADER_FILES_EXTENSIONS = %w(.h .hh .hpp .ipp .tpp .hxx .def .inl).freeze
|
419
|
+
HEADER_FILES_EXTENSIONS = %w(.h .hh .hpp .ipp .tpp .hxx .def .inl .inc).freeze
|
418
420
|
|
419
421
|
# @return [Array] The keywords Xcode use to identify a build setting can
|
420
422
|
# inherit values from a previous precedence level
|
data/lib/xcodeproj/project.rb
CHANGED
@@ -46,6 +46,10 @@ module Xcodeproj
|
|
46
46
|
#
|
47
47
|
attr_reader :path
|
48
48
|
|
49
|
+
# @return [Pathname] the directory of the project
|
50
|
+
#
|
51
|
+
attr_reader :project_dir
|
52
|
+
|
49
53
|
# @param [Pathname, String] path @see path
|
50
54
|
# The path provided will be expanded to an absolute path.
|
51
55
|
# @param [Bool] skip_initialization
|
@@ -64,6 +68,7 @@ module Xcodeproj
|
|
64
68
|
#
|
65
69
|
def initialize(path, skip_initialization = false, object_version = Constants::DEFAULT_OBJECT_VERSION)
|
66
70
|
@path = Pathname.new(path).expand_path
|
71
|
+
@project_dir = @path.dirname
|
67
72
|
@objects_by_uuid = {}
|
68
73
|
@generated_uuids = []
|
69
74
|
@available_uuids = []
|
@@ -676,6 +681,10 @@ module Xcodeproj
|
|
676
681
|
# @param [String] deployment_target
|
677
682
|
# the deployment target for the platform.
|
678
683
|
#
|
684
|
+
# @param [PBXGroup] product_group
|
685
|
+
# the product group, where to add to a file reference of the
|
686
|
+
# created target.
|
687
|
+
#
|
679
688
|
# @param [Symbol] language
|
680
689
|
# the primary language of the target, can be `:objc` or `:swift`.
|
681
690
|
#
|
@@ -721,10 +730,16 @@ module Xcodeproj
|
|
721
730
|
# @param [Array<AbstractTarget>] target_dependencies
|
722
731
|
# targets, which should be added as dependencies.
|
723
732
|
#
|
733
|
+
# @param [Symbol] platform
|
734
|
+
# the platform of the aggregate target. Can be `:ios` or `:osx`.
|
735
|
+
#
|
736
|
+
# @param [String] deployment_target
|
737
|
+
# the deployment target for the platform.
|
738
|
+
#
|
724
739
|
# @return [PBXNativeTarget] the target.
|
725
740
|
#
|
726
|
-
def new_aggregate_target(name, target_dependencies = [])
|
727
|
-
ProjectHelper.new_aggregate_target(self, name).tap do |aggregate_target|
|
741
|
+
def new_aggregate_target(name, target_dependencies = [], platform = nil, deployment_target = nil)
|
742
|
+
ProjectHelper.new_aggregate_target(self, name, platform, deployment_target).tap do |aggregate_target|
|
728
743
|
target_dependencies.each do |dep|
|
729
744
|
aggregate_target.add_dependency(dep)
|
730
745
|
end
|
@@ -250,6 +250,13 @@ module Xcodeproj
|
|
250
250
|
#
|
251
251
|
attribute :input_paths, Array, []
|
252
252
|
|
253
|
+
# @return [Array<String>] an array of input file list paths of the script.
|
254
|
+
#
|
255
|
+
# @example
|
256
|
+
# "$(SRCROOT)/newInputFile.xcfilelist"
|
257
|
+
#
|
258
|
+
attribute :input_file_list_paths, Array, []
|
259
|
+
|
253
260
|
# @return [Array<String>] an array of output paths of the script.
|
254
261
|
#
|
255
262
|
# @example
|
@@ -257,6 +264,13 @@ module Xcodeproj
|
|
257
264
|
#
|
258
265
|
attribute :output_paths, Array, []
|
259
266
|
|
267
|
+
# @return [Array<String>] an array of output file list paths of the script.
|
268
|
+
#
|
269
|
+
# @example
|
270
|
+
# "$(SRCROOT)/newOutputFile.xcfilelist"
|
271
|
+
#
|
272
|
+
attribute :output_file_list_paths, Array, []
|
273
|
+
|
260
274
|
# @return [String] the path to the script interpreter.
|
261
275
|
#
|
262
276
|
# @note Defaults to `/bin/sh`.
|
@@ -169,6 +169,13 @@ module Xcodeproj
|
|
169
169
|
GroupableHelper.real_path(self)
|
170
170
|
end
|
171
171
|
|
172
|
+
# @return [Pathname] the path of the file without resolving the
|
173
|
+
# source tree.
|
174
|
+
#
|
175
|
+
def full_path
|
176
|
+
GroupableHelper.full_path(self)
|
177
|
+
end
|
178
|
+
|
172
179
|
# Sets the source tree of the reference.
|
173
180
|
#
|
174
181
|
# @param [Symbol, String] source_tree
|
@@ -106,6 +106,31 @@ module Xcodeproj
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
# @param [PBXGroup, PBXFileReference] object
|
110
|
+
# The object to analyze.
|
111
|
+
#
|
112
|
+
# @return [Pathname] The path of the object without resolving the
|
113
|
+
# source tree.
|
114
|
+
#
|
115
|
+
def full_path(object)
|
116
|
+
folder = case object.source_tree
|
117
|
+
when '<group>'
|
118
|
+
parent(object).isa != 'PBXProject' ? full_path(parent(object)) : nil
|
119
|
+
when 'SOURCE_ROOT'
|
120
|
+
nil
|
121
|
+
when '<absolute>'
|
122
|
+
Pathname.new('/')
|
123
|
+
else
|
124
|
+
Pathname.new("${#{object.source_tree}}")
|
125
|
+
end
|
126
|
+
folder ||= Pathname.new('')
|
127
|
+
if object.path
|
128
|
+
folder + object.path
|
129
|
+
else
|
130
|
+
folder
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
109
134
|
# @param [PBXGroup, PBXFileReference] object
|
110
135
|
# The object to analyze.
|
111
136
|
#
|
@@ -116,12 +141,12 @@ module Xcodeproj
|
|
116
141
|
case object.source_tree
|
117
142
|
when '<group>'
|
118
143
|
if parent(object).isa == 'PBXProject'
|
119
|
-
object.project.
|
144
|
+
object.project.project_dir
|
120
145
|
else
|
121
146
|
real_path(parent(object))
|
122
147
|
end
|
123
148
|
when 'SOURCE_ROOT'
|
124
|
-
object.project.
|
149
|
+
object.project.project_dir
|
125
150
|
when '<absolute>'
|
126
151
|
nil
|
127
152
|
else
|
@@ -239,7 +239,7 @@ module Xcodeproj
|
|
239
239
|
container_proxy.container_portal = project.root_object.uuid
|
240
240
|
else
|
241
241
|
subproject_reference = project.reference_for_path(target.project.path)
|
242
|
-
raise ArgumentError, 'add_dependency
|
242
|
+
raise ArgumentError, 'add_dependency received target that belongs to a project that is not this project and is not a subproject of this project' unless subproject_reference
|
243
243
|
container_proxy.container_portal = subproject_reference.uuid
|
244
244
|
end
|
245
245
|
container_proxy.proxy_type = Constants::PROXY_TYPES[:native_target]
|
@@ -354,6 +354,7 @@ module Xcodeproj
|
|
354
354
|
# 1.9.2 fix, see https://github.com/CocoaPods/Xcodeproj/issues/40.
|
355
355
|
public(attrb.name)
|
356
356
|
|
357
|
+
variable_name = :"@#{attrb.name}"
|
357
358
|
define_method("#{attrb.name}=") do |value|
|
358
359
|
attrb.validate_value(value)
|
359
360
|
|
@@ -361,7 +362,7 @@ module Xcodeproj
|
|
361
362
|
return value if previous_value == value
|
362
363
|
mark_project_as_dirty!
|
363
364
|
previous_value.remove_referrer(self) if previous_value
|
364
|
-
instance_variable_set(
|
365
|
+
instance_variable_set(variable_name, value)
|
365
366
|
value.add_referrer(self) if value
|
366
367
|
end
|
367
368
|
end
|
@@ -392,12 +393,13 @@ module Xcodeproj
|
|
392
393
|
attrb.classes = isas
|
393
394
|
add_attribute(attrb)
|
394
395
|
|
396
|
+
variable_name = :"@#{attrb.name}"
|
395
397
|
define_method(attrb.name) do
|
396
398
|
# Here we are in the context of the instance
|
397
|
-
list = instance_variable_get(
|
399
|
+
list = instance_variable_get(variable_name)
|
398
400
|
unless list
|
399
401
|
list = ObjectList.new(attrb, self)
|
400
|
-
instance_variable_set(
|
402
|
+
instance_variable_set(variable_name, list)
|
401
403
|
end
|
402
404
|
list
|
403
405
|
end
|
@@ -428,12 +430,13 @@ module Xcodeproj
|
|
428
430
|
attrb.classes_by_key = classes_by_key
|
429
431
|
add_attribute(attrb)
|
430
432
|
|
433
|
+
variable_name = :"@#{attrb.name}"
|
431
434
|
define_method(attrb.name) do
|
432
435
|
# Here we are in the context of the instance
|
433
|
-
list = instance_variable_get(
|
436
|
+
list = instance_variable_get(variable_name)
|
434
437
|
unless list
|
435
438
|
list = ObjectList.new(attrb, self)
|
436
|
-
instance_variable_set(
|
439
|
+
instance_variable_set(variable_name, list)
|
437
440
|
end
|
438
441
|
list
|
439
442
|
end
|
@@ -55,8 +55,7 @@ module Xcodeproj
|
|
55
55
|
target.product_reference = product
|
56
56
|
|
57
57
|
# Build phases
|
58
|
-
target.build_phases << project.new(
|
59
|
-
target.build_phases << project.new(PBXFrameworksBuildPhase)
|
58
|
+
build_phases_for_target_type(type).each { |phase| target.build_phases << project.new(phase) }
|
60
59
|
|
61
60
|
# Frameworks
|
62
61
|
unless type == :static_library
|
@@ -116,9 +115,7 @@ module Xcodeproj
|
|
116
115
|
target.product_reference = product
|
117
116
|
|
118
117
|
# Build phases
|
119
|
-
target.build_phases << project.new(
|
120
|
-
target.build_phases << project.new(PBXFrameworksBuildPhase)
|
121
|
-
target.build_phases << project.new(PBXResourcesBuildPhase)
|
118
|
+
build_phases_for_target_type(:bundle).each { |phase| target.build_phases << project.new(phase) }
|
122
119
|
|
123
120
|
target
|
124
121
|
end
|
@@ -133,13 +130,19 @@ module Xcodeproj
|
|
133
130
|
# @param [String] name
|
134
131
|
# the name of the aggregate target.
|
135
132
|
#
|
133
|
+
# @param [Symbol] platform
|
134
|
+
# the platform of the aggregate target. Can be `:ios` or `:osx`.
|
135
|
+
#
|
136
|
+
# @param [String] deployment_target
|
137
|
+
# the deployment target for the platform.
|
138
|
+
#
|
136
139
|
# @return [PBXAggregateTarget] the target.
|
137
140
|
#
|
138
|
-
def self.new_aggregate_target(project, name)
|
141
|
+
def self.new_aggregate_target(project, name, platform, deployment_target)
|
139
142
|
target = project.new(PBXAggregateTarget)
|
140
143
|
project.targets << target
|
141
144
|
target.name = name
|
142
|
-
target.build_configuration_list = configuration_list(project)
|
145
|
+
target.build_configuration_list = configuration_list(project, platform, deployment_target)
|
143
146
|
target
|
144
147
|
end
|
145
148
|
|
@@ -293,7 +296,7 @@ module Xcodeproj
|
|
293
296
|
# @param [Object] object
|
294
297
|
# the object to copy.
|
295
298
|
#
|
296
|
-
# @return [Object] The
|
299
|
+
# @return [Object] The deep copy of the object.
|
297
300
|
#
|
298
301
|
def self.deep_dup(object)
|
299
302
|
case object
|
@@ -310,6 +313,27 @@ module Xcodeproj
|
|
310
313
|
end
|
311
314
|
end
|
312
315
|
|
316
|
+
# Returns the build phases, in order, that appear by default
|
317
|
+
# on a target of the given type.
|
318
|
+
#
|
319
|
+
# @param [Symbol] type
|
320
|
+
# the name of the target type.
|
321
|
+
#
|
322
|
+
# @return [Array<String>] The list of build phase class names for the target type.
|
323
|
+
#
|
324
|
+
def self.build_phases_for_target_type(type)
|
325
|
+
case type
|
326
|
+
when :static_library, :dynamic_library
|
327
|
+
%w(Headers Sources Frameworks)
|
328
|
+
when :framework
|
329
|
+
%w(Headers Sources Frameworks Resources)
|
330
|
+
when :command_line_tool
|
331
|
+
%w(Sources Frameworks)
|
332
|
+
else
|
333
|
+
%w(Sources Frameworks Resources)
|
334
|
+
end.map { |phase| "PBX#{phase}BuildPhase" }
|
335
|
+
end
|
336
|
+
|
313
337
|
#-----------------------------------------------------------------------#
|
314
338
|
end
|
315
339
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Xcodeproj
|
2
2
|
class Project
|
3
3
|
class UUIDGenerator
|
4
|
+
require 'digest'
|
5
|
+
|
4
6
|
def initialize(project)
|
5
7
|
@project = project
|
6
8
|
@new_objects_by_uuid = {}
|
@@ -76,7 +78,6 @@ module Xcodeproj
|
|
76
78
|
end
|
77
79
|
|
78
80
|
def uuid_for_path(path)
|
79
|
-
require 'digest'
|
80
81
|
Digest::MD5.hexdigest(path).upcase
|
81
82
|
end
|
82
83
|
|
@@ -116,7 +116,7 @@ module Xcodeproj
|
|
116
116
|
path = if !root_project_dir_path.to_s.empty?
|
117
117
|
root_project.path + root_project_dir_path
|
118
118
|
else
|
119
|
-
root_project.
|
119
|
+
root_project.project_dir
|
120
120
|
end
|
121
121
|
relative_path = target_project.path.relative_path_from(path).to_s
|
122
122
|
relative_path = target_project.path.basename if relative_path == '.'
|
@@ -151,6 +151,41 @@ module Xcodeproj
|
|
151
151
|
@xml_element.attributes['skipped'] = bool_to_string(flag)
|
152
152
|
end
|
153
153
|
|
154
|
+
# @return [Bool]
|
155
|
+
# Whether or not this TestableReference (test bundle) should be run in parallel or not
|
156
|
+
#
|
157
|
+
def parallelizable?
|
158
|
+
string_to_bool(@xml_element.attributes['parallelizable'])
|
159
|
+
end
|
160
|
+
|
161
|
+
# @param [Bool] flag
|
162
|
+
# Set whether or not this TestableReference (test bundle) should be run in parallel or not
|
163
|
+
#
|
164
|
+
def parallelizable=(flag)
|
165
|
+
@xml_element.attributes['parallelizable'] = bool_to_string(flag)
|
166
|
+
end
|
167
|
+
|
168
|
+
# @return [String]
|
169
|
+
# The execution order for this TestableReference (test bundle)
|
170
|
+
#
|
171
|
+
def test_execution_ordering
|
172
|
+
@xml_element.attributes['testExecutionOrdering']
|
173
|
+
end
|
174
|
+
|
175
|
+
# @param [String] order
|
176
|
+
# Set the execution order for this TestableReference (test bundle)
|
177
|
+
#
|
178
|
+
def test_execution_ordering=(order)
|
179
|
+
@xml_element.attributes['testExecutionOrdering'] = order
|
180
|
+
end
|
181
|
+
|
182
|
+
# @return [Bool]
|
183
|
+
# Whether or not this TestableReference (test bundle) should be run in randomized order.
|
184
|
+
#
|
185
|
+
def randomized?
|
186
|
+
test_execution_ordering == 'random'
|
187
|
+
end
|
188
|
+
|
154
189
|
# @return [Array<BuildableReference>]
|
155
190
|
# The list of BuildableReferences this action will build.
|
156
191
|
# (The list usually contains only one element)
|
@@ -168,21 +203,21 @@ module Xcodeproj
|
|
168
203
|
@xml_element.add_element(ref.xml_element)
|
169
204
|
end
|
170
205
|
|
171
|
-
# @return [Array<
|
206
|
+
# @return [Array<Test>]
|
172
207
|
# The list of SkippedTest this action will skip.
|
173
208
|
#
|
174
209
|
def skipped_tests
|
175
210
|
return [] if @xml_element.elements['SkippedTests'].nil?
|
176
211
|
@xml_element.elements['SkippedTests'].get_elements('Test').map do |node|
|
177
|
-
|
212
|
+
Test.new(node)
|
178
213
|
end
|
179
214
|
end
|
180
215
|
|
181
|
-
# @param [Array<
|
216
|
+
# @param [Array<Test>] tests
|
182
217
|
# Set the list of SkippedTest this action will skip.
|
183
218
|
#
|
184
219
|
def skipped_tests=(tests)
|
185
|
-
@xml_element.delete_element('SkippedTests')
|
220
|
+
@xml_element.delete_element('SkippedTests')
|
186
221
|
if tests.nil?
|
187
222
|
return
|
188
223
|
end
|
@@ -192,7 +227,7 @@ module Xcodeproj
|
|
192
227
|
end
|
193
228
|
end
|
194
229
|
|
195
|
-
# @param [
|
230
|
+
# @param [Test] skipped_test
|
196
231
|
# The SkippedTest to add to the list of tests this action will skip
|
197
232
|
#
|
198
233
|
def add_skipped_test(skipped_test)
|
@@ -200,7 +235,51 @@ module Xcodeproj
|
|
200
235
|
entries.add_element(skipped_test.xml_element)
|
201
236
|
end
|
202
237
|
|
203
|
-
|
238
|
+
# @return [Bool]
|
239
|
+
# Whether or not this TestableReference (test bundle) should use a whitelist or not
|
240
|
+
#
|
241
|
+
def use_test_selection_whitelist?
|
242
|
+
string_to_bool(@xml_element.attributes['useTestSelectionWhitelist'])
|
243
|
+
end
|
244
|
+
|
245
|
+
# @param [Bool] flag
|
246
|
+
# Set whether or not this TestableReference (test bundle) should use a whitelist or not
|
247
|
+
#
|
248
|
+
def use_test_selection_whitelist=(flag)
|
249
|
+
@xml_element.attributes['useTestSelectionWhitelist'] = bool_to_string(flag)
|
250
|
+
end
|
251
|
+
|
252
|
+
# @return [Array<Test>]
|
253
|
+
# The list of SelectedTest this action will run.
|
254
|
+
#
|
255
|
+
def selected_tests
|
256
|
+
return [] if @xml_element.elements['SelectedTests'].nil?
|
257
|
+
@xml_element.elements['SelectedTests'].get_elements('Test').map do |node|
|
258
|
+
Test.new(node)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# @param [Array<Test>] tests
|
263
|
+
# Set the list of SelectedTest this action will run.
|
264
|
+
#
|
265
|
+
def selected_tests=(tests)
|
266
|
+
@xml_element.delete_element('SelectedTests')
|
267
|
+
return if tests.nil?
|
268
|
+
entries = @xml_element.add_element('SelectedTests')
|
269
|
+
tests.each do |selected|
|
270
|
+
entries.add_element(selected.xml_element)
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
# @param [Test] selected_test
|
275
|
+
# The SelectedTest to add to the list of tests this action will run.
|
276
|
+
#
|
277
|
+
def add_selected_test(selected_test)
|
278
|
+
entries = @xml_element.elements['SelectedTests'] || @xml_element.add_element('SelectedTests')
|
279
|
+
entries.add_element(selected_test.xml_element)
|
280
|
+
end
|
281
|
+
|
282
|
+
class Test < XMLElementWrapper
|
204
283
|
# @param [REXML::Element] node
|
205
284
|
# The 'Test' XML node that this object will wrap.
|
206
285
|
# If nil, will create a default XML node to use.
|
@@ -226,6 +305,11 @@ module Xcodeproj
|
|
226
305
|
end
|
227
306
|
end
|
228
307
|
|
308
|
+
# Aliased to`Test` for compatibility
|
309
|
+
# @todo Remove in Xcodeproj 2
|
310
|
+
#
|
311
|
+
SkippedTest = Test
|
312
|
+
|
229
313
|
# @todo handle 'AdditionalOptions' tag
|
230
314
|
end
|
231
315
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcodeproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atomos
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: CFPropertyList
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0.2.
|
87
|
+
version: 0.2.6
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: 0.2.
|
94
|
+
version: 0.2.6
|
95
95
|
description: Xcodeproj lets you create and modify Xcode projects from Ruby. Script
|
96
96
|
boring management tasks or build Xcode-friendly libraries. Also includes support
|
97
97
|
for Xcode workspaces (.xcworkspace) and configuration files (.xcconfig).
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.7.
|
184
|
+
rubygems_version: 2.7.7
|
185
185
|
signing_key:
|
186
186
|
specification_version: 3
|
187
187
|
summary: Create and modify Xcode projects from Ruby.
|