cocoapods 1.0.0.beta.3 → 1.0.0.beta.4
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 +4 -4
- data/CHANGELOG.md +41 -1
- data/lib/cocoapods/command/repo/lint.rb +12 -8
- data/lib/cocoapods/executable.rb +1 -1
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/copy_resources_script.rb +17 -17
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +6 -10
- data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +6 -13
- data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +65 -0
- data/lib/cocoapods/installer.rb +8 -35
- data/lib/cocoapods/installer/analyzer.rb +67 -61
- data/lib/cocoapods/installer/analyzer/analysis_result.rb +2 -2
- data/lib/cocoapods/installer/analyzer/pod_variant.rb +59 -0
- data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +153 -0
- data/lib/cocoapods/installer/pod_source_preparer.rb +9 -4
- data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +1 -1
- data/lib/cocoapods/installer/user_project_integrator.rb +1 -1
- data/lib/cocoapods/target/aggregate_target.rb +1 -7
- data/lib/cocoapods/target/pod_target.rb +41 -20
- data/lib/cocoapods/user_interface/error_report.rb +21 -10
- data/lib/cocoapods/validator.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a45e8f74520fb565c87e9868bddd55dc0fb6131
|
4
|
+
data.tar.gz: 4f454b54f7246fe6b0b7eb3d4e46f83bf4aa8a88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 284712afd5fcad4ab68829aa9976f8c2ef64c54a3554b93c69a637807187aa56c2ce050b62219529b7db976bad9a087e415d14227c337777103bacd63074fce7
|
7
|
+
data.tar.gz: edc7840b2eb983949a1d45fb2688b8eb9175d070ea6f840f944ace9238024823fb75154b64e6272c12af610d74d56d99d30f0ba3c2ebe291ba4e9fb2e0a40e43
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,49 @@
|
|
1
|
-
|
1
|
+
# Installation & Update
|
2
2
|
|
3
3
|
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
|
4
4
|
|
5
5
|
To install release candidates run `[sudo] gem install cocoapods --pre`
|
6
6
|
|
7
|
+
## 1.0.0.beta.4 (2016-02-24)
|
8
|
+
|
9
|
+
##### Enhancements
|
10
|
+
|
11
|
+
* Allow deduplication to take effect even when the same pod is used with
|
12
|
+
different sets of subspecs across different platforms.
|
13
|
+
This changes the general naming scheme scoped pod targets. They are
|
14
|
+
suffixed now on base of what makes them different among others for the
|
15
|
+
same root spec instead of being prefixed by the dependent target.
|
16
|
+
[Marius Rackwitz](https://github.com/mrackwitz)
|
17
|
+
[#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
|
18
|
+
|
19
|
+
* Pass `COCOAPODS_VERSION` as environment variable when invoking the
|
20
|
+
`prepare_command`.
|
21
|
+
[Marius Rackwitz](https://github.com/mrackwitz)
|
22
|
+
[#4933](https://github.com/CocoaPods/CocoaPods/pull/4933)
|
23
|
+
|
24
|
+
##### Bug Fixes
|
25
|
+
|
26
|
+
* Pods are built by default in another scoping level of the build products
|
27
|
+
directory identified by their name to prevent name clashes among
|
28
|
+
dependencies.
|
29
|
+
[Marius Rackwitz](https://github.com/mrackwitz)
|
30
|
+
[#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
|
31
|
+
|
32
|
+
* Fix mixed integrations where static libraries are used along frameworks
|
33
|
+
from different target definitions in one Podfile.
|
34
|
+
[Marius Rackwitz](https://github.com/mrackwitz)
|
35
|
+
[#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
|
36
|
+
|
37
|
+
* Pass target device arguments to `ibtool` in the copy resources script, fixing
|
38
|
+
compilation of storyboards when targeting versions of iOS prior to iOS 8.
|
39
|
+
[seaders](https://github.com/seaders)
|
40
|
+
[#4913](https://github.com/CocoaPods/CocoaPods/issues/4913)
|
41
|
+
|
42
|
+
* Fix `pod repo lint` when passed a path argument.
|
43
|
+
[Boris Bügling](https://github.com/neonichu)
|
44
|
+
[#4883](https://github.com/CocoaPods/CocoaPods/issues/4883)
|
45
|
+
|
46
|
+
|
7
47
|
## 1.0.0.beta.3 (2016-02-03)
|
8
48
|
|
9
49
|
##### Breaking
|
@@ -34,17 +34,21 @@ module Pod
|
|
34
34
|
# @todo add UI.print and enable print statements again.
|
35
35
|
#
|
36
36
|
def run
|
37
|
-
if @name
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
sources = if @name
|
38
|
+
if File.exist?(@name)
|
39
|
+
[Pathname.new(@name)]
|
40
|
+
else
|
41
|
+
SourcesManager.sources([@name]).map(&:repo)
|
42
|
+
end
|
43
|
+
else
|
44
|
+
SourcesManager.aggregate.sources.map(&:repo)
|
45
|
+
end
|
42
46
|
|
43
47
|
sources.each do |source|
|
44
|
-
SourcesManager.check_version_information(source
|
45
|
-
UI.puts "\nLinting spec repo `#{source.
|
48
|
+
SourcesManager.check_version_information(source)
|
49
|
+
UI.puts "\nLinting spec repo `#{source.basename}`\n".yellow
|
46
50
|
|
47
|
-
validator = Source::HealthReporter.new(source
|
51
|
+
validator = Source::HealthReporter.new(source)
|
48
52
|
validator.pre_check do |_name, _version|
|
49
53
|
UI.print '.'
|
50
54
|
end
|
data/lib/cocoapods/executable.rb
CHANGED
@@ -106,6 +106,21 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
|
106
106
|
|
107
107
|
XCASSET_FILES=()
|
108
108
|
|
109
|
+
case "${TARGETED_DEVICE_FAMILY}" in
|
110
|
+
1,2)
|
111
|
+
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
112
|
+
;;
|
113
|
+
1)
|
114
|
+
TARGET_DEVICE_ARGS="--target-device iphone"
|
115
|
+
;;
|
116
|
+
2)
|
117
|
+
TARGET_DEVICE_ARGS="--target-device ipad"
|
118
|
+
;;
|
119
|
+
*)
|
120
|
+
TARGET_DEVICE_ARGS="--target-device mac"
|
121
|
+
;;
|
122
|
+
esac
|
123
|
+
|
109
124
|
realpath() {
|
110
125
|
DIRECTORY="$(cd "${1%/*}" && pwd)"
|
111
126
|
FILENAME="${1##*/}"
|
@@ -127,8 +142,8 @@ EOM
|
|
127
142
|
fi
|
128
143
|
case $RESOURCE_PATH in
|
129
144
|
*\.storyboard)
|
130
|
-
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}"
|
131
|
-
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}"
|
145
|
+
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
146
|
+
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
132
147
|
;;
|
133
148
|
*\.xib)
|
134
149
|
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
|
@@ -179,21 +194,6 @@ EOS
|
|
179
194
|
|
180
195
|
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
181
196
|
then
|
182
|
-
case "${TARGETED_DEVICE_FAMILY}" in
|
183
|
-
1,2)
|
184
|
-
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
185
|
-
;;
|
186
|
-
1)
|
187
|
-
TARGET_DEVICE_ARGS="--target-device iphone"
|
188
|
-
;;
|
189
|
-
2)
|
190
|
-
TARGET_DEVICE_ARGS="--target-device ipad"
|
191
|
-
;;
|
192
|
-
*)
|
193
|
-
TARGET_DEVICE_ARGS="--target-device mac"
|
194
|
-
;;
|
195
|
-
esac
|
196
|
-
|
197
197
|
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
198
198
|
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
199
199
|
while read line; do
|
@@ -59,6 +59,7 @@ module Pod
|
|
59
59
|
'PODS_ROOT' => target.relative_pods_root,
|
60
60
|
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
|
61
61
|
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
|
62
|
+
'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
|
62
63
|
}
|
63
64
|
if pod_targets.any?(&:uses_swift?)
|
64
65
|
config['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'YES'
|
@@ -94,15 +95,11 @@ module Pod
|
|
94
95
|
#
|
95
96
|
def settings_to_import_pod_targets
|
96
97
|
if target.requires_frameworks?
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
else
|
101
|
-
"$CONFIGURATION_BUILD_DIR/#{target.product_name}/Headers"
|
102
|
-
end
|
98
|
+
build_pod_targets = pod_targets.select(&:should_build?)
|
99
|
+
framework_header_search_paths = build_pod_targets.map do |target|
|
100
|
+
"#{target.build_product_path}/Headers"
|
103
101
|
end
|
104
102
|
build_settings = {
|
105
|
-
'PODS_FRAMEWORK_BUILD_PATH' => XCConfigHelper.quote([target.scoped_configuration_build_dir]),
|
106
103
|
# Make framework headers discoverable by `import "…"`
|
107
104
|
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(framework_header_search_paths, '-iquote'),
|
108
105
|
}
|
@@ -112,9 +109,6 @@ module Pod
|
|
112
109
|
build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ' + XCConfigHelper.quote(library_header_search_paths)
|
113
110
|
build_settings['OTHER_CFLAGS'] += ' ' + XCConfigHelper.quote(library_header_search_paths, '-isystem')
|
114
111
|
end
|
115
|
-
if pod_targets.any? { |t| t.should_build? && t.scoped? }
|
116
|
-
build_settings['FRAMEWORK_SEARCH_PATHS'] = '$PODS_FRAMEWORK_BUILD_PATH'
|
117
|
-
end
|
118
112
|
build_settings
|
119
113
|
else
|
120
114
|
# Make headers discoverable from $PODS_ROOT/Headers directory
|
@@ -137,9 +131,11 @@ module Pod
|
|
137
131
|
# - `@import …;` / `import …`
|
138
132
|
#
|
139
133
|
def generate_settings_to_import_pod_targets
|
134
|
+
@xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, pod_targets)
|
140
135
|
@xcconfig.merge!(settings_to_import_pod_targets)
|
141
136
|
target.search_paths_aggregate_targets.each do |search_paths_target|
|
142
137
|
generator = AggregateXCConfig.new(search_paths_target, configuration_name)
|
138
|
+
@xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(nil, search_paths_target.pod_targets)
|
143
139
|
@xcconfig.merge!(generator.settings_to_import_pod_targets)
|
144
140
|
end
|
145
141
|
end
|
@@ -45,32 +45,25 @@ module Pod
|
|
45
45
|
search_paths = target_search_paths.concat(sandbox_search_paths).uniq
|
46
46
|
|
47
47
|
config = {
|
48
|
+
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
|
49
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
|
50
|
+
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
|
51
|
+
'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
|
48
52
|
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
|
49
53
|
'PODS_ROOT' => '${SRCROOT}',
|
50
|
-
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
|
51
|
-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
|
52
|
-
'SKIP_INSTALL' => 'YES',
|
53
|
-
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
|
54
54
|
'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
|
55
|
+
'SKIP_INSTALL' => 'YES',
|
55
56
|
# 'USE_HEADERMAP' => 'NO'
|
56
57
|
}
|
57
58
|
|
58
59
|
@xcconfig = Xcodeproj::Config.new(config)
|
59
60
|
|
60
|
-
if target.requires_frameworks? && target.scoped?
|
61
|
-
build_settings = {
|
62
|
-
'PODS_FRAMEWORK_BUILD_PATH' => XCConfigHelper.quote([target.configuration_build_dir]),
|
63
|
-
'FRAMEWORK_SEARCH_PATHS' => '$PODS_FRAMEWORK_BUILD_PATH',
|
64
|
-
'CONFIGURATION_BUILD_DIR' => '$PODS_FRAMEWORK_BUILD_PATH',
|
65
|
-
}
|
66
|
-
@xcconfig.merge!(build_settings)
|
67
|
-
end
|
68
|
-
|
69
61
|
XCConfigHelper.add_settings_for_file_accessors_of_target(target, @xcconfig)
|
70
62
|
target.file_accessors.each do |file_accessor|
|
71
63
|
@xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig)
|
72
64
|
end
|
73
65
|
XCConfigHelper.add_target_specific_settings(target, @xcconfig)
|
66
|
+
@xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, target.dependent_targets)
|
74
67
|
@xcconfig
|
75
68
|
end
|
76
69
|
|
@@ -4,6 +4,13 @@ module Pod
|
|
4
4
|
# Stores the shared logic of the classes of the XCConfig module.
|
5
5
|
#
|
6
6
|
module XCConfigHelper
|
7
|
+
# @return [String] Defined to hold the default Xcode build path, so
|
8
|
+
# that when this is overridden per {PodTarget}, it is still
|
9
|
+
# possible to reference other build products relative to the
|
10
|
+
# original path.
|
11
|
+
#
|
12
|
+
SHARED_BUILD_DIR_VARIABLE = 'PODS_SHARED_BUILD_DIR'.freeze
|
13
|
+
|
7
14
|
# Converts an array of strings to a single string where the each string
|
8
15
|
# is surrounded by double quotes and separated by a space. Used to
|
9
16
|
# represent strings in a xcconfig file.
|
@@ -49,6 +56,8 @@ module Pod
|
|
49
56
|
# @param [Xcodeproj::Config] xcconfig
|
50
57
|
# The xcconfig to edit.
|
51
58
|
#
|
59
|
+
# @return [void]
|
60
|
+
#
|
52
61
|
def self.add_settings_for_file_accessors_of_target(target, xcconfig)
|
53
62
|
target.file_accessors.each do |file_accessor|
|
54
63
|
XCConfigHelper.add_spec_build_settings_to_xcconfig(file_accessor.spec_consumer, xcconfig)
|
@@ -73,6 +82,8 @@ module Pod
|
|
73
82
|
# @param [Spec::FileAccessor] file_accessor
|
74
83
|
# The file accessor, which holds the list of static frameworks.
|
75
84
|
#
|
85
|
+
# @return [void]
|
86
|
+
#
|
76
87
|
def self.add_static_dependency_build_settings(target, xcconfig, file_accessor)
|
77
88
|
file_accessor.vendored_static_frameworks.each do |vendored_static_framework|
|
78
89
|
XCConfigHelper.add_framework_build_settings(vendored_static_framework, xcconfig, target.sandbox.root)
|
@@ -90,6 +101,8 @@ module Pod
|
|
90
101
|
# @param [Xcodeproj::Config] xcconfig
|
91
102
|
# The xcconfig to edit.
|
92
103
|
#
|
104
|
+
# @return [void]
|
105
|
+
#
|
93
106
|
def self.add_dynamic_dependency_build_settings(target, xcconfig)
|
94
107
|
target.file_accessors.each do |file_accessor|
|
95
108
|
file_accessor.vendored_dynamic_frameworks.each do |vendored_dynamic_framework|
|
@@ -110,6 +123,8 @@ module Pod
|
|
110
123
|
# @param [Xcodeproj::Config] xcconfig
|
111
124
|
# The xcconfig to edit.
|
112
125
|
#
|
126
|
+
# @return [void]
|
127
|
+
#
|
113
128
|
def self.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
|
114
129
|
xcconfig.libraries.merge(consumer.libraries)
|
115
130
|
xcconfig.frameworks.merge(consumer.frameworks)
|
@@ -129,6 +144,8 @@ module Pod
|
|
129
144
|
# @param [Pathname] sandbox_root
|
130
145
|
# The path retrieved from Sandbox#root.
|
131
146
|
#
|
147
|
+
# @return [void]
|
148
|
+
#
|
132
149
|
def self.add_framework_build_settings(framework_path, xcconfig, sandbox_root)
|
133
150
|
name = File.basename(framework_path, '.framework')
|
134
151
|
dirname = '${PODS_ROOT}/' + framework_path.dirname.relative_path_from(sandbox_root).to_s
|
@@ -151,6 +168,8 @@ module Pod
|
|
151
168
|
# @param [Pathname] sandbox_root
|
152
169
|
# The path retrieved from Sandbox#root.
|
153
170
|
#
|
171
|
+
# @return [void]
|
172
|
+
#
|
154
173
|
def self.add_library_build_settings(library_path, xcconfig, sandbox_root)
|
155
174
|
extension = File.extname(library_path)
|
156
175
|
name = File.basename(library_path, extension).sub(/\Alib/, '')
|
@@ -172,6 +191,8 @@ module Pod
|
|
172
191
|
# @param [Xcodeproj::Config] xcconfig
|
173
192
|
# The xcconfig to edit.
|
174
193
|
#
|
194
|
+
# @return [void]
|
195
|
+
#
|
175
196
|
def self.add_code_signing_settings(target, xcconfig)
|
176
197
|
build_settings = {}
|
177
198
|
if target.platform.to_sym == :osx
|
@@ -189,6 +210,8 @@ module Pod
|
|
189
210
|
# @param [Xcodeproj::Config] xcconfig
|
190
211
|
# The xcconfig to edit.
|
191
212
|
#
|
213
|
+
# @return [void]
|
214
|
+
#
|
192
215
|
def self.add_target_specific_settings(target, xcconfig)
|
193
216
|
if target.requires_frameworks?
|
194
217
|
add_code_signing_settings(target, xcconfig)
|
@@ -196,6 +219,46 @@ module Pod
|
|
196
219
|
add_language_specific_settings(target, xcconfig)
|
197
220
|
end
|
198
221
|
|
222
|
+
# Returns the search paths for frameworks and libraries the given target
|
223
|
+
# depends on, so that it can be correctly built and linked.
|
224
|
+
#
|
225
|
+
# @param [Target] target
|
226
|
+
# The target.
|
227
|
+
#
|
228
|
+
# @param [Array<PodTarget>] dependent_targets
|
229
|
+
# The pod targets the given target depends on.
|
230
|
+
#
|
231
|
+
# @return [Hash<String, String>] the settings
|
232
|
+
#
|
233
|
+
def self.settings_for_dependent_targets(target, dependent_targets)
|
234
|
+
dependent_targets = dependent_targets.select(&:should_build?)
|
235
|
+
has_configuration_build_dir = target.respond_to?(:configuration_build_dir)
|
236
|
+
if has_configuration_build_dir
|
237
|
+
build_dir_var = "$#{SHARED_BUILD_DIR_VARIABLE}"
|
238
|
+
build_settings = {
|
239
|
+
'CONFIGURATION_BUILD_DIR' => target.configuration_build_dir(build_dir_var),
|
240
|
+
SHARED_BUILD_DIR_VARIABLE => '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)',
|
241
|
+
}
|
242
|
+
else
|
243
|
+
build_dir_var = '$CONFIGURATION_BUILD_DIR'
|
244
|
+
build_settings = {}
|
245
|
+
end
|
246
|
+
unless dependent_targets.empty?
|
247
|
+
framework_search_paths = []
|
248
|
+
library_search_paths = []
|
249
|
+
dependent_targets.each do |dependent_target|
|
250
|
+
if dependent_target.requires_frameworks?
|
251
|
+
framework_search_paths << dependent_target.configuration_build_dir(build_dir_var)
|
252
|
+
else
|
253
|
+
library_search_paths << dependent_target.configuration_build_dir(build_dir_var)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
build_settings['FRAMEWORK_SEARCH_PATHS'] = XCConfigHelper.quote(framework_search_paths.uniq)
|
257
|
+
build_settings['LIBRARY_SEARCH_PATHS'] = XCConfigHelper.quote(library_search_paths.uniq)
|
258
|
+
end
|
259
|
+
build_settings
|
260
|
+
end
|
261
|
+
|
199
262
|
# Checks if the given target requires language specific settings and
|
200
263
|
# configures the given Xcconfig.
|
201
264
|
#
|
@@ -205,6 +268,8 @@ module Pod
|
|
205
268
|
# @param [Xcodeproj::Config] xcconfig
|
206
269
|
# The xcconfig to edit.
|
207
270
|
#
|
271
|
+
# @return [void]
|
272
|
+
#
|
208
273
|
def self.add_language_specific_settings(target, xcconfig)
|
209
274
|
if target.uses_swift?
|
210
275
|
build_settings = {
|
data/lib/cocoapods/installer.rb
CHANGED
@@ -108,7 +108,6 @@ module Pod
|
|
108
108
|
prepare
|
109
109
|
resolve_dependencies
|
110
110
|
download_dependencies
|
111
|
-
determine_dependency_product_types
|
112
111
|
verify_no_duplicate_framework_names
|
113
112
|
verify_no_static_framework_transitive_dependencies
|
114
113
|
verify_framework_usage
|
@@ -376,22 +375,6 @@ module Pod
|
|
376
375
|
end
|
377
376
|
end
|
378
377
|
|
379
|
-
# Determines if the dependencies need to be built as dynamic frameworks or
|
380
|
-
# if they can be built as static libraries by checking for the Swift source
|
381
|
-
# presence. Therefore it is important that the file accessors of the
|
382
|
-
# #pod_targets are created.
|
383
|
-
#
|
384
|
-
# @return [void]
|
385
|
-
#
|
386
|
-
def determine_dependency_product_types
|
387
|
-
aggregate_targets.each do |aggregate_target|
|
388
|
-
aggregate_target.pod_targets.each do |pod_target|
|
389
|
-
pod_target.host_requires_frameworks ||= aggregate_target.requires_frameworks?
|
390
|
-
pod_target.platform = nil # needs to be recomputed
|
391
|
-
end
|
392
|
-
end
|
393
|
-
end
|
394
|
-
|
395
378
|
def verify_no_duplicate_framework_names
|
396
379
|
aggregate_targets.each do |aggregate_target|
|
397
380
|
aggregate_target.user_build_configurations.keys.each do |config|
|
@@ -629,13 +612,11 @@ module Pod
|
|
629
612
|
def install_libraries
|
630
613
|
UI.message '- Installing targets' do
|
631
614
|
pod_targets.sort_by(&:name).each do |pod_target|
|
632
|
-
next if pod_target.target_definitions.all?(&:abstract?)
|
633
615
|
target_installer = PodTargetInstaller.new(sandbox, pod_target)
|
634
616
|
target_installer.install!
|
635
617
|
end
|
636
618
|
|
637
619
|
aggregate_targets.sort_by(&:name).each do |target|
|
638
|
-
next if target.target_definition.abstract?
|
639
620
|
target_installer = AggregateTargetInstaller.new(sandbox, target)
|
640
621
|
target_installer.install!
|
641
622
|
end
|
@@ -679,23 +660,15 @@ module Pod
|
|
679
660
|
aggregate_target.native_target.add_dependency(pod_target.native_target)
|
680
661
|
configure_app_extension_api_only_for_target(pod_target) if is_app_extension
|
681
662
|
|
682
|
-
pod_target.
|
683
|
-
unless
|
684
|
-
|
685
|
-
|
686
|
-
unless pod_dependency_target
|
687
|
-
puts "[BUG] DEP: #{dep}"
|
688
|
-
end
|
689
|
-
|
690
|
-
next unless pod_dependency_target.should_build?
|
691
|
-
pod_target.native_target.add_dependency(pod_dependency_target.native_target)
|
692
|
-
configure_app_extension_api_only_for_target(pod_dependency_target) if is_app_extension
|
663
|
+
pod_target.dependent_targets.each do |pod_dependency_target|
|
664
|
+
next unless pod_dependency_target.should_build?
|
665
|
+
pod_target.native_target.add_dependency(pod_dependency_target.native_target)
|
666
|
+
configure_app_extension_api_only_for_target(pod_dependency_target) if is_app_extension
|
693
667
|
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
end
|
668
|
+
if pod_target.requires_frameworks?
|
669
|
+
product_ref = frameworks_group.files.find { |f| f.path == pod_dependency_target.product_name } ||
|
670
|
+
frameworks_group.new_product_ref_for_target(pod_dependency_target.product_basename, pod_dependency_target.product_type)
|
671
|
+
pod_target.native_target.frameworks_build_phase.add_file_reference(product_ref, true)
|
699
672
|
end
|
700
673
|
end
|
701
674
|
end
|
@@ -13,6 +13,8 @@ module Pod
|
|
13
13
|
autoload :SandboxAnalyzer, 'cocoapods/installer/analyzer/sandbox_analyzer'
|
14
14
|
autoload :SpecsState, 'cocoapods/installer/analyzer/specs_state'
|
15
15
|
autoload :LockingDependencyAnalyzer, 'cocoapods/installer/analyzer/locking_dependency_analyzer'
|
16
|
+
autoload :PodVariant, 'cocoapods/installer/analyzer/pod_variant'
|
17
|
+
autoload :PodVariantSet, 'cocoapods/installer/analyzer/pod_variant_set'
|
16
18
|
autoload :TargetInspectionResult, 'cocoapods/installer/analyzer/target_inspection_result'
|
17
19
|
autoload :TargetInspector, 'cocoapods/installer/analyzer/target_inspector'
|
18
20
|
|
@@ -228,8 +230,9 @@ module Pod
|
|
228
230
|
# @return [Array<AggregateTarget>]
|
229
231
|
#
|
230
232
|
def generate_targets
|
231
|
-
|
232
|
-
|
233
|
+
specs_by_target = result.specs_by_target.reject { |td, _| td.abstract? }
|
234
|
+
pod_targets = generate_pod_targets(specs_by_target)
|
235
|
+
aggregate_targets = specs_by_target.keys.map do |target_definition|
|
233
236
|
generate_target(target_definition, pod_targets)
|
234
237
|
end
|
235
238
|
aggregate_targets.each do |target|
|
@@ -286,85 +289,84 @@ module Pod
|
|
286
289
|
# @return [Array<PodTarget>]
|
287
290
|
#
|
288
291
|
def generate_pod_targets(specs_by_target)
|
289
|
-
dedupe_cache = {}
|
290
292
|
if installation_options.deduplicate_targets?
|
291
|
-
|
292
|
-
dependent_specs
|
293
|
-
|
293
|
+
distinct_targets = specs_by_target.each_with_object({}) do |dependency, hash|
|
294
|
+
target_definition, dependent_specs = *dependency
|
295
|
+
dependent_specs.group_by(&:root).each do |root_spec, specs|
|
296
|
+
pod_variant = PodVariant.new(specs, target_definition.platform, target_definition.uses_frameworks?)
|
297
|
+
hash[root_spec] ||= {}
|
298
|
+
(hash[root_spec][pod_variant] ||= []) << target_definition
|
294
299
|
end
|
295
300
|
end
|
296
301
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
end
|
302
|
-
|
303
|
-
pod_targets = distinct_targets.flat_map do |_, targets_by_distinctors|
|
304
|
-
if targets_by_distinctors.count > 1
|
305
|
-
# There are different sets of subspecs or the spec is used across different platforms
|
306
|
-
targets_by_distinctors.flat_map do |distinctor, target_definitions|
|
307
|
-
specs, = *distinctor
|
308
|
-
generate_pod_target(target_definitions, specs).scoped(dedupe_cache)
|
309
|
-
end
|
310
|
-
else
|
311
|
-
(specs, _), target_definitions = targets_by_distinctors.first
|
312
|
-
generate_pod_target(target_definitions, specs)
|
302
|
+
pod_targets = distinct_targets.flat_map do |_root, target_definitions_by_variant|
|
303
|
+
suffixes = PodVariantSet.new(target_definitions_by_variant.keys).scope_suffixes
|
304
|
+
target_definitions_by_variant.flat_map do |variant, target_definitions|
|
305
|
+
generate_pod_target(target_definitions, variant.specs, :scope_suffix => suffixes[variant])
|
313
306
|
end
|
314
307
|
end
|
315
308
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
309
|
+
all_specs = specs_by_target.values.flatten.uniq
|
310
|
+
pod_targets_by_name = pod_targets.group_by(&:pod_name).each_with_object({}) do |(name, values), hash|
|
311
|
+
# Sort the target by the number of activated subspecs, so that
|
312
|
+
# we prefer a minimal target as transitive dependency.
|
313
|
+
hash[name] = values.sort_by { |pt| pt.specs.count }
|
314
|
+
end
|
315
|
+
pod_targets.each do |target|
|
316
|
+
dependencies = transitive_dependencies_for_specs(target.specs, target.platform, all_specs).group_by(&:root)
|
317
|
+
target.dependent_targets = dependencies.map do |root_spec, deps|
|
318
|
+
pod_targets_by_name[root_spec.name].find do |t|
|
319
|
+
next false if t.platform.symbolic_name != target.platform.symbolic_name ||
|
320
|
+
t.requires_frameworks? != target.requires_frameworks?
|
321
|
+
spec_names = t.specs.map(&:name)
|
322
|
+
deps.all? { |dep| spec_names.include?(dep.name) }
|
323
|
+
end
|
325
324
|
end
|
326
325
|
end
|
327
326
|
else
|
328
|
-
|
329
|
-
|
330
|
-
grouped_specs
|
327
|
+
dedupe_cache = {}
|
328
|
+
specs_by_target.flat_map do |target_definition, specs|
|
329
|
+
grouped_specs = specs.group_by(&:root).values.uniq
|
330
|
+
pod_targets = grouped_specs.flat_map do |pod_specs|
|
331
331
|
generate_pod_target([target_definition], pod_specs).scoped(dedupe_cache)
|
332
332
|
end
|
333
|
-
|
334
|
-
|
335
|
-
|
333
|
+
|
334
|
+
pod_targets.each do |target|
|
335
|
+
dependencies = transitive_dependencies_for_specs(target.specs, target.platform, specs).group_by(&:root)
|
336
|
+
target.dependent_targets = pod_targets.reject { |t| dependencies[t.root_spec].nil? }
|
337
|
+
end
|
336
338
|
end
|
337
339
|
end
|
338
340
|
end
|
339
341
|
|
340
|
-
#
|
341
|
-
# depends.
|
342
|
+
# Returns the specs upon which the given specs _transitively_ depend.
|
342
343
|
#
|
343
344
|
# @note: This is implemented in the analyzer, because we don't have to
|
344
345
|
# care about the requirements after dependency resolution.
|
345
346
|
#
|
346
|
-
# @param [
|
347
|
-
# The
|
347
|
+
# @param [Array<Specification>] specs
|
348
|
+
# The specs, whose dependencies should be returned.
|
348
349
|
#
|
349
|
-
# @param [
|
350
|
-
#
|
350
|
+
# @param [Platform] platform
|
351
|
+
# The platform for which the dependencies should be returned.
|
351
352
|
#
|
352
|
-
# @
|
353
|
+
# @param [Array<Specification>] all_specs
|
354
|
+
# All specifications which are installed alongside.
|
353
355
|
#
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
356
|
+
# @return [Array<Specification>]
|
357
|
+
#
|
358
|
+
def transitive_dependencies_for_specs(specs, platform, all_specs)
|
359
|
+
return [] if specs.empty? || all_specs.empty?
|
360
|
+
dependent_specs = specs.flat_map do |spec|
|
361
|
+
spec.consumer(platform).dependencies.flat_map do |dependency|
|
362
|
+
all_specs.find do |s|
|
363
|
+
next false if specs.include?(s)
|
364
|
+
s.name == dependency.name
|
365
|
+
end
|
366
|
+
end.compact
|
367
|
+
end.uniq
|
368
|
+
remaining_specs = all_specs - dependent_specs
|
369
|
+
dependent_specs + transitive_dependencies_for_specs(dependent_specs, platform, remaining_specs)
|
368
370
|
end
|
369
371
|
|
370
372
|
# Create a target for each spec group
|
@@ -372,13 +374,17 @@ module Pod
|
|
372
374
|
# @param [TargetDefinitions] target_definitions
|
373
375
|
# the aggregate target
|
374
376
|
#
|
375
|
-
# @param [Array<Specification>]
|
377
|
+
# @param [Array<Specification>] pod_specs
|
376
378
|
# the specifications of an equal root.
|
377
379
|
#
|
380
|
+
# @param [String] scope_suffix
|
381
|
+
# @see PodTarget#scope_suffix
|
382
|
+
#
|
378
383
|
# @return [PodTarget]
|
379
384
|
#
|
380
|
-
def generate_pod_target(target_definitions, pod_specs)
|
381
|
-
pod_target = PodTarget.new(pod_specs, target_definitions, sandbox)
|
385
|
+
def generate_pod_target(target_definitions, pod_specs, scope_suffix: nil)
|
386
|
+
pod_target = PodTarget.new(pod_specs, target_definitions, sandbox, scope_suffix)
|
387
|
+
pod_target.host_requires_frameworks = target_definitions.any?(&:uses_frameworks?)
|
382
388
|
|
383
389
|
if installation_options.integrate_targets?
|
384
390
|
target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values
|
@@ -21,8 +21,8 @@ module Pod
|
|
21
21
|
#
|
22
22
|
attr_accessor :sandbox_state
|
23
23
|
|
24
|
-
# @return [Array<
|
25
|
-
#
|
24
|
+
# @return [Array<AggregateTarget>] The aggregate targets created for each
|
25
|
+
# {TargetDefinition} from the {Podfile}.
|
26
26
|
#
|
27
27
|
attr_accessor :targets
|
28
28
|
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Pod
|
2
|
+
class Installer
|
3
|
+
class Analyzer
|
4
|
+
# Bundles the information needed to setup a {PodTarget}.
|
5
|
+
class PodVariant
|
6
|
+
# @return [Array<Specification>] the spec and subspecs for the target
|
7
|
+
#
|
8
|
+
attr_accessor :specs
|
9
|
+
|
10
|
+
# @return [Platform] the platform
|
11
|
+
#
|
12
|
+
attr_accessor :platform
|
13
|
+
|
14
|
+
# @return [Bool] whether this pod should be built as framework
|
15
|
+
#
|
16
|
+
attr_accessor :requires_frameworks
|
17
|
+
alias_method :requires_frameworks?, :requires_frameworks
|
18
|
+
|
19
|
+
# @return [Specification] the root specification
|
20
|
+
#
|
21
|
+
def root_spec
|
22
|
+
specs.first.root
|
23
|
+
end
|
24
|
+
|
25
|
+
# Initialize a new instance from its attributes.
|
26
|
+
#
|
27
|
+
# @param [Array<String>] specs @see #specs
|
28
|
+
# @param [Platform] platform @see #platform
|
29
|
+
# @param [Bool] requires_frameworks @see #requires_frameworks?
|
30
|
+
#
|
31
|
+
def initialize(specs, platform, requires_frameworks = false)
|
32
|
+
self.specs = specs
|
33
|
+
self.platform = platform
|
34
|
+
self.requires_frameworks = requires_frameworks
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [Bool] whether the {PodVariant} is equal to another taking all
|
38
|
+
# all their attributes into account
|
39
|
+
#
|
40
|
+
def ==(other)
|
41
|
+
self.class == other.class &&
|
42
|
+
specs == other.specs &&
|
43
|
+
platform == other.platform &&
|
44
|
+
requires_frameworks == other.requires_frameworks
|
45
|
+
end
|
46
|
+
alias_method :eql?, :==
|
47
|
+
|
48
|
+
# Hashes the instance by all its attributes.
|
49
|
+
#
|
50
|
+
# This adds support to make instances usable as Hash keys.
|
51
|
+
#
|
52
|
+
# @!visibility private
|
53
|
+
def hash
|
54
|
+
[specs, platform, requires_frameworks].hash
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Installer
|
5
|
+
class Analyzer
|
6
|
+
# Collects all {PodVariant}.
|
7
|
+
class PodVariantSet
|
8
|
+
# @return [Array<PodVariant>] the different variants.
|
9
|
+
#
|
10
|
+
attr_accessor :variants
|
11
|
+
|
12
|
+
# Initialize a new instance.
|
13
|
+
#
|
14
|
+
# @param [Array<PodVariant>] variants @see #variants
|
15
|
+
#
|
16
|
+
def initialize(variants)
|
17
|
+
self.variants = variants
|
18
|
+
end
|
19
|
+
|
20
|
+
# Describes what makes each {PodVariant} distinct among the others.
|
21
|
+
#
|
22
|
+
# @return [Hash<PodVariant, String>]
|
23
|
+
#
|
24
|
+
def scope_suffixes
|
25
|
+
return { variants.first => nil } if variants.count == 1
|
26
|
+
scope_by_specs
|
27
|
+
end
|
28
|
+
|
29
|
+
# Groups the collection by result of the block.
|
30
|
+
#
|
31
|
+
# @param [Block<Variant, #hash>] block
|
32
|
+
# @return [Array<PodVariantSet>]
|
33
|
+
#
|
34
|
+
def group_by(&block)
|
35
|
+
variants.group_by(&block).map { |_, v| PodVariantSet.new(v) }
|
36
|
+
end
|
37
|
+
|
38
|
+
# @private
|
39
|
+
#
|
40
|
+
# Prepends the given scoped {PodVariant}s with another scoping label, if there
|
41
|
+
# was more than one group of {PodVariant}s given.
|
42
|
+
#
|
43
|
+
# @param [Array<Hash<PodVariant, String>>] scoped_variants
|
44
|
+
# {PodVariant}s, which where grouped on base of a criteria, which is used
|
45
|
+
# in the block argument to generate a descriptive label.
|
46
|
+
#
|
47
|
+
# @param [Block<PodVariant, String>] block
|
48
|
+
# takes a {PodVariant} and returns a scope suffix which is prepended, if
|
49
|
+
# necessary.
|
50
|
+
#
|
51
|
+
# @return [Hash<PodVariant, String>]
|
52
|
+
#
|
53
|
+
def scope_if_necessary(scoped_variants, &block)
|
54
|
+
if scoped_variants.count == 1
|
55
|
+
return scoped_variants.first
|
56
|
+
end
|
57
|
+
Hash[scoped_variants.flat_map do |variants|
|
58
|
+
variants.map do |variant, suffix|
|
59
|
+
prefix = block.call(variant)
|
60
|
+
scope = [prefix, suffix].compact.join('-')
|
61
|
+
[variant, !scope.empty? ? scope : nil]
|
62
|
+
end
|
63
|
+
end]
|
64
|
+
end
|
65
|
+
|
66
|
+
# @private
|
67
|
+
# @return [Hash<PodVariant, String>]
|
68
|
+
#
|
69
|
+
def scope_by_build_type
|
70
|
+
scope_if_necessary(group_by(&:requires_frameworks).map(&:scope_by_platform)) do |variant|
|
71
|
+
variant.requires_frameworks? ? 'framework' : 'library'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# @private
|
76
|
+
# @return [Hash<PodVariant, String>]
|
77
|
+
#
|
78
|
+
def scope_by_platform
|
79
|
+
grouped_variants = group_by { |v| v.platform.name }
|
80
|
+
if grouped_variants.all? { |set| set.variants.count == 1 }
|
81
|
+
# => Platform name
|
82
|
+
platform_name_proc = proc { |v| Platform.string_name(v.platform.symbolic_name).tr(' ', '') }
|
83
|
+
else
|
84
|
+
grouped_variants = group_by(&:platform)
|
85
|
+
# => Platform name + SDK version
|
86
|
+
platform_name_proc = proc { |v| v.platform.to_s.tr(' ', '') }
|
87
|
+
end
|
88
|
+
scope_if_necessary(grouped_variants.map(&:scope_without_suffix), &platform_name_proc)
|
89
|
+
end
|
90
|
+
|
91
|
+
# @private
|
92
|
+
# @return [Hash<PodVariant, String>]
|
93
|
+
#
|
94
|
+
def scope_by_specs
|
95
|
+
root_spec = variants.first.root_spec
|
96
|
+
specs = [root_spec]
|
97
|
+
if root_spec.default_subspecs.empty?
|
98
|
+
specs += root_spec.subspecs.compact
|
99
|
+
else
|
100
|
+
specs += root_spec.default_subspecs.map do |subspec_name|
|
101
|
+
root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
|
102
|
+
end
|
103
|
+
end
|
104
|
+
default_specs = Set.new(specs)
|
105
|
+
grouped_variants = group_by(&:specs)
|
106
|
+
all_spec_variants = grouped_variants.map { |set| set.variants.first.specs }
|
107
|
+
common_specs = all_spec_variants.map(&:to_set).flatten.inject(&:&)
|
108
|
+
omit_common_specs = common_specs.any? && common_specs.proper_superset?(default_specs)
|
109
|
+
scope_if_necessary(grouped_variants.map(&:scope_by_build_type)) do |variant|
|
110
|
+
specs = variant.specs.to_set
|
111
|
+
|
112
|
+
# The current variant contains all default specs
|
113
|
+
omit_default_specs = default_specs.any? && default_specs.subset?(specs)
|
114
|
+
if omit_default_specs
|
115
|
+
specs -= default_specs
|
116
|
+
end
|
117
|
+
|
118
|
+
# There are common specs, which are different from the default specs
|
119
|
+
if omit_common_specs
|
120
|
+
specs -= common_specs
|
121
|
+
end
|
122
|
+
|
123
|
+
spec_names = specs.map do |spec|
|
124
|
+
spec.root? ? '.root' : spec.name.split('/')[1..-1].join('_')
|
125
|
+
end.sort
|
126
|
+
if spec_names.empty?
|
127
|
+
omit_common_specs ? '.common' : nil
|
128
|
+
else
|
129
|
+
if omit_common_specs
|
130
|
+
spec_names.unshift('.common')
|
131
|
+
elsif omit_default_specs
|
132
|
+
spec_names.unshift('.default')
|
133
|
+
end
|
134
|
+
spec_names.reduce('') do |acc, name|
|
135
|
+
"#{acc}#{acc.empty? || name[0] == '.' ? '' : '-'}#{name}"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# @private
|
142
|
+
#
|
143
|
+
# Helps to define scope suffixes recursively.
|
144
|
+
#
|
145
|
+
# @return [Hash<PodVariant, String>]
|
146
|
+
#
|
147
|
+
def scope_without_suffix
|
148
|
+
Hash[variants.map { |v| [v, nil] }]
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -58,10 +58,15 @@ module Pod
|
|
58
58
|
return unless spec.prepare_command
|
59
59
|
UI.section(' > Running prepare command', '', 1) do
|
60
60
|
Dir.chdir(path) do
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
begin
|
62
|
+
ENV.delete('CDPATH')
|
63
|
+
ENV['COCOAPODS_VERSION'] = Pod::VERSION
|
64
|
+
prepare_command = spec.prepare_command.strip_heredoc.chomp
|
65
|
+
full_command = "\nset -e\n" + prepare_command
|
66
|
+
bash!('-c', full_command)
|
67
|
+
ensure
|
68
|
+
ENV.delete('COCOAPODS_VERSION')
|
69
|
+
end
|
65
70
|
end
|
66
71
|
end
|
67
72
|
end
|
@@ -151,7 +151,7 @@ module Pod
|
|
151
151
|
end
|
152
152
|
frameworks_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
|
153
153
|
frameworks = pod_target.file_accessors.flat_map(&:vendored_dynamic_artifacts).map { |fw| "${PODS_ROOT}/#{fw.relative_path_from(sandbox.root)}" }
|
154
|
-
frameworks <<
|
154
|
+
frameworks << pod_target.build_product_path if pod_target.should_build? && pod_target.requires_frameworks?
|
155
155
|
frameworks
|
156
156
|
end
|
157
157
|
end
|
@@ -13,6 +13,7 @@ module Pod
|
|
13
13
|
# @param [Sandbox] sandbox @see sandbox
|
14
14
|
#
|
15
15
|
def initialize(target_definition, sandbox)
|
16
|
+
raise "Can't initialize an AggregateTarget with an abstract TargetDefinition" if target_definition.abstract?
|
16
17
|
super()
|
17
18
|
@target_definition = target_definition
|
18
19
|
@sandbox = sandbox
|
@@ -205,13 +206,6 @@ module Pod
|
|
205
206
|
"${SRCROOT}/#{relative_to_srcroot(embed_frameworks_script_path)}"
|
206
207
|
end
|
207
208
|
|
208
|
-
# @return [String] The scoped configuration build dir, relevant if the
|
209
|
-
# target is integrated as framework.
|
210
|
-
#
|
211
|
-
def scoped_configuration_build_dir
|
212
|
-
"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definition.label}"
|
213
|
-
end
|
214
|
-
|
215
209
|
private
|
216
210
|
|
217
211
|
# @!group Private Helpers
|
@@ -19,19 +19,25 @@ module Pod
|
|
19
19
|
# @return [Bool] whether the target needs to be scoped by target definition,
|
20
20
|
# because the spec is used with different subspec sets across them.
|
21
21
|
#
|
22
|
-
# @note
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
22
|
+
# @note The target products of {PodTarget}s are named after their specs.
|
23
|
+
# The namespacing cannot directly happen in the product name itself,
|
24
|
+
# because this must be equal to the module name and this will be
|
25
|
+
# used in source code, which should stay agnostic over the
|
26
|
+
# dependency manager.
|
27
27
|
# We need namespacing because multiple targets can exist for the
|
28
28
|
# same podspec and their products should not collide. This
|
29
29
|
# duplication is needed when multiple user targets have the same
|
30
30
|
# dependency, but they require different sets of subspecs or they
|
31
31
|
# are on different platforms.
|
32
32
|
#
|
33
|
-
|
34
|
-
|
33
|
+
def scoped?
|
34
|
+
!scope_suffix.nil?
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [String] used for the label and the directory name, which is used to
|
38
|
+
# scope the build product in the default configuration build dir.
|
39
|
+
#
|
40
|
+
attr_reader :scope_suffix
|
35
41
|
|
36
42
|
# @return [Array<PodTarget>] the targets that this target has a dependency
|
37
43
|
# upon.
|
@@ -41,16 +47,18 @@ module Pod
|
|
41
47
|
# @param [Array<Specification>] @spec #see spec
|
42
48
|
# @param [Array<TargetDefinition>] target_definitions @see target_definitions
|
43
49
|
# @param [Sandbox] sandbox @see sandbox
|
44
|
-
# @param [
|
50
|
+
# @param [String] scope_suffix @see scope_suffix
|
45
51
|
#
|
46
|
-
def initialize(specs, target_definitions, sandbox,
|
52
|
+
def initialize(specs, target_definitions, sandbox, scope_suffix = nil)
|
47
53
|
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
|
48
54
|
raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
|
55
|
+
raise "Can't initialize a PodTarget with only abstract TargetDefinitions" if target_definitions.all?(&:abstract?)
|
56
|
+
raise "Can't initialize a PodTarget with an empty string scope suffix!" if scope_suffix == ''
|
49
57
|
super()
|
50
58
|
@specs = specs
|
51
59
|
@target_definitions = target_definitions
|
52
60
|
@sandbox = sandbox
|
53
|
-
@
|
61
|
+
@scope_suffix = scope_suffix
|
54
62
|
@build_headers = Sandbox::HeadersStore.new(sandbox, 'Private')
|
55
63
|
@file_accessors = []
|
56
64
|
@resource_bundle_targets = []
|
@@ -67,7 +75,7 @@ module Pod
|
|
67
75
|
if cache[cache_key]
|
68
76
|
cache[cache_key]
|
69
77
|
else
|
70
|
-
target = PodTarget.new(specs, [target_definition], sandbox,
|
78
|
+
target = PodTarget.new(specs, [target_definition], sandbox, target_definition.label)
|
71
79
|
target.file_accessors = file_accessors
|
72
80
|
target.user_build_configurations = user_build_configurations
|
73
81
|
target.native_target = native_target
|
@@ -82,7 +90,11 @@ module Pod
|
|
82
90
|
#
|
83
91
|
def label
|
84
92
|
if scoped?
|
85
|
-
|
93
|
+
if scope_suffix[0] == '.'
|
94
|
+
"#{root_spec.name}#{scope_suffix}"
|
95
|
+
else
|
96
|
+
"#{root_spec.name}-#{scope_suffix}"
|
97
|
+
end
|
86
98
|
else
|
87
99
|
root_spec.name
|
88
100
|
end
|
@@ -241,15 +253,24 @@ module Pod
|
|
241
253
|
end
|
242
254
|
end
|
243
255
|
|
244
|
-
# @
|
245
|
-
#
|
256
|
+
# @param [String] dir
|
257
|
+
# The directory (which might be a variable) relative to which
|
258
|
+
# the returned path should be. This must be used if the
|
259
|
+
# $CONFIGURATION_BUILD_DIR is modified.
|
246
260
|
#
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
261
|
+
# @return [String] The absolute path to the configuration build dir
|
262
|
+
#
|
263
|
+
def configuration_build_dir(dir = '$CONFIGURATION_BUILD_DIR')
|
264
|
+
"#{dir}/#{label}"
|
265
|
+
end
|
266
|
+
|
267
|
+
# @param [String] dir
|
268
|
+
# @see #configuration_build_dir
|
269
|
+
#
|
270
|
+
# @return [String] The absolute path to the build product
|
271
|
+
#
|
272
|
+
def build_product_path(dir = '$CONFIGURATION_BUILD_DIR')
|
273
|
+
"#{configuration_build_dir(dir)}/#{product_name}"
|
253
274
|
end
|
254
275
|
|
255
276
|
private
|
@@ -65,20 +65,31 @@ EOS
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def stack
|
68
|
-
|
68
|
+
parts = {
|
69
|
+
'CocoaPods' => Pod::VERSION,
|
70
|
+
'Ruby' => RUBY_DESCRIPTION,
|
71
|
+
'RubyGems' => Gem::VERSION,
|
72
|
+
'Host' => host_information,
|
73
|
+
'Xcode' => xcode_information,
|
74
|
+
'Git' => git_information,
|
75
|
+
'Ruby lib dir' => RbConfig::CONFIG['libdir'],
|
76
|
+
'Repositories' => repo_information,
|
77
|
+
}
|
78
|
+
justification = parts.keys.map(&:size).max
|
79
|
+
|
80
|
+
str = <<-EOS
|
69
81
|
### Stack
|
70
82
|
|
71
|
-
```
|
72
|
-
CocoaPods : #{Pod::VERSION}
|
73
|
-
Ruby : #{RUBY_DESCRIPTION}
|
74
|
-
RubyGems : #{Gem::VERSION}
|
75
|
-
Host : #{host_information}
|
76
|
-
Xcode : #{xcode_information}
|
77
|
-
Git : #{git_information}
|
78
|
-
Ruby lib dir : #{RbConfig::CONFIG['libdir']}
|
79
|
-
Repositories : #{repo_information.join("\n ")}
|
80
83
|
```
|
81
84
|
EOS
|
85
|
+
parts.each do |name, value|
|
86
|
+
str << name.rjust(justification)
|
87
|
+
str << ' : '
|
88
|
+
str << Array(value).join("\n" << (' ' * (justification + 3)))
|
89
|
+
str << "\n"
|
90
|
+
end
|
91
|
+
|
92
|
+
str << "```\n"
|
82
93
|
end
|
83
94
|
|
84
95
|
def plugins_string
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -428,7 +428,7 @@ module Pod
|
|
428
428
|
# for all available platforms with xcodebuild.
|
429
429
|
#
|
430
430
|
def install_pod
|
431
|
-
%i(
|
431
|
+
%i(verify_no_duplicate_framework_names
|
432
432
|
verify_no_static_framework_transitive_dependencies
|
433
433
|
verify_framework_usage generate_pods_project integrate_user_project
|
434
434
|
perform_post_install_actions).each { |m| @installer.send(m) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta.
|
4
|
+
version: 1.0.0.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-02-
|
14
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: cocoapods-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.0.beta.
|
22
|
+
version: 1.0.0.beta.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.0.beta.
|
29
|
+
version: 1.0.0.beta.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: claide
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,21 +193,21 @@ dependencies:
|
|
193
193
|
requirements:
|
194
194
|
- - ~>
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: 0.4.
|
196
|
+
version: 0.4.3
|
197
197
|
type: :runtime
|
198
198
|
prerelease: false
|
199
199
|
version_requirements: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
201
|
- - ~>
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: 0.4.
|
203
|
+
version: 0.4.3
|
204
204
|
- !ruby/object:Gem::Dependency
|
205
205
|
name: xcodeproj
|
206
206
|
requirement: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
208
|
- - '>='
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: 1.0.0.beta.
|
210
|
+
version: 1.0.0.beta.3
|
211
211
|
- - <
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '2.0'
|
@@ -217,7 +217,7 @@ dependencies:
|
|
217
217
|
requirements:
|
218
218
|
- - '>='
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: 1.0.0.beta.
|
220
|
+
version: 1.0.0.beta.3
|
221
221
|
- - <
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '2.0'
|
@@ -415,6 +415,8 @@ files:
|
|
415
415
|
- lib/cocoapods/installer/analyzer.rb
|
416
416
|
- lib/cocoapods/installer/analyzer/analysis_result.rb
|
417
417
|
- lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
|
418
|
+
- lib/cocoapods/installer/analyzer/pod_variant.rb
|
419
|
+
- lib/cocoapods/installer/analyzer/pod_variant_set.rb
|
418
420
|
- lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
|
419
421
|
- lib/cocoapods/installer/analyzer/specs_state.rb
|
420
422
|
- lib/cocoapods/installer/analyzer/target_inspection_result.rb
|