19

I was wondering if there is something like private pods in Carthage, I have a couple of frameworks and I'm currently using git submodules, I started using Carthage for a new project and is pretty nice but so far I just configured it to manage third party Frameworks dependencies. I've checked the carthage documentation but is not that clear on how to set it up. Does Carthage work only with Github repos? Can it work with Atlassian-Stash(now Bitbucket)? If so how?

Black Sheep
  • 1,665
  • 1
  • 22
  • 32

3 Answers3

34

So I finally found out how to setup Carthage with a Atlassian-Bitbucket

on the Cartfile i Just need to define the dependency origin which is the git repository

Enterprise git repository like Atlassian-Stash(Bitbucket)

git "https://stashRepo" 

it also works with ssh://

Or local project

git "file:///directory/to/project" "branch"  

UPDATE

Carthage has now added extra documentation on how the OGDL works in the Cartfile

Black Sheep
  • 1,665
  • 1
  • 22
  • 32
0

Solutions to Carthage Development Framework

To code a framework in a way similar to developing using CocoaPods Development Pods, there are solutions ready to used with Carthage.

Solution 1 - The Local Path Way

This solution is quiet convenient than alternative solutions.

Step 1. Add local path into Cartfile

For example,

Add local path into Cartfile

git "PATH_TO_LOCAL_DEVELOPING_FRAMEWORK_SOURCE_ROOT_DIRECTORY" "BRANCH_NAME"

Step 2. Update Carthage dependency

For example,

Update Carthage dependency using Cartfile

$ carthage update $DEVELOPING_FRAMEWORK_NAME --platform iOS --cache-builds --configuration Debug

To debug with breakpoints or to develop a framework in main project, add developing framework project reference $(DEVELOPING_FRAMEWORK).xcodeproj into the main application, and build the main app in Xcode.

Caution

Remove developing overhead (such as the changes in $(MAIN_APP_NAME).xcodeproj/project.pbxproj due to the addition of developing framework project reference) before committing the changes to remote repo.

Solution 2 - The Symbolic Linking Way

Tested Environment

  • Xcode 10.1
  • macOS 10.13.6
George
  • 3,384
  • 5
  • 40
  • 64
0

Cartfile source location

[Dependency manager]

github - GitHub repository

github "<owner>/<repo>" //GitHub.com
github "https://<path>" //GitHub Enterprise Server

git - Git repository

git "https://<path>" //remote
git "ssh://<command>" //ssh connection
git "file:///<path>" "<branch_name>" //local

binary - precompiled binary

binary "https://<path>.json" //remote
binary "file:///<path>.json" //local

Please note that file:/ is used for local files which is useful for developing/debugging dependency. Do not forget to commit changes before using git

[Local CocoaPods] [Local SPM]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205