Commit 81f85e09 authored by Kyle Fuller's avatar Kyle Fuller

[Integration] Fix integration while project is open

While a user project is open and we delete/change the xcconfig files which
the user project references. It causes any subsequent builds to fail
until the project is closed/re-opened, or the project file is touched.

This commit touches the file if we do not need to save it, thus causing
Xcode to reload it.

Closes #2627
Closes #2665
parent b6a5aa69
......@@ -21,6 +21,13 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Samuel Giddins](https://github.com/segiddins)
[#2494](https://github.com/CocoaPods/CocoaPods/issues/2494)
* Fixes an issue where running `pod install/update` while the Xcode project
is open can cause the open project to have build failures until Xcode
is restarted.
[Kyle Fuller](https://github.com/kylef)
[#2627](https://github.com/CocoaPods/CocoaPods/issues/2627)
[#2665](https://github.com/CocoaPods/CocoaPods/issues/2665)
## 0.34.2
......
......@@ -27,14 +27,30 @@ module Pod
#
def integrate!
UI.section(integration_message) do
user_project.save if XCConfigIntegrator.integrate(target, native_targets)
user_project.save if update_to_cocoapods_0_34
# TODO: refactor into Xcodeproj https://github.com/CocoaPods/Xcodeproj/issues/202
project_is_dirty = [
XCConfigIntegrator.integrate(target, native_targets),
update_to_cocoapods_0_34,
unless native_targets_to_integrate.empty?
add_pods_library
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
true
end
].any?
unless native_targets_to_integrate.empty?
add_pods_library
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
if project_is_dirty
user_project.save
else
# There is a bug in Xcode where the process of deleting and
# re-creating the xcconfig files used in the build
# configuration cause building the user project to fail until
# Xcode is relaunched.
#
# Touching/saving the project causes Xcode to reload these.
#
# https://github.com/CocoaPods/CocoaPods/issues/2665
FileUtils.touch(user_project.path + 'project.pbxproj')
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment