xcodeproj 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xcodeproj +5 -5
  3. data/lib/xcodeproj.rb +0 -2
  4. data/lib/xcodeproj/command.rb +26 -17
  5. data/lib/xcodeproj/command/project_diff.rb +8 -11
  6. data/lib/xcodeproj/command/show.rb +8 -10
  7. data/lib/xcodeproj/command/sort.rb +4 -7
  8. data/lib/xcodeproj/command/target_diff.rb +4 -5
  9. data/lib/xcodeproj/config.rb +64 -57
  10. data/lib/xcodeproj/config/other_linker_flags_parser.rb +62 -0
  11. data/lib/xcodeproj/constants.rb +31 -30
  12. data/lib/xcodeproj/differ.rb +5 -9
  13. data/lib/xcodeproj/gem_version.rb +1 -2
  14. data/lib/xcodeproj/helper.rb +5 -4
  15. data/lib/xcodeproj/plist_helper.rb +46 -11
  16. data/lib/xcodeproj/project.rb +16 -20
  17. data/lib/xcodeproj/project/case_converter.rb +59 -0
  18. data/lib/xcodeproj/project/object.rb +40 -30
  19. data/lib/xcodeproj/project/object/build_configuration.rb +1 -5
  20. data/lib/xcodeproj/project/object/build_file.rb +1 -4
  21. data/lib/xcodeproj/project/object/build_phase.rb +2 -13
  22. data/lib/xcodeproj/project/object/build_rule.rb +0 -3
  23. data/lib/xcodeproj/project/object/configuration_list.rb +0 -4
  24. data/lib/xcodeproj/project/object/container_item_proxy.rb +2 -4
  25. data/lib/xcodeproj/project/object/file_reference.rb +3 -6
  26. data/lib/xcodeproj/project/object/group.rb +6 -14
  27. data/lib/xcodeproj/project/object/helpers/file_references_factory.rb +64 -13
  28. data/lib/xcodeproj/project/object/helpers/groupable_helper.rb +4 -6
  29. data/lib/xcodeproj/project/object/native_target.rb +18 -29
  30. data/lib/xcodeproj/project/object/reference_proxy.rb +0 -4
  31. data/lib/xcodeproj/project/object/root_object.rb +4 -8
  32. data/lib/xcodeproj/project/object/target_dependency.rb +1 -4
  33. data/lib/xcodeproj/project/object_attributes.rb +76 -33
  34. data/lib/xcodeproj/project/object_dictionary.rb +76 -63
  35. data/lib/xcodeproj/project/object_list.rb +5 -9
  36. data/lib/xcodeproj/project/project_helper.rb +2 -7
  37. data/lib/xcodeproj/project/xcproj_helper.rb +0 -2
  38. data/lib/xcodeproj/scheme.rb +12 -15
  39. data/lib/xcodeproj/user_interface.rb +0 -4
  40. data/lib/xcodeproj/workspace.rb +36 -23
  41. data/lib/xcodeproj/workspace/file_reference.rb +3 -3
  42. data/lib/xcodeproj/xcodebuild_helper.rb +0 -6
  43. metadata +20 -18
@@ -0,0 +1,62 @@
1
+ require 'shellwords'
2
+
3
+ module Xcodeproj
4
+ class Config
5
+ # Parses other linker flags values.
6
+ #
7
+ module OtherLinkerFlagsParser
8
+ # @return [Hash{Symbol, Array[String]}] Splits the given
9
+ # other linker flags value by type.
10
+ #
11
+ # @param [String] flags
12
+ # The other linker flags value.
13
+ #
14
+ def self.parse(flags)
15
+ result = {
16
+ :frameworks => [],
17
+ :weak_frameworks => [],
18
+ :libraries => [],
19
+ :simple => [],
20
+ }
21
+
22
+ key = nil
23
+ split(flags).each do |token|
24
+ case token
25
+ when '-framework'
26
+ key = :frameworks
27
+ when '-weak_framework'
28
+ key = :weak_frameworks
29
+ when '-l'
30
+ key = :libraries
31
+ else
32
+ if key
33
+ result[key] << token
34
+ key = nil
35
+ else
36
+ result[:simple] << token
37
+ end
38
+ end
39
+ end
40
+ result
41
+ end
42
+
43
+ # @return [Array<String>] Split the given other linker
44
+ # flags value, taking into account quoting and
45
+ # the fact that the `-l` flag might omit the
46
+ # space.
47
+ #
48
+ # @param [String] flags
49
+ # The other linker flags value.
50
+ #
51
+ def self.split(flags)
52
+ flags.strip.shellsplit.map do |string|
53
+ if string =~ /\A-l.+/
54
+ ['-l', string[2..-1]]
55
+ else
56
+ string
57
+ end
58
+ end.flatten
59
+ end
60
+ end
61
+ end
62
+ end
@@ -1,9 +1,7 @@
1
1
  module Xcodeproj
2
-
3
2
  # This modules groups all the constants known to Xcodeproj.
4
3
  #
5
4
  module Constants
6
-
7
5
  # @return [String] The last known iOS SDK (stable).
8
6
  #
9
7
  LAST_KNOWN_IOS_SDK = '7.1'
@@ -27,7 +25,7 @@ module Xcodeproj
27
25
  # @return [Hash] The all the known ISAs grouped by superclass.
28
26
  #
29
27
  KNOWN_ISAS = {
30
- 'AbstractObject' => %w[
28
+ 'AbstractObject' => %w(
31
29
  PBXBuildFile
32
30
  AbstractBuildPhase
33
31
  PBXBuildRule
@@ -39,53 +37,56 @@ module Xcodeproj
39
37
  PBXProject
40
38
  PBXTargetDependency
41
39
  PBXReferenceProxy
42
- ],
40
+ ),
43
41
 
44
- 'AbstractBuildPhase' => %w[
42
+ 'AbstractBuildPhase' => %w(
45
43
  PBXCopyFilesBuildPhase
46
44
  PBXResourcesBuildPhase
47
45
  PBXSourcesBuildPhase
48
46
  PBXFrameworksBuildPhase
49
47
  PBXHeadersBuildPhase
50
48
  PBXShellScriptBuildPhase
51
- ],
49
+ ),
52
50
 
53
- 'AbstractTarget' => %w[
51
+ 'AbstractTarget' => %w(
54
52
  PBXNativeTarget
55
53
  PBXAggregateTarget
56
54
  PBXLegacyTarget
57
- ],
55
+ ),
58
56
 
59
- 'PBXGroup' => %w[
57
+ 'PBXGroup' => %w(
60
58
  XCVersionGroup
61
59
  PBXVariantGroup
62
- ]
60
+ ),
63
61
  }.freeze
64
62
 
65
63
  # @return [Array] The list of the super classes for each ISA.
66
64
  #
67
- ISAS_SUPER_CLASSES = %w[ AbstractObject AbstractBuildPhase PBXGroup ]
65
+ ISAS_SUPER_CLASSES = %w(AbstractObject AbstractBuildPhase PBXGroup)
68
66
 
69
67
  # @return [Hash] The known file types corresponding to each extension.
70
68
  #
71
69
  FILE_TYPES_BY_EXTENSION = {
72
70
  'a' => 'archive.ar',
73
71
  'app' => 'wrapper.application',
72
+ 'bundle' => 'wrapper.plug-in',
74
73
  'dylib' => 'compiled.mach-o.dylib',
75
74
  'framework' => 'wrapper.framework',
76
- 'bundle' => 'wrapper.plug-in',
77
75
  'h' => 'sourcecode.c.h',
78
76
  'm' => 'sourcecode.c.objc',
77
+ 'markdown' => 'text',
78
+ 'mdimporter' => 'wrapper.cfbundle',
79
+ 'octest' => 'wrapper.cfbundle',
79
80
  'pch' => 'sourcecode.c.h',
80
- 'xcconfig' => 'text.xcconfig',
81
- 'xcdatamodel' => 'wrapper.xcdatamodel',
82
- 'xib' => 'file.xib',
81
+ 'plist' => 'text.plist.xml',
83
82
  'sh' => 'text.script.sh',
84
83
  'swift' => 'sourcecode.swift',
85
- 'plist' => 'text.plist.xml',
86
- 'markdown' => 'text',
87
84
  'xcassets' => 'folder.assetcatalog',
88
- 'xctest' => 'wrapper.cfbundle'
85
+ 'xcconfig' => 'text.xcconfig',
86
+ 'xcdatamodel' => 'wrapper.xcdatamodel',
87
+ 'xcodeproj' => 'wrapper.pb-project',
88
+ 'xctest' => 'wrapper.cfbundle',
89
+ 'xib' => 'file.xib',
89
90
  }.freeze
90
91
 
91
92
  # @return [Hash] The uniform type identifier of various product types.
@@ -96,6 +97,7 @@ module Xcodeproj
96
97
  :dynamic_library => 'com.apple.product-type.library.dynamic',
97
98
  :static_library => 'com.apple.product-type.library.static',
98
99
  :bundle => 'com.apple.product-type.bundle',
100
+ :unit_test_bundle => 'com.apple.product-type.bundle.unit-test',
99
101
  }.freeze
100
102
 
101
103
  # @return [Hash] The extensions or the various product UTIs.
@@ -118,24 +120,24 @@ module Xcodeproj
118
120
  'SKIP_INSTALL' => 'YES',
119
121
  'DSTROOT' => '/tmp/xcodeproj.dst',
120
122
  'ALWAYS_SEARCH_USER_PATHS' => 'NO',
121
- 'INSTALL_PATH' => "$(BUILT_PRODUCTS_DIR)",
123
+ 'INSTALL_PATH' => '$(BUILT_PRODUCTS_DIR)',
122
124
  'OTHER_LDFLAGS' => '',
123
125
  'COPY_PHASE_STRIP' => 'YES',
124
126
  }.freeze,
125
127
  :debug => {
126
128
  'GCC_DYNAMIC_NO_PIC' => 'NO',
127
- 'GCC_PREPROCESSOR_DEFINITIONS' => ["DEBUG=1", "$(inherited)"],
129
+ 'GCC_PREPROCESSOR_DEFINITIONS' => ['DEBUG=1', '$(inherited)'],
128
130
  'GCC_SYMBOLS_PRIVATE_EXTERN' => 'NO',
129
131
  'GCC_OPTIMIZATION_LEVEL' => '0',
130
132
  'COPY_PHASE_STRIP' => 'NO',
131
133
  }.freeze,
132
134
  :release => {
133
- 'OTHER_CFLAGS' => ['-DNS_BLOCK_ASSERTIONS=1', "$(inherited)"],
134
- 'OTHER_CPLUSPLUSFLAGS' => ['-DNS_BLOCK_ASSERTIONS=1', "$(inherited)"],
135
+ 'OTHER_CFLAGS' => ['-DNS_BLOCK_ASSERTIONS=1', '$(inherited)'],
136
+ 'OTHER_CPLUSPLUSFLAGS' => ['-DNS_BLOCK_ASSERTIONS=1', '$(inherited)'],
135
137
  }.freeze,
136
138
  :ios => {
137
139
  'IPHONEOS_DEPLOYMENT_TARGET' => '4.3',
138
- 'PUBLIC_HEADERS_FOLDER_PATH' => "$(TARGET_NAME)",
140
+ 'PUBLIC_HEADERS_FOLDER_PATH' => '$(TARGET_NAME)',
139
141
  'SDKROOT' => 'iphoneos',
140
142
  }.freeze,
141
143
  :osx => {
@@ -164,8 +166,8 @@ module Xcodeproj
164
166
  PROJECT_DEFAULT_BUILD_SETTINGS = {
165
167
  :all => {
166
168
  'ALWAYS_SEARCH_USER_PATHS' => 'NO',
167
- 'CLANG_CXX_LANGUAGE_STANDARD' => "gnu++0x",
168
- 'CLANG_CXX_LIBRARY' => "libc++",
169
+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++0x',
170
+ 'CLANG_CXX_LIBRARY' => 'libc++',
169
171
  'CLANG_ENABLE_OBJC_ARC' => 'YES',
170
172
  'CLANG_WARN_BOOL_CONVERSION' => 'YES',
171
173
  'CLANG_WARN_CONSTANT_CONVERSION' => 'YES',
@@ -193,7 +195,7 @@ module Xcodeproj
193
195
  'COPY_PHASE_STRIP' => 'YES',
194
196
  'GCC_DYNAMIC_NO_PIC' => 'NO',
195
197
  'GCC_OPTIMIZATION_LEVEL' => '0',
196
- 'GCC_PREPROCESSOR_DEFINITIONS' => ["DEBUG=1", "$(inherited)"],
198
+ 'GCC_PREPROCESSOR_DEFINITIONS' => ['DEBUG=1', '$(inherited)'],
197
199
  'GCC_SYMBOLS_PRIVATE_EXTERN' => 'NO',
198
200
  }.freeze,
199
201
  }.freeze
@@ -205,18 +207,17 @@ module Xcodeproj
205
207
  :absolute_path => '0',
206
208
  :products_directory => '16',
207
209
  :wrapper => '1',
208
- :resources => '7', #default
210
+ :resources => '7', # default
209
211
  :executables => '6',
210
212
  :java_resources => '15',
211
213
  :frameworks => '10',
212
214
  :shared_frameworks => '11',
213
215
  :shared_support => '12',
214
- :plug_ins => '13'
216
+ :plug_ins => '13',
215
217
  }.freeze
216
218
 
217
219
  # @return [Hash] The extensions which are associated with header files.
218
220
  #
219
- HEADER_FILES_EXTENSIONS = %w| .h .hh .hpp .ipp |.freeze
220
-
221
+ HEADER_FILES_EXTENSIONS = %w(.h .hh .hpp .ipp).freeze
221
222
  end
222
223
  end
@@ -1,5 +1,4 @@
1
1
  module Xcodeproj
2
-
3
2
  # Computes the recursive diff of Hashes, Array and other objects.
4
3
  #
5
4
  # Useful to compare two projects. Inspired from
@@ -23,7 +22,6 @@ module Xcodeproj
23
22
  #
24
23
  #
25
24
  module Differ
26
-
27
25
  # Computes the recursive difference of two given values.
28
26
  #
29
27
  # @param [Object] value_1
@@ -58,7 +56,7 @@ module Xcodeproj
58
56
  else
59
57
  method = :generic_diff
60
58
  end
61
- self.send(method, value_1, value_2, options)
59
+ send(method, value_1, value_2, options)
62
60
  end
63
61
 
64
62
  # Optimized for reducing the noise from the tree hash of projects
@@ -138,8 +136,8 @@ module Xcodeproj
138
136
  end
139
137
  end
140
138
 
141
- new_objects_value_1 = new_objects_value_1 - matched_value_1
142
- new_objects_value_2 = new_objects_value_2 - matched_value_2
139
+ new_objects_value_1 -= matched_value_1
140
+ new_objects_value_2 -= matched_value_2
143
141
  end
144
142
 
145
143
  if new_objects_value_1.empty? && new_objects_value_2.empty?
@@ -166,7 +164,7 @@ module Xcodeproj
166
164
 
167
165
  {
168
166
  options[:key_1] => value_1,
169
- options[:key_2] => value_2
167
+ options[:key_2] => value_2,
170
168
  }
171
169
  end
172
170
 
@@ -209,7 +207,7 @@ module Xcodeproj
209
207
  when Hash
210
208
  clean_hash!(value, key)
211
209
  when Array
212
- value.each { |entry| clean_hash!(entry, key) if entry.is_a?(Hash)}
210
+ value.each { |entry| clean_hash!(entry, key) if entry.is_a?(Hash) }
213
211
  end
214
212
  end
215
213
  end
@@ -237,7 +235,5 @@ module Xcodeproj
237
235
  end
238
236
 
239
237
  #-------------------------------------------------------------------------#
240
-
241
238
  end
242
239
  end
243
-
@@ -1,6 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '0.18.0' unless defined? Xcodeproj::VERSION
4
+ VERSION = '0.19.0' unless defined? Xcodeproj::VERSION
5
5
  end
6
-
@@ -14,15 +14,16 @@ module Xcodeproj
14
14
  end
15
15
 
16
16
  # @return [Array<PBXBuildFile>] A list of source files (that will be
17
- # compiled) which are in ‘target 2’ but not in ‘target 1’. The list is
18
- # sorted by file path.
17
+ # compiled) which are in ‘target 2’ but not in ‘target 1’. The
18
+ # list is sorted by file path.
19
19
  #
20
20
  def new_source_build_files
21
- @target2.source_build_phase.files.reject do |target2_build_file|
21
+ new = @target2.source_build_phase.files.reject do |target2_build_file|
22
22
  @target1.source_build_phase.files.any? do |target1_build_file|
23
23
  target1_build_file.file_ref.path == target2_build_file.file_ref.path
24
24
  end
25
- end.sort_by { |build_file| build_file.file_ref.path }
25
+ end
26
+ new.sort_by { |build_file| build_file.file_ref.path }
26
27
  end
27
28
  end
28
29
  end
@@ -1,15 +1,12 @@
1
- begin
2
- require 'libxml'
3
- rescue LoadError
4
- Xcodeproj::UI.warn "Xcodeproj is using a fall back solution for parsing " \
5
- "XML. To use a faster alternative install libxml:\n" \
6
- "`$ gem install libxml-ruby`"
7
- end
8
1
  require 'cfpropertylist'
2
+ require 'open3'
9
3
 
10
4
  module Xcodeproj
11
5
  # Provides support for loading and serializing property list files.
12
6
  #
7
+ # @note CFPropertyList will automatically pick up the `libxml` strategy or
8
+ # other faster strategies, if their dependencies are available.
9
+ #
13
10
  module PlistHelper
14
11
  class << self
15
12
  # Serializes a hash as an XML property list file.
@@ -26,13 +23,24 @@ module Xcodeproj
26
23
  hash = hash.to_hash
27
24
  else
28
25
  raise TypeError, "The given `#{hash}`, must be a hash or " \
29
- "respond to to_hash"
26
+ 'respond to to_hash'
30
27
  end
31
28
  end
29
+
30
+ unless path.is_a?(String) || path.is_a?(Pathname)
31
+ raise TypeError, "The given `#{path}`, must be a string or " \
32
+ 'pathname'
33
+ end
32
34
  plist = CFPropertyList::List.new
33
35
  options = { :convert_unknown_to_string => true }
34
36
  plist.value = CFPropertyList.guess(hash, options)
35
- plist.save(path, CFPropertyList::List::FORMAT_XML)
37
+
38
+ if plutil_available?
39
+ contents = plist.to_str(CFPropertyList::List::FORMAT_XML)
40
+ plutil_save(contents, path)
41
+ else
42
+ plist.save(path, CFPropertyList::List::FORMAT_XML)
43
+ end
36
44
  end
37
45
 
38
46
  # @return [String] Returns the native objects loaded from a property list
@@ -83,13 +91,40 @@ module Xcodeproj
83
91
  # @note This method was extracted to simplify testing.
84
92
  #
85
93
  def plutil_contents(path)
86
- `plutil -convert xml1 "#{path}" -o -`
94
+ `#{plutil_bin} -convert xml1 "#{path}" -o -`
95
+ end
96
+
97
+ # Saves a property to an XML file via the plutil tool.
98
+ #
99
+ # @param [#to_s] contents.
100
+ # The contents of the property list.
101
+ #
102
+ # @param [#to_s] path
103
+ # The path of the file.
104
+ #
105
+ def plutil_save(contents, path)
106
+ Open3.popen3("#{plutil_bin} -convert xml1 -o '#{path}' -") do |stdin, stdout, _stderr|
107
+ stdin.puts(contents)
108
+ stdin.close
109
+ stdout.read # Make Ruby 1.8.7 wait
110
+ end
87
111
  end
88
112
 
89
113
  # @return [Bool] Whether the `plutil` tool is available.
90
114
  #
91
115
  def plutil_available?
92
- system('which plutil > /dev/null 2>&1')
116
+ !plutil_bin.nil?
117
+ end
118
+
119
+ # @return [String] The path of the `plutil` tool.
120
+ # @return [Nil] In case the plutil is not found.
121
+ #
122
+ def plutil_bin
123
+ unless @bin
124
+ bin = `which plutil`.strip
125
+ @bin = bin if $?.success?
126
+ end
127
+ @bin
93
128
  end
94
129
  end
95
130
  end
@@ -7,7 +7,6 @@ require 'xcodeproj/project/project_helper'
7
7
  require 'xcodeproj/project/xcproj_helper'
8
8
 
9
9
  module Xcodeproj
10
-
11
10
  # This class represents a Xcode project document.
12
11
  #
13
12
  # It can be used to manipulate existing documents or even create new ones
@@ -40,7 +39,6 @@ module Xcodeproj
40
39
  # consistent state.
41
40
  #
42
41
  class Project
43
-
44
42
  include Object
45
43
 
46
44
  # @return [Pathname] the path of the project.
@@ -64,7 +62,7 @@ module Xcodeproj
64
62
  initialize_from_scratch
65
63
  end
66
64
  unless skip_initialization.is_a?(TrueClass) || skip_initialization.is_a?(FalseClass)
67
- raise ArgumentError, "[Xcodeproj] Initialization parameter expected to " \
65
+ raise ArgumentError, '[Xcodeproj] Initialization parameter expected to ' \
68
66
  "be a boolean #{skip_initialization}"
69
67
  end
70
68
  end
@@ -130,12 +128,16 @@ module Xcodeproj
130
128
  "#<#{self.class}> path:`#{path}` UUID:`#{root_object.uuid}`"
131
129
  end
132
130
 
133
- alias :inspect :to_s
131
+ alias_method :inspect, :to_s
134
132
 
135
- # @return [Bool] Whether the xcproj conversion should be disabled.
133
+ # @return [Bool] Whether the xcproj conversion should be disabled. The
134
+ # conversion can be disable also via the
135
+ # `XCODEPROJ_DISABLE_XCPROJ` environment variable.
136
136
  #
137
137
  attr_accessor :disable_xcproj
138
-
138
+ def disable_xcproj?
139
+ @disable_xcproj || ENV['XCODEPROJ_DISABLE_XCPROJ']
140
+ end
139
141
 
140
142
  public
141
143
 
@@ -182,16 +184,15 @@ module Xcodeproj
182
184
  raise "[Xcodeproj] Unable to find a root object in #{pbxproj_path}."
183
185
  end
184
186
 
185
- if (archive_version.to_i > Constants::LAST_KNOWN_ARCHIVE_VERSION)
187
+ if archive_version.to_i > Constants::LAST_KNOWN_ARCHIVE_VERSION
186
188
  raise '[Xcodeproj] Unknown archive version.'
187
189
  end
188
190
 
189
- if (object_version.to_i > Constants::LAST_KNOWN_OBJECT_VERSION)
191
+ if object_version.to_i > Constants::LAST_KNOWN_OBJECT_VERSION
190
192
  raise '[Xcodeproj] Unknown object version.'
191
193
  end
192
194
  end
193
195
 
194
-
195
196
  public
196
197
 
197
198
  # @!group Plist serialization
@@ -278,7 +279,7 @@ module Xcodeproj
278
279
  {
279
280
  'File References' => root_object.main_group.pretty_print.values.first,
280
281
  'Targets' => root_object.targets.map(&:pretty_print),
281
- 'Build Configurations' => build_configurations.sort_by(&:name).map(&:pretty_print)
282
+ 'Build Configurations' => build_configurations.sort_by(&:name).map(&:pretty_print),
282
283
  }
283
284
  end
284
285
 
@@ -303,7 +304,7 @@ module Xcodeproj
303
304
  file = File.join(save_path, 'project.pbxproj')
304
305
  Xcodeproj::PlistHelper.write(to_hash, file)
305
306
  fix_encoding(file)
306
- XCProjHelper.touch(save_path) unless disable_xcproj
307
+ XCProjHelper.touch(save_path) unless disable_xcproj?
307
308
  end
308
309
 
309
310
  # Simple workaround to escape characters which are outside of ASCII
@@ -337,7 +338,6 @@ module Xcodeproj
337
338
  File.open(filename, 'wb') { |file| file.write(output) }
338
339
  end
339
340
 
340
-
341
341
  public
342
342
 
343
343
  # @!group Creating objects
@@ -377,9 +377,7 @@ module Xcodeproj
377
377
  # @return [String] A UUID unique to the project.
378
378
  #
379
379
  def generate_uuid
380
- while @available_uuids.empty?
381
- generate_available_uuid_list
382
- end
380
+ generate_available_uuid_list while @available_uuids.empty?
383
381
  @available_uuids.shift
384
382
  end
385
383
 
@@ -411,7 +409,6 @@ module Xcodeproj
411
409
  @available_uuids += uniques
412
410
  end
413
411
 
414
-
415
412
  public
416
413
 
417
414
  # @!group Convenience accessors
@@ -543,7 +540,6 @@ module Xcodeproj
543
540
  root_object.build_configuration_list.build_settings(name)
544
541
  end
545
542
 
546
-
547
543
  public
548
544
 
549
545
  # @!group Helpers
@@ -632,7 +628,9 @@ module Xcodeproj
632
628
  #
633
629
  def add_build_configuration(name, type)
634
630
  build_configuration_list = root_object.build_configuration_list
635
- unless build_configuration_list[name]
631
+ if build_configuration = build_configuration_list[name]
632
+ build_configuration
633
+ else
636
634
  build_configuration = new(XCBuildConfiguration)
637
635
  build_configuration.name = name
638
636
  common_settings = Constants::PROJECT_DEFAULT_BUILD_SETTINGS
@@ -657,7 +655,6 @@ module Xcodeproj
657
655
  root_object.sort_recursively(options)
658
656
  end
659
657
 
660
-
661
658
  public
662
659
 
663
660
  # @!group Schemes
@@ -707,6 +704,5 @@ module Xcodeproj
707
704
  end
708
705
 
709
706
  #-------------------------------------------------------------------------#
710
-
711
707
  end
712
708
  end