cocoapods 1.2.1 → 1.3.0.beta.1

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: 717aefc6a92f02fe1ffa1edba6f8efad090c95e5
4
- data.tar.gz: f07e36e38adfad65b2ff7f8d09abbe37317ed815
3
+ metadata.gz: 85b8c7d56dc05bce8e651e54f7b9d2af2ffefaea
4
+ data.tar.gz: fa049011f0e3c0f28a40d444d74450445be75ed1
5
5
  SHA512:
6
- metadata.gz: 69cfa6fdf9335e3b8bec18407d0cfe2e27c48beb544591d603339479498fd05a8ba582d2b712d8ded41670f08437c952e716d248225d9ba84654f4f32fbf2c8b
7
- data.tar.gz: 449079e735f7eb7405a2a85bd905c63df73bade3071a8e6b2644aa1f8927df178bf3dfd11a3cab874a8519d798dee356096f77b2ece46dbaad14a85aa4e496a7
6
+ metadata.gz: e03f894668359510702db376e92692ad0bac0fa0334c25cbdeab29420d4e9cea080a135695b5d614208b9545ab4c2797e90566c4fa47055c751990a7272d51fa
7
+ data.tar.gz: e6f6cc8935c87cc50084cc2224cb47a70ab9b9c8a0906ffe55dacff18aab74cc5c16cef6eaac718cd3ca66db1e6f190f622b000b928da92ac3b6027660e73a54
@@ -4,6 +4,88 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 1.3.0.beta.1 (2017-06-06)
8
+
9
+ ##### Enhancements
10
+
11
+ * Add validator support to run test specs during lint
12
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
13
+ [#6753](https://github.com/CocoaPods/CocoaPods/pull/6753)
14
+
15
+ * Fix to include proper runtime search paths for test native targets
16
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
17
+ [#6727](https://github.com/CocoaPods/CocoaPods/pull/6727)
18
+
19
+ * Aggregate targets should not include pod targets only used by tests
20
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
21
+ [#6726](https://github.com/CocoaPods/CocoaPods/pull/6726)
22
+
23
+ * Add support for test target creation in the pods project generator
24
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
25
+ [#6703](https://github.com/CocoaPods/CocoaPods/pull/6703)
26
+
27
+ * Copy dSYM for vendored frameworks.
28
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
29
+ [#1698](https://github.com/CocoaPods/CocoaPods/issues/1698)
30
+
31
+ * Prevents need for .swift-version file in Objective-C pods
32
+ [Austin Emmons](https://github.com/atreat)
33
+ [#6742](https://github.com/CocoaPods/CocoaPods/issues/6742)
34
+
35
+ ##### Bug Fixes
36
+
37
+ * Do not double add search paths to test xcconfig from parent
38
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
39
+ [#6767](https://github.com/CocoaPods/CocoaPods/pull/6767)
40
+
41
+ * Link `swiftSwiftOnoneSupport` for test xcconfigs
42
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
43
+ [#6769](https://github.com/CocoaPods/CocoaPods/pull/6769)
44
+
45
+ * Ensure product name for tests is not overridden by custom build settings
46
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
47
+ [#6766](https://github.com/CocoaPods/CocoaPods/pull/6766)
48
+
49
+ * Do not use the same product name for test targets
50
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
51
+ [#6762](https://github.com/CocoaPods/CocoaPods/pull/6762)
52
+
53
+ * Use unique temp folder during lint for parallel execution
54
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
55
+ [#5117](https://github.com/CocoaPods/CocoaPods/issues/5117)
56
+
57
+ * Stop adding `$(inherited)` for every static library linked
58
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
59
+ [#6756](https://github.com/CocoaPods/CocoaPods/pull/6756)
60
+
61
+ * Settings for dependent targets should include the parent target for test xcconfigs
62
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
63
+ [#6755](https://github.com/CocoaPods/CocoaPods/pull/6755)
64
+
65
+ * Only check for valid Swift version for pod targets that use Swift
66
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
67
+ [#6733](https://github.com/CocoaPods/CocoaPods/pull/6733)
68
+
69
+ * Fix pod install error from 1.2.1 when working with static lib-only projects.
70
+ [Ben Asher](https://github.com/benasher44)
71
+ [#6673](https://github.com/CocoaPods/CocoaPods/issues/6673)
72
+
73
+ * Use `git!` when executing `push` command in order to raise informative and set exit code.
74
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
75
+ [#6700](https://github.com/CocoaPods/CocoaPods/pull/6700)
76
+
77
+ * Make copy resources echoes always return true to work around issue where Xcode stops handling build script output greater than ~440 characters (rdar://30607704).
78
+ [postmechanical](https://github.com/postmechanical)
79
+ [#6595](https://github.com/CocoaPods/CocoaPods/issues/6595)
80
+
81
+ * Inherit pod defined values for `SWIFT_ACTIVE_COMPILATION_CONDITIONS`.
82
+ [Louis D'hauwe](https://github.com/louisdh)
83
+ [#6629](https://github.com/CocoaPods/CocoaPods/pull/6629)
84
+
85
+ * Delete extraneous files in rsync destination.
86
+ [jgavris](https://github.com/jgavris)
87
+ [#6694](https://github.com/CocoaPods/CocoaPods/pull/6694)
88
+
7
89
  ## 1.2.1 (2017-04-11)
8
90
 
9
91
  ##### Enhancements
@@ -12,7 +94,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
12
94
 
13
95
  ##### Bug Fixes
14
96
 
15
- * None.
97
+ * No master specs cloning when not needed for `pod lib lint`.
98
+ [Alfredo Delli Bovi](https://github.com/adellibovi)
99
+ [#6154](https://github.com/CocoaPods/CocoaPods/issues/6154)
16
100
 
17
101
 
18
102
  ## 1.2.1.rc.1 (2017-04-05)
@@ -155,6 +239,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
155
239
  [Danielle Tomlinson](https://github.com/dantoml)
156
240
  [#5937](https://github.com/CocoaPods/CocoaPods/issues/5937)
157
241
 
242
+ * Move Installer target verification into the Xcode namespace
243
+ [Danielle Tomlinson](https://github.com/DanToml)
244
+ [#5607](https://github.com/CocoaPods/CocoaPods/pull/5607)
245
+
158
246
  ##### Bug Fixes
159
247
 
160
248
  * None.
@@ -24,6 +24,7 @@ module Pod
24
24
  ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
25
25
  'This takes precedence over a .swift-version file.'],
26
26
  ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
27
+ ['--skip-tests', 'Lint skips building and running tests during validation'],
27
28
  ].concat(super)
28
29
  end
29
30
 
@@ -39,6 +40,7 @@ module Pod
39
40
  @private = argv.flag?('private', false)
40
41
  @swift_version = argv.option('swift-version', nil)
41
42
  @skip_import_validation = argv.flag?('skip-import-validation', false)
43
+ @skip_tests = argv.flag?('skip-tests', false)
42
44
  @podspecs_paths = argv.arguments!
43
45
  super
44
46
  end
@@ -62,6 +64,7 @@ module Pod
62
64
  validator.ignore_public_only_results = @private
63
65
  validator.swift_version = @swift_version
64
66
  validator.skip_import_validation = @skip_import_validation
67
+ validator.skip_tests = @skip_tests
65
68
  validator.validate
66
69
 
67
70
  unless @clean
@@ -213,7 +213,7 @@ module Pod
213
213
  #
214
214
  def push_repo
215
215
  UI.puts "\nPushing the `#{@repo}' repo\n".yellow
216
- UI.puts `git -C "#{repo_dir}" push origin master 2>&1`
216
+ repo_git('-C', repo_dir, 'push', 'origin', 'master')
217
217
  end
218
218
 
219
219
  #---------------------------------------------------------------------#
@@ -30,6 +30,7 @@ module Pod
30
30
  ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
31
31
  'This takes precedence over a .swift-version file.'],
32
32
  ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
33
+ ['--skip-tests', 'Lint skips building and running tests during validation'],
33
34
  ].concat(super)
34
35
  end
35
36
 
@@ -45,6 +46,7 @@ module Pod
45
46
  @private = argv.flag?('private', false)
46
47
  @swift_version = argv.option('swift-version', nil)
47
48
  @skip_import_validation = argv.flag?('skip-import-validation', false)
49
+ @skip_tests = argv.flag?('skip-tests', false)
48
50
  @podspecs_paths = argv.arguments!
49
51
  super
50
52
  end
@@ -64,6 +66,7 @@ module Pod
64
66
  validator.ignore_public_only_results = @private
65
67
  validator.swift_version = @swift_version
66
68
  validator.skip_import_validation = @skip_import_validation
69
+ validator.skip_tests = @skip_tests
67
70
  validator.validate
68
71
  failure_reasons << validator.failure_reason
69
72
 
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.2.1'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.3.0.beta.1'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -140,29 +140,29 @@ EOM
140
140
  fi
141
141
  case $RESOURCE_PATH in
142
142
  *\.storyboard)
143
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
143
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
144
144
  ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
145
145
  ;;
146
146
  *\.xib)
147
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
147
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
148
148
  ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
149
149
  ;;
150
150
  *.framework)
151
- echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
151
+ echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
152
152
  mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
153
- echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
154
- rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
153
+ echo "rsync --delete -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
154
+ rsync --delete -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
155
155
  ;;
156
156
  *.xcdatamodel)
157
- echo "xcrun momc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\\""
157
+ echo "xcrun momc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\\"" || true
158
158
  xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
159
159
  ;;
160
160
  *.xcdatamodeld)
161
- echo "xcrun momc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\\""
161
+ echo "xcrun momc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\\"" || true
162
162
  xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
163
163
  ;;
164
164
  *.xcmappingmodel)
165
- echo "xcrun mapc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\\""
165
+ echo "xcrun mapc \\"$RESOURCE_PATH\\" \\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\\"" || true
166
166
  xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
167
167
  ;;
168
168
  *.xcassets)
@@ -170,7 +170,7 @@ EOM
170
170
  XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
171
171
  ;;
172
172
  *)
173
- echo "$RESOURCE_PATH"
173
+ echo "$RESOURCE_PATH" || true
174
174
  echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
175
175
  ;;
176
176
  esac
@@ -180,10 +180,10 @@ EOS
180
180
  RSYNC_CALL = <<EOS
181
181
 
182
182
  mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
183
- rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
183
+ rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
184
184
  if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
185
185
  mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
186
- rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
186
+ rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
187
187
  fi
188
188
  rm -f "$RESOURCES_TO_COPY"
189
189
  EOS
@@ -61,8 +61,8 @@ module Pod
61
61
  fi
62
62
 
63
63
  # use filter instead of exclude so missing patterns dont' throw errors
64
- echo "rsync -av --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"${source}\\" \\"${destination}\\""
65
- rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
64
+ echo "rsync --delete -av --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"${source}\\" \\"${destination}\\""
65
+ rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
66
66
 
67
67
  local basename
68
68
  basename="$(basename -s .framework "$1")"
@@ -91,6 +91,15 @@ module Pod
91
91
  fi
92
92
  }
93
93
 
94
+ # Copies the dSYM of a vendored framework
95
+ install_dsym() {
96
+ local source="$1"
97
+ if [ -r "$source" ]; then
98
+ echo "rsync --delete -av --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"${source}\\" \\"${DWARF_DSYM_FOLDER_PATH}\\""
99
+ rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
100
+ fi
101
+ }
102
+
94
103
  # Signs a framework with the provided identity
95
104
  code_sign_if_enabled() {
96
105
  if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
@@ -126,11 +135,14 @@ module Pod
126
135
 
127
136
  SH
128
137
  script << "\n" unless frameworks_by_config.values.all?(&:empty?)
129
- frameworks_by_config.each do |config, frameworks|
130
- unless frameworks.empty?
138
+ frameworks_by_config.each do |config, frameworks_with_dsyms|
139
+ unless frameworks_with_dsyms.empty?
131
140
  script << %(if [[ "$CONFIGURATION" == "#{config}" ]]; then\n)
132
- frameworks.each do |framework|
133
- script << %( install_framework "#{framework}"\n)
141
+ frameworks_with_dsyms.each do |framework_with_dsym|
142
+ script << %( install_framework "#{framework_with_dsym[:framework]}"\n)
143
+ # Vendored frameworks might have a dSYM file next to them so ensure its copied. Frameworks built from
144
+ # sources will have their dSYM generated and copied by Xcode.
145
+ script << %( install_dsym "#{framework_with_dsym[:dSYM]}"\n) unless framework_with_dsym[:dSYM].nil?
134
146
  end
135
147
  script << "fi\n"
136
148
  end
@@ -71,8 +71,9 @@ module Pod
71
71
 
72
72
  XCConfigHelper.add_target_specific_settings(target, @xcconfig)
73
73
 
74
- generate_vendored_build_settings
75
- generate_other_ld_flags
74
+ targets = pod_targets + target.search_paths_aggregate_targets.flat_map(&:pod_targets)
75
+ XCConfigHelper.generate_vendored_build_settings(target, targets, @xcconfig)
76
+ XCConfigHelper.generate_other_ld_flags(target, pod_targets, @xcconfig)
76
77
 
77
78
  # TODO: Need to decide how we are going to ensure settings like these
78
79
  # are always excluded from the user's project.
@@ -84,7 +85,9 @@ module Pod
84
85
  # update the runpath search paths.
85
86
  vendored_dynamic_artifacts = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_dynamic_artifacts)
86
87
 
87
- generate_ld_runpath_search_paths if target.requires_frameworks? || vendored_dynamic_artifacts.count > 0
88
+ symbol_type = target.user_targets.map(&:symbol_type).uniq.first
89
+ test_bundle = symbol_type == :octest_bundle || symbol_type == :unit_test_bundle || symbol_type == :ui_test_bundle
90
+ XCConfigHelper.generate_ld_runpath_search_paths(target, target.requires_host_target?, test_bundle, @xcconfig) if target.requires_frameworks? || vendored_dynamic_artifacts.count > 0
88
91
 
89
92
  @xcconfig
90
93
  end
@@ -176,69 +179,6 @@ module Pod
176
179
  end
177
180
  end
178
181
 
179
- # Add custom build settings and required build settings to link to
180
- # vendored libraries and frameworks.
181
- #
182
- # @note
183
- # In case of generated pod targets, which require frameworks, the
184
- # vendored frameworks and libraries are already linked statically
185
- # into the framework binary and must not be linked again to the
186
- # user target.
187
- #
188
- def generate_vendored_build_settings
189
- targets = pod_targets + target.search_paths_aggregate_targets.flat_map(&:pod_targets)
190
-
191
- targets.each do |pod_target|
192
- unless pod_target.should_build? && pod_target.requires_frameworks?
193
- XCConfigHelper.add_settings_for_file_accessors_of_target(target, pod_target, @xcconfig)
194
- end
195
- end
196
- end
197
-
198
- # Add pod target to list of frameworks / libraries that are linked
199
- # with the user’s project.
200
- #
201
- def generate_other_ld_flags
202
- other_ld_flags = pod_targets.select(&:should_build?).map do |pod_target|
203
- if pod_target.requires_frameworks?
204
- %(-framework "#{pod_target.product_basename}")
205
- else
206
- %(-l "#{pod_target.product_basename}") if XCConfigHelper.links_dependency?(target, pod_target)
207
- end
208
- end
209
-
210
- @xcconfig.merge!('OTHER_LDFLAGS' => other_ld_flags.compact.join(' '))
211
- end
212
-
213
- # Ensure to add the default linker run path search paths as they could
214
- # be not present due to being historically absent in the project or
215
- # target template or just being removed by being superficial when
216
- # linking third-party dependencies exclusively statically. This is not
217
- # something a project needs specifically for the integration with
218
- # CocoaPods, but makes sure that it is self-contained for the given
219
- # constraints.
220
- #
221
- def generate_ld_runpath_search_paths
222
- ld_runpath_search_paths = ['$(inherited)']
223
- if target.platform.symbolic_name == :osx
224
- ld_runpath_search_paths << "'@executable_path/../Frameworks'"
225
- symbol_type = target.user_targets.map(&:symbol_type).uniq.first
226
- ld_runpath_search_paths << \
227
- if symbol_type == :unit_test_bundle
228
- "'@loader_path/../Frameworks'"
229
- else
230
- "'@loader_path/Frameworks'"
231
- end
232
- else
233
- ld_runpath_search_paths << [
234
- "'@executable_path/Frameworks'",
235
- "'@loader_path/Frameworks'",
236
- ]
237
- ld_runpath_search_paths << "'@executable_path/../../Frameworks'" if target.requires_host_target?
238
- end
239
- @xcconfig.merge!('LD_RUNPATH_SEARCH_PATHS' => ld_runpath_search_paths.join(' '))
240
- end
241
-
242
182
  private
243
183
 
244
184
  #---------------------------------------------------------------------#
@@ -16,8 +16,12 @@ module Pod
16
16
  #
17
17
  # @param [Target] target @see target
18
18
  #
19
- def initialize(target)
19
+ # @param [Boolean] test_xcconfig
20
+ # whether this is an xcconfig for a test native target.
21
+ #
22
+ def initialize(target, test_xcconfig = false)
20
23
  @target = target
24
+ @test_xcconfig = test_xcconfig
21
25
  end
22
26
 
23
27
  # @return [Xcodeproj::Config] The generated xcconfig.
@@ -49,11 +53,12 @@ module Pod
49
53
  'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
50
54
  'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
51
55
  'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
52
- 'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
56
+ 'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target, @test_xcconfig),
53
57
  'PODS_ROOT' => '${SRCROOT}',
54
58
  'PODS_TARGET_SRCROOT' => target.pod_target_srcroot,
55
59
  'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
56
60
  'SKIP_INSTALL' => 'YES',
61
+ 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) ',
57
62
  # 'USE_HEADERMAP' => 'NO'
58
63
  }
59
64
 
@@ -64,7 +69,15 @@ module Pod
64
69
  @xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig)
65
70
  end
66
71
  XCConfigHelper.add_target_specific_settings(target, @xcconfig)
67
- @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, target.recursive_dependent_targets)
72
+ recursive_dependent_targets = target.recursive_dependent_targets
73
+ @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, recursive_dependent_targets)
74
+ if @test_xcconfig
75
+ test_dependent_targets = [target, *target.test_dependent_targets]
76
+ @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, test_dependent_targets - recursive_dependent_targets)
77
+ XCConfigHelper.generate_vendored_build_settings(nil, test_dependent_targets, @xcconfig)
78
+ XCConfigHelper.generate_other_ld_flags(nil, test_dependent_targets, @xcconfig)
79
+ XCConfigHelper.generate_ld_runpath_search_paths(target, false, true, @xcconfig)
80
+ end
68
81
  @xcconfig
69
82
  end
70
83
 
@@ -45,13 +45,15 @@ module Pod
45
45
  # the target, which is used to check if the ARC compatibility
46
46
  # flag is required.
47
47
  #
48
- # @return [String] the default linker flags. `-ObjC` is always included
49
- # while `-fobjc-arc` is included only if requested in the
50
- # Podfile.
48
+ # @param [Boolean] include_objc_flag
49
+ # whether to include `-ObjC` in the other linker flags
51
50
  #
52
- def self.default_ld_flags(target, includes_static_libraries = false)
51
+ # @return [String] the default linker flags. `-ObjC` is optionally included depending
52
+ # on the target while `-fobjc-arc` is included only if requested in the Podfile.
53
+ #
54
+ def self.default_ld_flags(target, include_objc_flag = false)
53
55
  ld_flags = ''
54
- ld_flags << '-ObjC' if includes_static_libraries
56
+ ld_flags << '-ObjC' if include_objc_flag
55
57
  if target.podfile.set_arc_compatibility_flag? &&
56
58
  target.spec_consumers.any?(&:requires_arc?)
57
59
  ld_flags << ' -fobjc-arc'
@@ -210,7 +212,7 @@ module Pod
210
212
  name = File.basename(library_path, extension).sub(/\Alib/, '')
211
213
  dirname = '${PODS_ROOT}/' + library_path.dirname.relative_path_from(sandbox_root).to_s
212
214
  build_settings = {
213
- 'LIBRARY_SEARCH_PATHS' => '$(inherited) ' + quote([dirname]),
215
+ 'LIBRARY_SEARCH_PATHS' => quote([dirname]),
214
216
  }
215
217
  build_settings['OTHER_LDFLAGS'] = "-l#{name}" if include_other_ldflags
216
218
  xcconfig.merge!(build_settings)
@@ -296,6 +298,100 @@ module Pod
296
298
  build_settings
297
299
  end
298
300
 
301
+ # Add custom build settings and required build settings to link to
302
+ # vendored libraries and frameworks.
303
+ #
304
+ # @param [AggregateTarget] aggregate_target
305
+ # The aggregate target, may be nil.
306
+ #
307
+ # @param [Array<PodTarget] pod_targets
308
+ # The pod targets to add the vendored build settings for.
309
+ #
310
+ # @param [Xcodeproj::Config] xcconfig
311
+ # The xcconfig to edit.
312
+ #
313
+ # @note
314
+ # In case of generated pod targets, which require frameworks, the
315
+ # vendored frameworks and libraries are already linked statically
316
+ # into the framework binary and must not be linked again to the
317
+ # user target.
318
+ #
319
+ def self.generate_vendored_build_settings(aggregate_target, pod_targets, xcconfig)
320
+ pod_targets.each do |pod_target|
321
+ unless pod_target.should_build? && pod_target.requires_frameworks?
322
+ XCConfigHelper.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig)
323
+ end
324
+ end
325
+ end
326
+
327
+ # Ensure to add the default linker run path search paths as they could
328
+ # be not present due to being historically absent in the project or
329
+ # target template or just being removed by being superficial when
330
+ # linking third-party dependencies exclusively statically. This is not
331
+ # something a project needs specifically for the integration with
332
+ # CocoaPods, but makes sure that it is self-contained for the given
333
+ # constraints.
334
+ #
335
+ # @param [Target] target
336
+ # The target, this can be an aggregate target or a pod target.
337
+ #
338
+ # @param [Boolean] requires_host_target
339
+ # If this target requires a host target
340
+ #
341
+ # @param [Boolean] test_bundle
342
+ # Whether this is a test bundle or not. This has an effect when the platform is `osx` and changes
343
+ # the runtime search paths accordingly.
344
+ #
345
+ # @param [Xcodeproj::Config] xcconfig
346
+ # The xcconfig to edit.
347
+ #
348
+ # @return [void]
349
+ #
350
+ def self.generate_ld_runpath_search_paths(target, requires_host_target, test_bundle, xcconfig)
351
+ ld_runpath_search_paths = ['$(inherited)']
352
+ if target.platform.symbolic_name == :osx
353
+ ld_runpath_search_paths << "'@executable_path/../Frameworks'"
354
+ ld_runpath_search_paths << \
355
+ if test_bundle
356
+ "'@loader_path/../Frameworks'"
357
+ else
358
+ "'@loader_path/Frameworks'"
359
+ end
360
+ else
361
+ ld_runpath_search_paths << [
362
+ "'@executable_path/Frameworks'",
363
+ "'@loader_path/Frameworks'",
364
+ ]
365
+ ld_runpath_search_paths << "'@executable_path/../../Frameworks'" if requires_host_target
366
+ end
367
+ xcconfig.merge!('LD_RUNPATH_SEARCH_PATHS' => ld_runpath_search_paths.join(' '))
368
+ end
369
+
370
+ # Add pod target to list of frameworks / libraries that are linked
371
+ # with the user’s project.
372
+ #
373
+ # @param [AggregateTarget] aggregate_target
374
+ # The aggregate target, may be nil.
375
+ #
376
+ # @param [Array<PodTarget] pod_targets
377
+ # The pod targets to add the vendored build settings for.
378
+ #
379
+ # @param [Xcodeproj::Config] xcconfig
380
+ # The xcconfig to edit.
381
+ #
382
+ # @return [void]
383
+ #
384
+ def self.generate_other_ld_flags(aggregate_target, pod_targets, xcconfig)
385
+ other_ld_flags = pod_targets.select(&:should_build?).map do |pod_target|
386
+ if pod_target.requires_frameworks?
387
+ %(-framework "#{pod_target.product_basename}")
388
+ elsif XCConfigHelper.links_dependency?(aggregate_target, pod_target)
389
+ %(-l "#{pod_target.product_basename}")
390
+ end
391
+ end
392
+ xcconfig.merge!('OTHER_LDFLAGS' => other_ld_flags.compact.join(' '))
393
+ end
394
+
299
395
  # Checks if the given target requires language specific settings and
300
396
  # configures the given Xcconfig.
301
397
  #