I'm looking into cartfile. Can't wait to "simply create a cartfile" like all the instructions say to do.
Only... how do you "simply" create a Cartfile?
I've created a plain text document, named it cartfile and copied some dependencies in it.
Ran carthage update
inside my root project directory
Get this error: "No such file in directory"
Downloaded an example carthage project and the Cartfile is actually an executable.. So how do I "simply create" a Cartfile, cause there aren't any instructions on how to
Save the file, open the Terminal, navigate to the project's folder and run carthage update . Drag the framework from Carthage/Build/iOS/GSKit. framework to the Linked Frameworks and Libraries in the target in Xcode. All done!
The Cartfile. resolved file ensures that any given commit of a Carthage project can be bootstrapped in exactly the same way, every time. For this reason, you are strongly recommended to commit this file to your repository.
If you've modified your Cartfile, or you want to update to the newest versions of each framework (subject to the requirements you've specified), simply run the carthage update command again. If you only want to update one, or specific, dependencies, pass them as a space-separated list to the update command.
From the command line, navigate to your project directory.
touch Cartfile
Now the Cartfile is created, make it executable with:
chmod +x [YourDirectory/Cartfile]
You can open it with any text editor. Then insert whatever library and source you want (Example: github "SwiftyJSON/SwiftyJSON" >= 2.1.2
)
Carthage Tutorial: Getting Started is a must read. It explains things much better than the Carthage documentation does.
In a Terminal, cd
to the root directory of the project that you want to add the framework to. This should be the same directory as your *.xcodeproj file.
cd ~/Path/To/Your/Project/
Create an empty file called Cartfile like this:
touch Cartfile
Open that file with Xcode:
open -a Xcode Cartfile
Paste the framework info that you need into the Cartfile. For example:
github "stephencelis/SQLite.swift" ~> 0.10.1
Close the file in Xcode and in Terminal run the following command to make Carthage update the dependencies in your project. (You should still be in the same directory as your Cartfile.)
carthage update --platform iOS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With