I'm developing a Framework named "MyFramework" which compatible with Carthage but I need "Alamofire" as dependency to my "MyFramework".
1) What are all options to include "Alamofire" to my "MyFramework" ?
2) What is the most recommended way ?
3) Any real life example ?
Thank you
In "MyFramework" use a Cartfile and add Alamofire as a dependency. This dependency will be passed on to whatever project depends on "MyFramework"
hi @tunidev
Cartfile file in the root directory of your project.Cartfile as usualcarthage update to resolve dependenciesCartfile.resolved and a Carthage directory where it will checkout and build dependencies Carthage/ to .gitignore file (if it doesn't exist, create one in the root directory of your project).Cartfile and Cartfile.resolved to git: git add Cartfile Cartfile.resolvedGeneral under Linked Frameworks and Libraries+ button.Framework Search Paths line.$(PROJECT_DIR)/Carthage/Build/iOShi @blender
can u confirm if we can use the copy-frameworks script on the added dependencies so that final framework can be used for app store submission as well?
I was trying to do the following steps in order to use custom framework for app-store submission:
1) Generate framework with normal approach as mentioned in Readme on carthage homepage
2) Tried running copy-framework script step to do the needful with output folder set to other than the default expected folder (was trying this as hit and trial)
intention of step 2 was to see if i can still use the script to do needful on the added dependencies.
3) copy the frameworks from step 2 location to the actual framework parth in the final target.
4) run the strip symbol script (copied from net) before archiving or so on the final custom framework.
I am currently using XCode 10 with carthage v0.30.1
You just need to add carthage copy-frameworks to a custom run script phase with the list of inout and output file as specified in the quick start guide at point 8.
You just need to add
carthage copy-frameworksto a custom run script phase with the list of inout and output file as specified in the quick start guide at point 8.
so carthage copy-frameworks this would take care of doing the needful for the main framework as well the other embedded frameworks, recursively?
You have to specify the list of frameworks on which it will act. Please follow the instructions in the Readme.
Specifically: https://github.com/Carthage/Carthage/blob/master/README.md#if-youre-building-for-ios-tvos-or-watchos
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
hi @tunidev
Cartfilefile in the root directory of your project.Cartfileas usualcarthage updateto resolve dependenciesThis will create the resolution file
Cartfile.resolvedand aCarthagedirectory where it will checkout and build dependenciesCarthage/to.gitignorefile (if it doesn't exist, create one in the root directory of your project).CartfileandCartfile.resolvedto git:git add Cartfile Cartfile.resolvedGeneralunderLinked Frameworks and LibrariesYou can do it by dragging the Frameworks files or with the
+button.Check that this last action added the frameworks path to the Build Settings in
Framework Search Pathsline.If not, you'll need to add the relative path to frameworks.
As an example this looks like this for iOS:
$(PROJECT_DIR)/Carthage/Build/iOS