Skip to content

Commit

Permalink
Make compatible with CocoaPods 1.0.0+
Browse files Browse the repository at this point in the history
- if using CocoaPods 1.0.0+, you need to manually remove the Embed Frameworks build phase after pod install, as it points at locations that are no longer used; CocoaPods installs its own [CP] Embed Pods Frameworks phase. (To be automated.)
- if using CocoaPods 0.39.0, this step is not needed.
  • Loading branch information
t0rst committed Jun 7, 2016
1 parent d5d02e5 commit f8aca57
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
8 changes: 0 additions & 8 deletions Config/Debug(cocoapods).xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@
//

#include "Pods/Target Support Files/Pods-HelloOBP-iOS/Pods-HelloOBP-iOS.debug.xcconfig"

// override PODS_FRAMEWORK_BUILD_PATH
PODS_FRAMEWORK_BUILD_PATH = $(BUILT_PRODUCTS_DIR)

DEPENDENCY_MANAGER = COCOAPODS
COCOAPODS_BUILD_PLATFORM_DIR = $(PODS_FRAMEWORK_BUILD_PATH)

#include "Common.xcconfig"
8 changes: 0 additions & 8 deletions Config/Release(cocoapods).xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@
//

#include "Pods/Target Support Files/Pods-HelloOBP-iOS/Pods-HelloOBP-iOS.release.xcconfig"

// override PODS_FRAMEWORK_BUILD_PATH
PODS_FRAMEWORK_BUILD_PATH = $(BUILT_PRODUCTS_DIR)

DEPENDENCY_MANAGER = COCOAPODS
COCOAPODS_BUILD_PLATFORM_DIR = $(PODS_FRAMEWORK_BUILD_PATH)

#include "Common.xcconfig"
6 changes: 3 additions & 3 deletions HelloOBP-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "Scripts/CCPScripts/copy-carthage-built-frameworks-to-built-products.sh";
shellPath = /bin/sh;
shellScript = "if [[ -n \"${CARTHAGE_BUILD_PLATFORM_DIR}\" ]]; then\n Scripts/CCPScripts/copy-carthage-built-frameworks-to-built-products.sh\nfi";
};
AE85F24D1CB59C3400FAC628 /* Make Carthage Build Directory */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -339,7 +339,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if ! [[ -e \"${CARTHAGE_BUILD_PLATFORM_DIR}\" ]] ; then\n mkdir -p \"${CARTHAGE_BUILD_PLATFORM_DIR}\"\nfi";
shellScript = "if ! [[ -z \"${CARTHAGE_BUILD_PLATFORM_DIR}\" || -e \"${CARTHAGE_BUILD_PLATFORM_DIR}\" ]] ; then\n mkdir -p \"${CARTHAGE_BUILD_PLATFORM_DIR}\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
8 changes: 0 additions & 8 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,3 @@ target 'HelloOBP-iOS' do
# ...OBPKit currently requires the t0rst fork of OAuthCore
pod 'OBPKit', :git => 'https://github.com/OpenBankProject/OBPKit-iOSX.git'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['PODS_FRAMEWORK_BUILD_PATH'] = '$(BUILT_PRODUCTS_DIR)'
end
end
end
4 changes: 3 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ SPEC CHECKSUMS:
STHTTPRequest: e7e5e4aacaeb2eaa3e27af1d86533f803b3cdb74
UICKeyChainStore: f1cbd42216a113f0165de1e733e62905b8823432

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 4dd4256970fbc403efa50112469b7d910da2e7bc

COCOAPODS: 1.0.1
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $ carthage update --no-build --no-use-binaries
$ open HelloOBP-iOS-Cart.xcworkspace -a Xcode.app
```

...or use CocoaPods...
...and then build and run, or use CocoaPods...

```sh
$ cd HelloOBP-iOS
Expand All @@ -83,7 +83,9 @@ Pod installation complete! There are 2 dependencies from the Podfile and 4 total
$ open HelloOBP-iOS-Pods.xcworkspace -a Xcode.app
```

...then build and run.
...then one extra, not-yet-automated step that is needed with the latest CocoaPods (`pod --version` >= 1.0.0): in the navigator pane, click on the blue HelloOBP-iOS project icon, select HelloOBP-iOS under TARGETS, select Build Phases, clieck the 'x' to the right of the "Embed Frameworks (4 items)" build phase, as CocoaPods has installed it own "[CP] Embed Pods Frameworks" build phase further down (commiting this change now will allow you to easily revert it should you wish to try out using carthage later), and then...

...build and run.

You can ignore the two pod warnings starting "CocoaPods did not set the base configuration of your project because...etc", because HelloOBP-iOS.xcodeproj configures for carthage or cocoapods whenever you build: a script sets the build configuration files Debug(dynamic).xcconfig and Release(dynamic).xcconfig to be copies of Debug(carthage).xcconfig and Release(carthage).xcconfig or Debug(cocoapods).xcconfig and Release(cocoapods).xcconfig, as appropriate. This sometimes goes under Xcode's radar, and you get a warning, but this clears after you clean, close and reopen the project.

Expand Down

0 comments on commit f8aca57

Please sign in to comment.