xcodeproj 0.24.3 → 0.25.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
  SHA1:
3
- metadata.gz: 45749514086eccfd41add94a597a28e8a2df422c
4
- data.tar.gz: ef49f2cf25c13086e45ce900af380f55f1132c4d
3
+ metadata.gz: 3f8b59744123dd288ccf5eed2303ce6e9ff441b6
4
+ data.tar.gz: e808faecace05daf138478734b8f737e648eda70
5
5
  SHA512:
6
- metadata.gz: 2818dbb5919f5b147fc0f704b18841a83e57078e3232d293a9598b2b799cb92165ae2169becb20bdeb0d3b050bdeb99ce8590bca42152e133b26aa86e6d7eeab
7
- data.tar.gz: 015dbf4161e72b8f33877035743dac4d59468584aa1e8081021e9a2f0e96201c745d334c3b309ffb83aa5509e740f588e951ba7fc41a9b18b38be8c8862950aa
6
+ metadata.gz: 0ac442b8dd9088340357b5d30c1330a6aff37bb63922fe43e1e5d9ab6f8e7fe9fb8fa6766bdcd8494d6ccb310fa3c10afe4c40148a1791546523771468fb1e70
7
+ data.tar.gz: dc0cd72c4c6c781c97e327837401b5ee0d66317a61ff7ed8c999a63fe34ea6c3cf77b0824a19a8d695345c16b9fa6c077587e182a96b6f5f5acf9a51c448b59d
@@ -2,6 +2,7 @@ module Xcodeproj
2
2
  class Command
3
3
  class ConfigDump < Command
4
4
  def self.banner
5
+ require 'active_support/core_ext/string/strip.rb'
5
6
  <<-eos.strip_heredoc
6
7
  Dumps the build settings of all project targets for all configurations in
7
8
  directories named by the target in given output directory.
@@ -10,6 +10,9 @@ module Xcodeproj
10
10
  #
11
11
  LAST_KNOWN_OSX_SDK = '10.10'
12
12
 
13
+ # @return [String] The last known watchOS SDK (unstable).
14
+ LAST_KNOWN_WATCHOS_SDK = '2.0'
15
+
13
16
  # @return [String] The last known archive version to Xcodeproj.
14
17
  #
15
18
  LAST_KNOWN_ARCHIVE_VERSION = 1
@@ -23,7 +26,11 @@ module Xcodeproj
23
26
 
24
27
  # @return [String] The last known object version to Xcodeproj.
25
28
  #
26
- LAST_UPGRADE_CHECK = '0640'
29
+ LAST_UPGRADE_CHECK = '0700'
30
+
31
+ # @return [String] The last known object version to Xcodeproj.
32
+ #
33
+ LAST_SWIFT_UPGRADE_CHECK = '0700'
27
34
 
28
35
  # @return [Hash] The all the known ISAs grouped by superclass.
29
36
  #
@@ -101,7 +108,9 @@ module Xcodeproj
101
108
  :app_extension => 'com.apple.product-type.app-extension',
102
109
  :command_line_tool => 'com.apple.product-type.tool',
103
110
  :watch_app => 'com.apple.product-type.application.watchapp',
111
+ :watch2_app => 'com.apple.product-type.application.watchapp2',
104
112
  :watch_extension => 'com.apple.product-type.watchkit-extension',
113
+ :watch2_extension => 'com.apple.product-type.watchkit2-extension',
105
114
  }.freeze
106
115
 
107
116
  # @return [Hash] The extensions or the various product UTIs.
@@ -134,6 +143,9 @@ module Xcodeproj
134
143
  [:osx] => {
135
144
  'SDKROOT' => 'macosx',
136
145
  }.freeze,
146
+ [:watchos] => {
147
+ 'SDKROOT' => 'watchos',
148
+ }.freeze,
137
149
  [:debug, :osx] => {
138
150
  # Empty?
139
151
  }.freeze,
@@ -145,6 +157,16 @@ module Xcodeproj
145
157
  }.freeze,
146
158
  [:debug, :application, :swift] => {
147
159
  'SWIFT_OPTIMIZATION_LEVEL' => '-Onone',
160
+ 'ENABLE_TESTABILITY' => 'YES',
161
+ }.freeze,
162
+ [:debug, :dynamic_library, :swift] => {
163
+ 'ENABLE_TESTABILITY' => 'YES',
164
+ }.freeze,
165
+ [:debug, :framework, :swift] => {
166
+ 'ENABLE_TESTABILITY' => 'YES',
167
+ }.freeze,
168
+ [:debug, :static_library, :swift] => {
169
+ 'ENABLE_TESTABILITY' => 'YES',
148
170
  }.freeze,
149
171
  [:framework] => {
150
172
  'VERSION_INFO_PREFIX' => '',
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '0.24.3' unless defined? Xcodeproj::VERSION
4
+ VERSION = '0.25.0' unless defined? Xcodeproj::VERSION
5
5
  end
@@ -642,14 +642,10 @@ module DevToolsCore
642
642
  nil
643
643
  end
644
644
 
645
- # @note The IB frameworks only seem to be necessary on Xcode 7+
646
- #
647
645
  def self.load_xcode_frameworks
648
646
  load_xcode_framework('SharedFrameworks/DVTFoundation.framework/DVTFoundation')
649
647
  load_xcode_framework('SharedFrameworks/DVTSourceControl.framework/DVTSourceControl')
650
648
  load_xcode_framework('SharedFrameworks/CSServiceClient.framework/CSServiceClient')
651
- load_xcode_framework('Frameworks/IBFoundation.framework/IBFoundation')
652
- load_xcode_framework('Frameworks/IBAutolayoutFoundation.framework/IBAutolayoutFoundation')
653
649
  load_xcode_framework('Frameworks/IDEFoundation.framework/IDEFoundation')
654
650
  load_xcode_framework('PlugIns/Xcode3Core.ideplugin/Contents/MacOS/Xcode3Core')
655
651
  end
@@ -703,6 +699,8 @@ module DevToolsCore
703
699
  def initialize(path)
704
700
  DevToolsCore.silence_stderr do
705
701
  CoreFoundation.IDEInitialize(1, CoreFoundation::NULL)
702
+
703
+ # The parameter is whether UI must be initialized (which we don't need)
706
704
  CoreFoundation.XCInitializeCoreIfNeeded(0)
707
705
  end
708
706
 
@@ -93,6 +93,8 @@ module Xcodeproj
93
93
  :ios
94
94
  elsif sdk.include? 'macosx'
95
95
  :osx
96
+ elsif sdk.include? 'watchos'
97
+ :watchos
96
98
  end
97
99
  end
98
100
 
@@ -108,10 +110,10 @@ module Xcodeproj
108
110
  # platform.
109
111
  #
110
112
  def deployment_target
111
- if platform_name == :ios
112
- common_resolved_build_setting('IPHONEOS_DEPLOYMENT_TARGET')
113
- else
114
- common_resolved_build_setting('MACOSX_DEPLOYMENT_TARGET')
113
+ case platform_name
114
+ when :ios then common_resolved_build_setting('IPHONEOS_DEPLOYMENT_TARGET')
115
+ when :osx then common_resolved_build_setting('MACOSX_DEPLOYMENT_TARGET')
116
+ when :watchos then common_resolved_build_setting('WATCHOS_DEPLOYMENT_TARGET')
115
117
  end
116
118
  end
117
119
 
@@ -294,6 +296,10 @@ module Xcodeproj
294
296
  group = project.frameworks_group['OS X'] || project.frameworks_group.new_group('OS X')
295
297
  path_sdk_name = 'MacOSX'
296
298
  path_sdk_version = sdk_version || Constants::LAST_KNOWN_OSX_SDK
299
+ when :watchos
300
+ group = project.frameworks_group['watchOS'] || project.frameworks_group.new_group('watchOS')
301
+ path_sdk_name = 'WatchOS'
302
+ path_sdk_version = sdk_version || Constants::LAST_KNOWN_WATCHOS_SDK
297
303
  else
298
304
  raise 'Unknown platform for target'
299
305
  end
@@ -398,7 +404,7 @@ module Xcodeproj
398
404
  # the files references of the source files that should be added
399
405
  # to the target.
400
406
  #
401
- # @param [Hash{String=>String}] compiler_flags
407
+ # @param [String] compiler_flags
402
408
  # the compiler flags for the source files.
403
409
  #
404
410
  # @yield_param [PBXBuildFile] each created build file.
@@ -407,18 +413,21 @@ module Xcodeproj
407
413
  #
408
414
  def add_file_references(file_references, compiler_flags = {})
409
415
  file_references.map do |file|
410
- build_file = project.new(PBXBuildFile)
411
- build_file.file_ref = file
412
-
413
416
  extension = File.extname(file.path).downcase
414
417
  header_extensions = Constants::HEADER_FILES_EXTENSIONS
415
- if header_extensions.include?(extension)
416
- headers_build_phase.files << build_file
417
- else
418
- if compiler_flags && !compiler_flags.empty?
419
- build_file.settings = { 'COMPILER_FLAGS' => compiler_flags }
418
+ is_header_phase = header_extensions.include?(extension)
419
+ phase = is_header_phase ? headers_build_phase : source_build_phase
420
+
421
+ unless build_file = phase.build_file(file)
422
+ build_file = project.new(PBXBuildFile)
423
+ build_file.file_ref = file
424
+ phase.files << build_file
425
+ end
426
+
427
+ if compiler_flags && !compiler_flags.empty? && !is_header_phase
428
+ (build_file.settings ||= {}).merge!('COMPILER_FLAGS' => compiler_flags) do |_, old, new|
429
+ [old, new].compact.join(' ')
420
430
  end
421
- source_build_phase.files << build_file
422
431
  end
423
432
 
424
433
  yield build_file if block_given?
@@ -436,6 +445,7 @@ module Xcodeproj
436
445
  #
437
446
  def add_resources(resource_file_references)
438
447
  resource_file_references.each do |file|
448
+ next if resources_build_phase.include?(file)
439
449
  build_file = project.new(PBXBuildFile)
440
450
  build_file.file_ref = file
441
451
  resources_build_phase.files << build_file
@@ -20,7 +20,9 @@ module Xcodeproj
20
20
  # - `LastUpgradeCheck`
21
21
  # - `ORGANIZATIONNAME`
22
22
  #
23
- attribute :attributes, Hash, 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK
23
+ attribute :attributes, Hash,
24
+ 'LastSwiftUpdateCheck' => Constants::LAST_SWIFT_UPGRADE_CHECK,
25
+ 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK
24
26
 
25
27
  # @return [XCConfigurationList] the configuration list of the project.
26
28
  #
@@ -59,7 +59,7 @@ module Xcodeproj
59
59
  target.build_phases << project.new(PBXFrameworksBuildPhase)
60
60
 
61
61
  # Frameworks
62
- framework_name = (platform == :ios) ? 'Foundation' : 'Cocoa'
62
+ framework_name = (platform == :osx) ? 'Cocoa' : 'Foundation'
63
63
  target.add_system_framework(framework_name)
64
64
 
65
65
  target
@@ -234,10 +234,10 @@ module Xcodeproj
234
234
  end
235
235
 
236
236
  if deployment_target
237
- if platform == :ios
238
- settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
239
- elsif platform == :osx
240
- settings['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
237
+ case platform
238
+ when :ios then settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
239
+ when :osx then settings['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
240
+ when :watchos then settings['WATCHOS_DEPLOYMENT_TARGET'] = deployment_target
241
241
  end
242
242
  end
243
243
 
@@ -33,6 +33,8 @@ module Xcodeproj
33
33
  @test_action.attributes['shouldUseLaunchSchemeArgsEnv'] = 'YES'
34
34
  @test_action.attributes['buildConfiguration'] = 'Debug'
35
35
 
36
+ @test_action_additional_options = @test_action.add_element 'AdditionalOptions'
37
+
36
38
  @testables = @test_action.add_element 'Testables'
37
39
 
38
40
  @launch_action = @scheme.add_element 'LaunchAction'
@@ -43,6 +45,7 @@ module Xcodeproj
43
45
  @launch_action.attributes['buildConfiguration'] = 'Debug'
44
46
  @launch_action.attributes['ignoresPersistentStateOnLaunch'] = 'NO'
45
47
  @launch_action.attributes['debugDocumentVersioning'] = 'YES'
48
+ @launch_action.attributes['debugServiceExtension'] = 'internal'
46
49
  @launch_action.attributes['allowLocationSimulation'] = 'YES'
47
50
  @launch_action.add_element('AdditionalOptions')
48
51
 
@@ -117,6 +120,7 @@ module Xcodeproj
117
120
  #
118
121
  def set_launch_target(build_target)
119
122
  launch_product_runnable = @launch_action.add_element 'BuildableProductRunnable'
123
+ launch_product_runnable.attributes['runnableDebuggingMode'] = '0'
120
124
 
121
125
  launch_buildable_reference = launch_product_runnable.add_element 'BuildableReference'
122
126
  launch_buildable_reference.attributes['BuildableIdentifier'] = 'primary'
@@ -10,14 +10,21 @@ module Xcodeproj
10
10
  #
11
11
  def last_ios_sdk
12
12
  parse_sdks_if_needed
13
- verions_by_sdk[:ios].sort.last
13
+ versions_by_sdk[:ios].sort.last
14
14
  end
15
15
 
16
16
  # @return [String] The version of the last OS X sdk.
17
17
  #
18
18
  def last_osx_sdk
19
19
  parse_sdks_if_needed
20
- verions_by_sdk[:osx].sort.last
20
+ versions_by_sdk[:osx].sort.last
21
+ end
22
+
23
+ # @return [String] The version of the last watchOS sdk.
24
+ #
25
+ def last_watchos_sdk
26
+ parse_sdks_if_needed
27
+ versions_by_sdk[:watchos].sort.last
21
28
  end
22
29
 
23
30
  private
@@ -28,22 +35,24 @@ module Xcodeproj
28
35
 
29
36
  # @return [Hash] The versions of the sdks grouped by name (`:ios`, or `:osx`).
30
37
  #
31
- attr_accessor :verions_by_sdk
38
+ attr_accessor :versions_by_sdk
32
39
 
33
40
  # @return [void] Parses the SDKs returned by xcodebuild and stores the
34
41
  # information in the `needs_to_parse_sdks` hash.
35
42
  #
36
43
  def parse_sdks_if_needed
37
44
  if @needs_to_parse_sdks
38
- @verions_by_sdk = {}
39
- @verions_by_sdk[:osx] = []
40
- @verions_by_sdk[:ios] = []
45
+ @versions_by_sdk = {}
46
+ @versions_by_sdk[:osx] = []
47
+ @versions_by_sdk[:ios] = []
48
+ @versions_by_sdk[:watchos] = []
41
49
  if xcodebuild_available?
42
- skds = parse_sdks_information(xcodebuild_sdks)
43
- skds.each do |(name, version)|
50
+ sdks = parse_sdks_information(xcodebuild_sdks)
51
+ sdks.each do |(name, version)|
44
52
  case
45
- when name == 'macosx' then @verions_by_sdk[:osx] << version
46
- when name == 'iphoneos' then @verions_by_sdk[:ios] << version
53
+ when name == 'macosx' then @versions_by_sdk[:osx] << version
54
+ when name == 'iphoneos' then @versions_by_sdk[:ios] << version
55
+ when name == 'watchos' then @versions_by_sdk[:watchos] << version
47
56
  end
48
57
  end
49
58
  end
@@ -64,7 +73,7 @@ module Xcodeproj
64
73
  # is the name of the SDK and the second is the version.
65
74
  #
66
75
  def parse_sdks_information(output)
67
- output.scan(/-sdk (macosx|iphoneos)(.+\w)/)
76
+ output.scan(/-sdk (macosx|iphoneos|watchos)(.+\w)/)
68
77
  end
69
78
 
70
79
  # @return [String] The sdk information reported by xcodebuild.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.3
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -14,28 +14,28 @@ dependencies:
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '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
26
  version: '3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  description: Xcodeproj lets you create and modify Xcode projects from Ruby. Script
@@ -100,12 +100,12 @@ require_paths:
100
100
  - lib
101
101
  required_ruby_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - '>='
104
104
  - !ruby/object:Gem::Version
105
105
  version: 2.0.0
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []