Created
April 6, 2017 12:26
-
-
Save oleander/b5d9308453041b1024fc3917e2a2f17a to your computer and use it in GitHub Desktop.
How to use the Swift Package Manager and CocoaPods within the same XCode application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install -g xcpretty | |
$ gem install cocoapods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP="MyApp" | |
CONSTRUCT=xcodebuild -workspace $(APP).xcworkspace -scheme $(APP) clean | |
install_deps: | |
pod install | |
create_config: | |
swift package fetch | |
swift package generate-xcodeproj | |
wipe: | |
rm -rf .build $(APP).xcodeproj $(APP).xcworkspace Package.pins Pods Podfile.lock | |
test: wipe create_config install_deps | |
$(CONSTRUCT) test | xcpretty | |
build: wipe create_config install_deps | |
$(CONSTRUCT) build | xcpretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swift-tools-version:3.1 | |
import PackageDescription | |
let package = Package( | |
name: "MyApp", | |
targets: [ | |
Target( | |
name: "MyApp", | |
dependencies: []), | |
Target( | |
name: "MyAppTests", | |
dependencies: ["MyApp"]), | |
], | |
dependencies: [ | |
.Package(url: "https://github.com/oleander/MyApp.git", majorVersion: 3) | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target 'MyApp' do | |
use_frameworks! | |
pod 'A Pod' | |
target 'MyAppTests' do | |
inherit! :search_paths | |
pod "Nimble" | |
pod 'Quick' | |
end | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
config.build_settings['SWIFT_VERSION'] = '3.1' | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment