xcodeproj 0.23.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa0f6900b32b2e81187155258bd93efaccab24e7
4
- data.tar.gz: 5990152c979ec79206161cd2f8ed0bcc47601bc1
3
+ metadata.gz: 5724a3e3cb2b1913f237022c11277c66c0bf32bc
4
+ data.tar.gz: b0bfc425a1c68e5d260dc3f3b45df5a03d479ca3
5
5
  SHA512:
6
- metadata.gz: 4409f563332fb076e1c39d6be7fee7cd87086aa05428ffc85c8405f434067a915f4c4cd6f7be1972f1f0ec7006c4be12e328c4d69c332f1fb924facd5f52815f
7
- data.tar.gz: d0b4413f8ad34fe2dbad39caf4870a8409f22fec4a6cbcaf5a489785b4bfc2531beb4a4292c029376303720567cef7b9a73f3ac09f14ca9e730597b9e92cb00d
6
+ metadata.gz: 11bad35703123c93d69dae1b88676b9534cdeacf4a11492c5fe12de3fb039aed5a9f4136c12319f7e1382025a05ec211573bb4f2ef10177331137042a9c36b35
7
+ data.tar.gz: a99f49f21b18873cd489ce6d38932094bbfd3ab68499ef70993a394994740f47216f3270463658bc25a710fdb9a19d28e6b0dd91f69ca45265bc07fdea22f9fc
@@ -61,7 +61,7 @@ module Xcodeproj
61
61
  end
62
62
 
63
63
  def ==(other)
64
- other.respond_to?(:to_hash) && other.to_hash == to_hash
64
+ other.attributes == attributes && other.other_linker_flags == other_linker_flags && other.includes == includes
65
65
  end
66
66
 
67
67
  public
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '0.23.1' unless defined? Xcodeproj::VERSION
4
+ VERSION = '0.24.0' unless defined? Xcodeproj::VERSION
5
5
  end
@@ -627,7 +627,7 @@ module DevToolsCore
627
627
  extern :class_getName, [Class], CoreFoundation::CharPointer
628
628
  end
629
629
 
630
- XCODE_PATH = Pathname.new(`xcrun xcode-select -p`.strip).dirname
630
+ XCODE_PATH = Pathname.new(`xcrun xcode-select --print-path`.strip).dirname
631
631
 
632
632
  def self.load_xcode_framework(framework)
633
633
  Fiddle.dlopen(XCODE_PATH.join(framework).to_s)
@@ -446,7 +446,7 @@ module Xcodeproj
446
446
  # project.
447
447
  #
448
448
  def files
449
- objects.select { |obj| obj.class == PBXFileReference }
449
+ objects.grep(PBXFileReference)
450
450
  end
451
451
 
452
452
  # Returns the file reference for the given absolute path.
@@ -469,13 +469,20 @@ module Xcodeproj
469
469
  end
470
470
  end
471
471
 
472
- # @return [ObjectList<PBXNativeTarget>] A list of all the targets in the
472
+ # @return [ObjectList<AbstractTarget>] A list of all the targets in the
473
473
  # project.
474
474
  #
475
475
  def targets
476
476
  root_object.targets
477
477
  end
478
478
 
479
+ # @return [ObjectList<PBXNativeTarget>] A list of all the targets in the
480
+ # project excluding aggregate targets.
481
+ #
482
+ def native_targets
483
+ root_object.targets.grep(PBXNativeTarget)
484
+ end
485
+
479
486
  # @return [PBXGroup] The group which holds the product file references.
480
487
  #
481
488
  def products_group
@@ -598,6 +605,31 @@ module Xcodeproj
598
605
  ProjectHelper.new_resources_bundle(self, name, platform, product_group)
599
606
  end
600
607
 
608
+ # Creates a new target and adds it to the project.
609
+ #
610
+ # The target is configured for the given platform and its file reference it
611
+ # is added to the {products_group}.
612
+ #
613
+ # The target is pre-populated with common build settings, and the
614
+ # appropriate Framework according to the platform is added to to its
615
+ # Frameworks phase.
616
+ #
617
+ # @param [String] name
618
+ # the name of the target.
619
+ #
620
+ # @param [Array<AbstractTarget>] target_dependencies
621
+ # targets, which should be added as dependencies.
622
+ #
623
+ # @return [PBXNativeTarget] the target.
624
+ #
625
+ def new_aggregate_target(name, target_dependencies = [])
626
+ ProjectHelper.new_aggregate_target(self, name).tap do |aggregate_target|
627
+ target_dependencies.each do |dep|
628
+ aggregate_target.add_dependency(dep)
629
+ end
630
+ end
631
+ end
632
+
601
633
  # Adds a new build configuration to the project and populates its with
602
634
  # default settings according to the provided type.
603
635
  #
@@ -192,7 +192,7 @@ module Xcodeproj
192
192
  # current file reference.
193
193
  #
194
194
  def build_files
195
- referrers.select { |r| r.class == PBXBuildFile }
195
+ referrers.grep(PBXBuildFile)
196
196
  end
197
197
 
198
198
  # Sets the last known file type according to the extension of the path.
@@ -149,7 +149,7 @@ module Xcodeproj
149
149
  # children.
150
150
  #
151
151
  def files
152
- children.select { |obj| obj.class == PBXFileReference }
152
+ children.grep(PBXFileReference)
153
153
  end
154
154
 
155
155
  # @return [PBXFileReference] The file references whose path (regardless
@@ -162,6 +162,7 @@ module Xcodeproj
162
162
  # @return [Array<PBXGroup>] the groups in the group children.
163
163
  #
164
164
  def groups
165
+ # Don't grep / is_a? as this would include child classes.
165
166
  children.select { |obj| obj.class == PBXGroup }
166
167
  end
167
168
 
@@ -169,7 +170,7 @@ module Xcodeproj
169
170
  # children.
170
171
  #
171
172
  def version_groups
172
- children.select { |obj| obj.class == XCVersionGroup }
173
+ children.grep(XCVersionGroup)
173
174
  end
174
175
 
175
176
  # @return [Array<PBXGroup,PBXFileReference,PBXReferenceProxy>] the
@@ -175,14 +175,14 @@ module Xcodeproj
175
175
  # the copy files build phases of the target.
176
176
  #
177
177
  def copy_files_build_phases
178
- build_phases.select { |bp| bp.class == PBXCopyFilesBuildPhase }
178
+ build_phases.grep(PBXCopyFilesBuildPhase)
179
179
  end
180
180
 
181
181
  # @return [Array<PBXShellScriptBuildPhase>]
182
182
  # the copy files build phases of the target.
183
183
  #
184
184
  def shell_script_build_phases
185
- build_phases.select { |bp| bp.class == PBXShellScriptBuildPhase }
185
+ build_phases.grep(PBXShellScriptBuildPhase)
186
186
  end
187
187
 
188
188
  # Adds a dependency on the given target.
@@ -6,7 +6,7 @@ module Xcodeproj
6
6
  class PBXProject < AbstractObject
7
7
  # @!group Attributes
8
8
 
9
- # @return [ObjectList<PBXNativeTarget>] a list of all the targets in
9
+ # @return [ObjectList<AbstractTarget>] a list of all the targets in
10
10
  # the project.
11
11
  #
12
12
  has_many :targets, AbstractTarget
@@ -123,6 +123,26 @@ module Xcodeproj
123
123
  target
124
124
  end
125
125
 
126
+ # Creates a new aggregate target and adds it to the project.
127
+ #
128
+ # The target is configured for the given platform.
129
+ #
130
+ # @param [Project] project
131
+ # the project to which the target should be added.
132
+ #
133
+ # @param [String] name
134
+ # the name of the aggregate target.
135
+ #
136
+ # @return [PBXAggregateTarget] the target.
137
+ #
138
+ def self.new_aggregate_target(project, name)
139
+ target = project.new(PBXAggregateTarget)
140
+ project.targets << target
141
+ target.name = name
142
+ target.build_configuration_list = configuration_list(project)
143
+ target
144
+ end
145
+
126
146
  # @!group Private Helpers
127
147
 
128
148
  #-----------------------------------------------------------------------#
@@ -148,7 +168,7 @@ module Xcodeproj
148
168
  #
149
169
  # @return [XCConfigurationList] the generated configuration list.
150
170
  #
151
- def self.configuration_list(project, platform, deployment_target = nil, target_product_type, language)
171
+ def self.configuration_list(project, platform = nil, deployment_target = nil, target_product_type = nil, language = nil)
152
172
  cl = project.new(XCConfigurationList)
153
173
  cl.default_configuration_is_visible = '0'
154
174
  cl.default_configuration_name = 'Release'
@@ -199,7 +219,7 @@ module Xcodeproj
199
219
  #
200
220
  # @return [Hash] The common build settings
201
221
  #
202
- def self.common_build_settings(type, platform, deployment_target = nil, target_product_type = nil, language = :objc)
222
+ def self.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc)
203
223
  target_product_type = (Constants::PRODUCT_TYPE_UTI.find { |_, v| v == target_product_type } || [target_product_type || :application])[0]
204
224
  common_settings = Constants::COMMON_BUILD_SETTINGS
205
225
 
@@ -110,7 +110,7 @@ module Xcodeproj
110
110
  buildable_reference.attributes['ReferencedContainer'] = construct_referenced_container_uri(test_target)
111
111
  end
112
112
 
113
- # Sets a runnable target target to be the target of the launch action of the scheme.
113
+ # Sets a runnable target to be the target of the launch action of the scheme.
114
114
  #
115
115
  # @param [Xcodeproj::Project::Object::AbstractTarget] build_target
116
116
  # A target used by scheme in the launch step.
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.24.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: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
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
@@ -47,22 +47,26 @@ executables:
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - README.md
51
50
  - LICENSE
51
+ - README.md
52
+ - bin/xcodeproj
53
+ - lib/xcodeproj.rb
54
+ - lib/xcodeproj/command.rb
52
55
  - lib/xcodeproj/command/config_dump.rb
53
56
  - lib/xcodeproj/command/project_diff.rb
54
57
  - lib/xcodeproj/command/show.rb
55
58
  - lib/xcodeproj/command/sort.rb
56
59
  - lib/xcodeproj/command/target_diff.rb
57
- - lib/xcodeproj/command.rb
58
- - lib/xcodeproj/config/other_linker_flags_parser.rb
59
60
  - lib/xcodeproj/config.rb
61
+ - lib/xcodeproj/config/other_linker_flags_parser.rb
60
62
  - lib/xcodeproj/constants.rb
61
63
  - lib/xcodeproj/differ.rb
62
64
  - lib/xcodeproj/gem_version.rb
63
65
  - lib/xcodeproj/helper.rb
64
66
  - lib/xcodeproj/plist_helper.rb
67
+ - lib/xcodeproj/project.rb
65
68
  - lib/xcodeproj/project/case_converter.rb
69
+ - lib/xcodeproj/project/object.rb
66
70
  - lib/xcodeproj/project/object/build_configuration.rb
67
71
  - lib/xcodeproj/project/object/build_file.rb
68
72
  - lib/xcodeproj/project/object/build_phase.rb
@@ -77,19 +81,15 @@ files:
77
81
  - lib/xcodeproj/project/object/reference_proxy.rb
78
82
  - lib/xcodeproj/project/object/root_object.rb
79
83
  - lib/xcodeproj/project/object/target_dependency.rb
80
- - lib/xcodeproj/project/object.rb
81
84
  - lib/xcodeproj/project/object_attributes.rb
82
85
  - lib/xcodeproj/project/object_dictionary.rb
83
86
  - lib/xcodeproj/project/object_list.rb
84
87
  - lib/xcodeproj/project/project_helper.rb
85
- - lib/xcodeproj/project.rb
86
88
  - lib/xcodeproj/scheme.rb
87
89
  - lib/xcodeproj/user_interface.rb
88
- - lib/xcodeproj/workspace/file_reference.rb
89
90
  - lib/xcodeproj/workspace.rb
91
+ - lib/xcodeproj/workspace/file_reference.rb
90
92
  - lib/xcodeproj/xcodebuild_helper.rb
91
- - lib/xcodeproj.rb
92
- - bin/xcodeproj
93
93
  homepage: https://github.com/cocoapods/xcodeproj
94
94
  licenses:
95
95
  - MIT
@@ -100,17 +100,17 @@ 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: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.0.14
113
+ rubygems_version: 2.4.6
114
114
  signing_key:
115
115
  specification_version: 3
116
116
  summary: Create and modify Xcode projects from Ruby.