xcodeproj 1.14.0 → 1.18.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/constants.rb +40 -36
- data/lib/xcodeproj/gem_version.rb +1 -1
- data/lib/xcodeproj/project/object/build_configuration.rb +33 -8
- data/lib/xcodeproj/project/object/helpers/file_references_factory.rb +3 -1
- data/lib/xcodeproj/project/object/helpers/groupable_helper.rb +1 -1
- data/lib/xcodeproj/project/object/target_dependency.rb +1 -0
- data/lib/xcodeproj/scheme/build_action.rb +21 -0
- data/lib/xcodeproj/scheme/launch_action.rb +16 -0
- data/lib/xcodeproj/scheme/test_action.rb +19 -0
- data/lib/xcodeproj/workspace.rb +3 -2
- data/lib/xcodeproj/workspace/file_reference.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db41f610ede2d2129632067db352ca8a6011f364e792629eb2cda1e95ded7006
|
4
|
+
data.tar.gz: b7c2a633c72ac7f3da93bbc621604ffb5550a02cf0e0126c9a932a0f4569640e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78013282d38ab9fb0829401198c34f4d0953078fe550687b6979bd94c43b40b3b9c45eb4ca99d785f3af03a48c6d0597f3425679e1b471f3d2e699b37e533973
|
7
|
+
data.tar.gz: a762fe5999cccd9b3da51a4f787513142b7a1e41875cc5870566b0e7d259b19ab891b2f46569e42c179029562356005feb3d2ad796e1bdd442cda5dbcffc7d41
|
data/lib/xcodeproj/constants.rb
CHANGED
@@ -32,7 +32,7 @@ module Xcodeproj
|
|
32
32
|
|
33
33
|
# @return [String] The last known object version to Xcodeproj.
|
34
34
|
#
|
35
|
-
LAST_KNOWN_OBJECT_VERSION =
|
35
|
+
LAST_KNOWN_OBJECT_VERSION = 54
|
36
36
|
|
37
37
|
# @return [String] The last known object version to Xcodeproj.
|
38
38
|
#
|
@@ -126,6 +126,8 @@ module Xcodeproj
|
|
126
126
|
# @return [Hash] The compatibility version string for different object versions.
|
127
127
|
#
|
128
128
|
COMPATIBILITY_VERSION_BY_OBJECT_VERSION = {
|
129
|
+
54 => 'Xcode 12.0',
|
130
|
+
53 => 'Xcode 11.4',
|
129
131
|
52 => 'Xcode 11.0',
|
130
132
|
51 => 'Xcode 10.0',
|
131
133
|
50 => 'Xcode 9.3',
|
@@ -138,46 +140,48 @@ module Xcodeproj
|
|
138
140
|
# @return [Hash] The uniform type identifier of various product types.
|
139
141
|
#
|
140
142
|
PRODUCT_TYPE_UTI = {
|
141
|
-
:application
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
160
|
-
:
|
143
|
+
:application => 'com.apple.product-type.application',
|
144
|
+
:application_on_demand_install_capable => 'com.apple.product-type.application.on-demand-install-capable',
|
145
|
+
:framework => 'com.apple.product-type.framework',
|
146
|
+
:dynamic_library => 'com.apple.product-type.library.dynamic',
|
147
|
+
:static_library => 'com.apple.product-type.library.static',
|
148
|
+
:bundle => 'com.apple.product-type.bundle',
|
149
|
+
:octest_bundle => 'com.apple.product-type.bundle',
|
150
|
+
:unit_test_bundle => 'com.apple.product-type.bundle.unit-test',
|
151
|
+
:ui_test_bundle => 'com.apple.product-type.bundle.ui-testing',
|
152
|
+
:app_extension => 'com.apple.product-type.app-extension',
|
153
|
+
:command_line_tool => 'com.apple.product-type.tool',
|
154
|
+
:watch_app => 'com.apple.product-type.application.watchapp',
|
155
|
+
:watch2_app => 'com.apple.product-type.application.watchapp2',
|
156
|
+
:watch2_app_container => 'com.apple.product-type.application.watchapp2-container',
|
157
|
+
:watch_extension => 'com.apple.product-type.watchkit-extension',
|
158
|
+
:watch2_extension => 'com.apple.product-type.watchkit2-extension',
|
159
|
+
:tv_extension => 'com.apple.product-type.tv-app-extension',
|
160
|
+
:messages_application => 'com.apple.product-type.application.messages',
|
161
|
+
:messages_extension => 'com.apple.product-type.app-extension.messages',
|
162
|
+
:sticker_pack => 'com.apple.product-type.app-extension.messages-sticker-pack',
|
163
|
+
:xpc_service => 'com.apple.product-type.xpc-service',
|
161
164
|
}.freeze
|
162
165
|
|
163
166
|
# @return [Hash] The extensions or the various product UTIs.
|
164
167
|
#
|
165
168
|
PRODUCT_UTI_EXTENSIONS = {
|
166
|
-
:application
|
167
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
:
|
180
|
-
:
|
169
|
+
:application => 'app',
|
170
|
+
:application_on_demand_install_capable => 'app',
|
171
|
+
:framework => 'framework',
|
172
|
+
:dynamic_library => 'dylib',
|
173
|
+
:static_library => 'a',
|
174
|
+
:bundle => 'bundle',
|
175
|
+
:octest_bundle => 'octest',
|
176
|
+
:unit_test_bundle => 'xctest',
|
177
|
+
:ui_test_bundle => 'xctest',
|
178
|
+
:app_extension => 'appex',
|
179
|
+
:messages_application => 'app',
|
180
|
+
:messages_extension => 'appex',
|
181
|
+
:sticker_pack => 'appex',
|
182
|
+
:watch2_extension => 'appex',
|
183
|
+
:watch2_app => 'app',
|
184
|
+
:watch2_app_container => 'app',
|
181
185
|
}.freeze
|
182
186
|
|
183
187
|
# @return [Hash] The common build settings grouped by platform, and build
|
@@ -6,6 +6,10 @@ module Xcodeproj
|
|
6
6
|
# {PBXProject} or a {PBXNativeTarget}.
|
7
7
|
#
|
8
8
|
class XCBuildConfiguration < AbstractObject
|
9
|
+
MUTUAL_RECURSION_SENTINEL = 'xcodeproj.mutual_recursion_sentinel'.freeze
|
10
|
+
|
11
|
+
private_constant :MUTUAL_RECURSION_SENTINEL
|
12
|
+
|
9
13
|
# @!group Attributes
|
10
14
|
|
11
15
|
# @return [String] the name of the Target.
|
@@ -79,16 +83,19 @@ module Xcodeproj
|
|
79
83
|
# the key of the build setting.
|
80
84
|
#
|
81
85
|
# @param [PBXNativeTarget] root_target
|
82
|
-
# use this to resolve complete recursion between project and targets
|
86
|
+
# use this to resolve complete recursion between project and targets.
|
87
|
+
#
|
88
|
+
# @param [String] previous_key
|
89
|
+
# use this to resolve complete recursion between different build settings.
|
83
90
|
#
|
84
91
|
# @return [String] The value of the build setting
|
85
92
|
#
|
86
|
-
def resolve_build_setting(key, root_target = nil)
|
93
|
+
def resolve_build_setting(key, root_target = nil, previous_key = nil)
|
87
94
|
setting = build_settings[key]
|
88
|
-
setting = resolve_variable_substitution(key, setting, root_target)
|
95
|
+
setting = resolve_variable_substitution(key, setting, root_target, previous_key)
|
89
96
|
|
90
97
|
config_setting = config[key]
|
91
|
-
config_setting = resolve_variable_substitution(key, config_setting, root_target)
|
98
|
+
config_setting = resolve_variable_substitution(key, config_setting, root_target, previous_key)
|
92
99
|
|
93
100
|
project_setting = project.build_configuration_list[name]
|
94
101
|
project_setting = nil if equal?(project_setting)
|
@@ -99,6 +106,12 @@ module Xcodeproj
|
|
99
106
|
'SRCROOT' => project.project_dir.to_s,
|
100
107
|
}
|
101
108
|
|
109
|
+
# if previous_key is nil, it means that we're back at the first call, so we can replace our sentinel string
|
110
|
+
# used to prevent recursion with nil
|
111
|
+
if previous_key.nil? && setting == MUTUAL_RECURSION_SENTINEL
|
112
|
+
setting = nil
|
113
|
+
end
|
114
|
+
|
102
115
|
[defaults[key], project_setting, config_setting, setting, ENV[key]].compact.reduce(nil) do |inherited, value|
|
103
116
|
expand_build_setting(value, inherited)
|
104
117
|
end
|
@@ -142,7 +155,7 @@ module Xcodeproj
|
|
142
155
|
build_setting_value.flat_map { |value| Constants::INHERITED_KEYWORDS.include?(value) ? inherited : value }
|
143
156
|
end
|
144
157
|
|
145
|
-
def resolve_variable_substitution(key, value, root_target)
|
158
|
+
def resolve_variable_substitution(key, value, root_target, previous_key = nil)
|
146
159
|
case value
|
147
160
|
when Array
|
148
161
|
return value.map { |v| resolve_variable_substitution(key, v, root_target) }
|
@@ -168,9 +181,20 @@ module Xcodeproj
|
|
168
181
|
when key
|
169
182
|
# to prevent infinite recursion
|
170
183
|
nil
|
184
|
+
when previous_key
|
185
|
+
# to prevent infinite recursion; we don't return nil as for the self recursion because it needs to be
|
186
|
+
# distinguished outside this method too
|
187
|
+
MUTUAL_RECURSION_SENTINEL
|
171
188
|
else
|
172
189
|
configuration_to_resolve_against = root_target ? root_target.build_configuration_list[name] : self
|
173
|
-
resolved_value_for_variable = configuration_to_resolve_against.resolve_build_setting(variable, root_target) || ''
|
190
|
+
resolved_value_for_variable = configuration_to_resolve_against.resolve_build_setting(variable, root_target, key) || ''
|
191
|
+
|
192
|
+
# we use this sentinel string instead of nil, because, otherwise, it would be swallowed by the default empty
|
193
|
+
# string from the preceding line, and we want to distinguish between mutual recursion and other cases
|
194
|
+
if resolved_value_for_variable == MUTUAL_RECURSION_SENTINEL
|
195
|
+
return MUTUAL_RECURSION_SENTINEL
|
196
|
+
end
|
197
|
+
|
174
198
|
value = value.gsub(variable_reference, resolved_value_for_variable)
|
175
199
|
resolve_variable_substitution(key, value, root_target)
|
176
200
|
end
|
@@ -191,14 +215,15 @@ module Xcodeproj
|
|
191
215
|
|
192
216
|
settings.keys.each do |key|
|
193
217
|
next unless value = settings[key]
|
218
|
+
stripped_key = key.sub(/\[[^\]]+\]$/, '')
|
194
219
|
case value
|
195
220
|
when String
|
196
|
-
next unless array_settings.include?(
|
221
|
+
next unless array_settings.include?(stripped_key)
|
197
222
|
array_value = split_build_setting_array_to_string(value)
|
198
223
|
next unless array_value.size > 1
|
199
224
|
settings[key] = array_value
|
200
225
|
when Array
|
201
|
-
next if value.size > 1 && array_settings.include?(
|
226
|
+
next if value.size > 1 && array_settings.include?(stripped_key)
|
202
227
|
settings[key] = value.join(' ')
|
203
228
|
end
|
204
229
|
end
|
@@ -52,7 +52,9 @@ module Xcodeproj
|
|
52
52
|
prefix = 'lib'
|
53
53
|
end
|
54
54
|
extension = Constants::PRODUCT_UTI_EXTENSIONS[product_type]
|
55
|
-
|
55
|
+
path = "#{prefix}#{target_name}"
|
56
|
+
path += ".#{extension}" if extension
|
57
|
+
ref = new_reference(group, path, :built_products)
|
56
58
|
ref.include_in_index = '0'
|
57
59
|
ref.set_explicit_file_type
|
58
60
|
ref
|
@@ -148,7 +148,7 @@ module Xcodeproj
|
|
148
148
|
when '<group>'
|
149
149
|
object_parent = parent(object)
|
150
150
|
if object_parent.isa == 'PBXProject'.freeze
|
151
|
-
object.project.project_dir
|
151
|
+
object.project.project_dir + object.project.root_object.project_dir_path
|
152
152
|
else
|
153
153
|
real_path(object_parent)
|
154
154
|
end
|
@@ -59,6 +59,20 @@ module Xcodeproj
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
# @param [Array<BuildAction::Entry>] entries
|
63
|
+
# Sets the list of BuildActionEntry nodes associated with this Build Action.
|
64
|
+
#
|
65
|
+
def entries=(entries)
|
66
|
+
@xml_element.delete_element('BuildActionEntries')
|
67
|
+
unless entries.empty?
|
68
|
+
entries_element = @xml_element.add_element('BuildActionEntries')
|
69
|
+
entries.each do |entry_node|
|
70
|
+
entries_element.add_element(entry_node.xml_element)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
entries
|
74
|
+
end
|
75
|
+
|
62
76
|
# @param [BuildAction::Entry] entry
|
63
77
|
# The BuildActionEntry to add to the list of targets to build for the various actions
|
64
78
|
#
|
@@ -185,6 +199,13 @@ module Xcodeproj
|
|
185
199
|
def add_buildable_reference(ref)
|
186
200
|
@xml_element.add_element(ref.xml_element)
|
187
201
|
end
|
202
|
+
|
203
|
+
# @param [BuildableReference] ref
|
204
|
+
# The BuildableReference to remove from the list of targets this entry will build
|
205
|
+
#
|
206
|
+
def remove_buildable_reference(ref)
|
207
|
+
@xml_element.delete_element(ref.xml_element)
|
208
|
+
end
|
188
209
|
end
|
189
210
|
end
|
190
211
|
end
|
@@ -143,6 +143,22 @@ module Xcodeproj
|
|
143
143
|
@xml_element.add_element(arguments.xml_element) if arguments
|
144
144
|
arguments
|
145
145
|
end
|
146
|
+
|
147
|
+
# @return [Array<MacroExpansion>]
|
148
|
+
# The list of MacroExpansion bound with this LaunchAction
|
149
|
+
#
|
150
|
+
def macro_expansions
|
151
|
+
@xml_element.get_elements('MacroExpansion').map do |node|
|
152
|
+
MacroExpansion.new(node)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# @param [MacroExpansion] macro_expansion
|
157
|
+
# Add a MacroExpansion to this LaunchAction
|
158
|
+
#
|
159
|
+
def add_macro_expansion(macro_expansion)
|
160
|
+
@xml_element.add_element(macro_expansion.xml_element)
|
161
|
+
end
|
146
162
|
end
|
147
163
|
end
|
148
164
|
end
|
@@ -76,6 +76,18 @@ module Xcodeproj
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
# @param [Array<TestableReference>] testables
|
80
|
+
# Sets the list of TestableReference (test bundles) associated with this Test Action
|
81
|
+
#
|
82
|
+
def testables=(testables)
|
83
|
+
@xml_element.delete_element('Testables')
|
84
|
+
testables_element = @xml_element.add_element('Testables')
|
85
|
+
testables.each do |testable|
|
86
|
+
testables_element.add_element(testable.xml_element)
|
87
|
+
end
|
88
|
+
testables
|
89
|
+
end
|
90
|
+
|
79
91
|
# @param [TestableReference] testable
|
80
92
|
# Add a TestableReference (test bundle) to this Test Action
|
81
93
|
#
|
@@ -219,6 +231,13 @@ module Xcodeproj
|
|
219
231
|
@xml_element.add_element(ref.xml_element)
|
220
232
|
end
|
221
233
|
|
234
|
+
# @param [BuildableReference] ref
|
235
|
+
# The BuildableReference to remove from the list of targets this entry will build
|
236
|
+
#
|
237
|
+
def remove_buildable_reference(ref)
|
238
|
+
@xml_element.delete_element(ref.xml_element)
|
239
|
+
end
|
240
|
+
|
222
241
|
# @return [Array<Test>]
|
223
242
|
# The list of SkippedTest this action will skip.
|
224
243
|
#
|
data/lib/xcodeproj/workspace.rb
CHANGED
@@ -107,8 +107,9 @@ module Xcodeproj
|
|
107
107
|
else
|
108
108
|
raise ArgumentError, "Input to the << operator must be a file path or FileReference, got #{path_or_reference.inspect}"
|
109
109
|
end
|
110
|
-
|
111
|
-
|
110
|
+
unless file_references.any? { |ref| project_file_reference.eql? ref }
|
111
|
+
@document.root.add_element(project_file_reference.to_node)
|
112
|
+
end
|
112
113
|
load_schemes_from_project File.expand_path(projpath || project_file_reference.path)
|
113
114
|
end
|
114
115
|
|
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.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atomos
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0.
|
87
|
+
version: 0.3.0
|
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.
|
94
|
+
version: 0.3.0
|
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).
|
@@ -168,7 +168,7 @@ homepage: https://github.com/cocoapods/xcodeproj
|
|
168
168
|
licenses:
|
169
169
|
- MIT
|
170
170
|
metadata: {}
|
171
|
-
post_install_message:
|
171
|
+
post_install_message:
|
172
172
|
rdoc_options: []
|
173
173
|
require_paths:
|
174
174
|
- lib
|
@@ -183,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
|
-
rubygems_version: 3.0.
|
187
|
-
signing_key:
|
186
|
+
rubygems_version: 3.0.3
|
187
|
+
signing_key:
|
188
188
|
specification_version: 3
|
189
189
|
summary: Create and modify Xcode projects from Ruby.
|
190
190
|
test_files: []
|