Giter VIP home page Giter VIP logo

carthage's Introduction

Carthage GitHub license GitHub release Reviewed by Hound

Carthage is intended to be the simplest way to add frameworks to your Cocoa application.

Carthage builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Carthage does not automatically modify your project files or your build settings.

Quick Start

  1. Get Carthage by running brew install carthage or choose another installation method

  2. Create a Cartfile in the same directory where your .xcodeproj or .xcworkspace is

  3. List the desired dependencies in the Cartfile, for example:

    github "Alamofire/Alamofire" ~> 5.5
    
  4. Run carthage update --use-xcframeworks

  5. A Cartfile.resolved file and a Carthage directory will appear in the same directory where your .xcodeproj or .xcworkspace is

  6. Drag the built .xcframework bundles from Carthage/Build into the "Frameworks and Libraries" section of your application’s Xcode project.

  7. If you are using Carthage for an application, select "Embed & Sign", otherwise "Do Not Embed".

For an in depth guide, read on from Adding frameworks to an application

Installing Carthage

There are multiple options for installing Carthage:

  • Installer: Download and run the Carthage.pkg file for the latest release, then follow the on-screen instructions. If you are installing the pkg via CLI, you might need to run sudo chown -R $(whoami) /usr/local first.

  • Homebrew: You can use Homebrew and install the carthage tool on your system simply by running brew update and brew install carthage. (note: if you previously installed the binary version of Carthage, you should delete /Library/Frameworks/CarthageKit.framework).

  • MacPorts: You can use MacPorts and install the carthage tool on your system simply by running sudo port selfupdate and sudo port install carthage. (note: if you previously installed the binary version of Carthage, you should delete /Library/Frameworks/CarthageKit.framework).

  • From source: If you’d like to run the latest development version (which may be highly unstable or incompatible), simply clone the master branch of the repository, then run make install. Requires Xcode 10.0 (Swift 4.2).

Adding frameworks to an application

Once you have Carthage installed, you can begin adding frameworks to your project. Note that Carthage only supports dynamic frameworks, which are only available on iOS 8 or later (or any version of OS X).

Getting started

Building platform-independent XCFrameworks (Xcode 12 and above)

  1. Create a Cartfile that lists the frameworks you’d like to use in your project.
  2. Run carthage update --use-xcframeworks. This will fetch dependencies into a Carthage/Checkouts folder and build each one or download a pre-compiled XCFramework.
  3. On your application targets’ General settings tab, in the Frameworks, Libraries, and Embedded Content section, drag and drop each XCFramework you want to use from the Carthage/Build folder on disk.
Migrating a project from framework bundles to XCFrameworks

We encourage using XCFrameworks as of version 0.37.0 (January 2021), and require XCFrameworks when building on an Apple Silicon Mac. Switching from discrete framework bundles to XCFrameworks requires a few changes to your project:

Migration steps
  1. Delete your Carthage/Build folder to remove any existing framework bundles.
  2. Build new XCFrameworks by running carthage build --use-xcframeworks. Any other arguments you build with can be provided like normal.
  3. Remove references to the old frameworks in each of your targets:
    • Delete references to Carthage frameworks from the target's Frameworks, Libraries, and Embedded Content section and/or its Link Binary with Libraries build phase.
    • Delete references to Carthage frameworks from any Copy Files build phases.
    • Delete the target's carthage copy-frameworks build phase, if present.
  4. Add references to XCFrameworks in each of your targets:
    • For an application target: In the General settings tab, in the Frameworks, Libraries, and Embedded Content section, drag and drop each XCFramework you use from the Carthage/Build folder on disk.
    • For a framework target: In the Build Phases tab, in a Link Binary with Libraries phase, drag and drop each XCFramework you use from the Carthage/Build folder on disk.

Building platform-specific framework bundles (default for Xcode 11 and below)

Xcode 12+ incompatibility: Multi-architecture platforms are not supported when building framework bundles in Xcode 12 and above. Prefer building with XCFrameworks. If you need to build discrete framework bundles, use a workaround xcconfig file.

If you're building for macOS
macOS-specific instructions
  1. Create a Cartfile that lists the frameworks you’d like to use in your project.
  2. Run carthage update --platform macOS. This will fetch dependencies into a Carthage/Checkouts folder and build each one or download a pre-compiled framework.
  3. On your application targets’ General settings tab, in the Embedded Binaries section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

Additionally, you'll need to copy debug symbols for debugging and crash reporting on OS X.

  1. On your application target’s Build Phases settings tab, click the + icon and choose New Copy Files Phase.
  2. Click the Destination drop-down menu and select Products Directory.
  3. For each framework you’re using, drag and drop its corresponding dSYM file.
If you're building for iOS, tvOS, or watchOS
Platform-specific instructions
  1. Create a Cartfile that lists the frameworks you’d like to use in your project.

  2. Run carthage update. This will fetch dependencies into a Carthage/Checkouts folder, then build each one or download a pre-compiled framework.

  3. Open your application targets’ General settings tab. For Xcode 11.0 and higher, in the "Frameworks, Libraries, and Embedded Content" section, drag and drop each framework you want to use from the Carthage/Build folder on disk. Then, in the "Embed" section, select "Do Not Embed" from the pulldown menu for each item added. For Xcode 10.x and lower, in the "Linked Frameworks and Libraries" section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

  4. On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:

    /usr/local/bin/carthage copy-frameworks
  5. Create a file named input.xcfilelist and a file named output.xcfilelist

  6. Add the paths to the frameworks you want to use to your input.xcfilelist. For example:

    $(SRCROOT)/Carthage/Build/iOS/Result.framework
    $(SRCROOT)/Carthage/Build/iOS/ReactiveSwift.framework
    $(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework
    
  7. Add the paths to the copied frameworks to the output.xcfilelist. For example:

    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Result.framework
    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/ReactiveSwift.framework
    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/ReactiveCocoa.framework
    

    With output files specified alongside the input files, Xcode only needs to run the script when the input files have changed or the output files are missing. This means dirty builds will be faster when you haven't rebuilt frameworks with Carthage.

  8. Add the input.xcfilelist to the "Input File Lists" section of the Carthage run script phase

  9. Add the output.xcfilelist to the "Output File Lists" section of the Carthage run script phase

This script works around an App Store submission bug triggered by universal binaries and ensures that necessary bitcode-related files and dSYMs are copied when archiving.

With the debug information copied into the built products directory, Xcode will be able to symbolicate the stack trace whenever you stop at a breakpoint. This will also enable you to step through third-party code in the debugger.

When archiving your application for submission to the App Store or TestFlight, Xcode will also copy these files into the dSYMs subdirectory of your application’s .xcarchive bundle.

For all platforms

Along the way, Carthage will have created some build artifacts. The most important of these is the Cartfile.resolved file, which lists the versions that were actually built for each framework. Make sure to commit your Cartfile.resolved, because anyone else using the project will need that file to build the same framework versions.

(Optionally) Add build phase to warn about outdated dependencies

You can add a Run Script phase to automatically warn you when one of your dependencies is out of date.

  1. On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:
/usr/local/bin/carthage outdated --xcode-warnings 2>/dev/null

Swift binary framework download compatibility

Carthage will check to make sure that downloaded Swift (and mixed Objective-C/Swift) frameworks were built with the same version of Swift that is in use locally. If there is a version mismatch, Carthage will proceed to build the framework from source. If the framework cannot be built from source, Carthage will fail.

Because Carthage uses the output of xcrun swift --version to determine the local Swift version, make sure to run Carthage commands with the Swift toolchain that you intend to use. For many use cases, nothing additional is needed. However, for example, if you are building a Swift 2.3 project using Xcode 8.x, one approach to specifying your default swift for carthage bootstrap is to use the following command:

TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage bootstrap

Running a project that uses Carthage

After you’ve finished the above steps and pushed your changes, other users of the project only need to fetch the repository and run carthage bootstrap to get started with the frameworks you’ve added.

Adding frameworks to unit tests or a framework

Using Carthage for the dependencies of any arbitrary target is fairly similar to using Carthage for an application. The main difference lies in how the frameworks are actually set up and linked in Xcode.

Because unit test targets are missing the Linked Frameworks and Libraries section in their General settings tab, you must instead drag the built frameworks to the Link Binaries With Libraries build phase.

In the Test target under the Build Settings tab, add @loader_path/Frameworks to the Runpath Search Paths if it isn't already present.

In rare cases, you may want to also copy each dependency into the build product (e.g., to embed dependencies within the outer framework, or make sure dependencies are present in a test bundle). To do this, create a new Copy Files build phase with the Frameworks destination, then add the framework reference there as well. You shouldn't use the carthage copy-frameworks command since test bundles don't need frameworks stripped, and running concurrent instances of copy-frameworks (with parallel builds turn on) is not supported.

Upgrading frameworks

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. e.g.

carthage update Box

or

carthage update Box Result
Experimental Resolver

A rewrite of the logic for upgrading frameworks was done with the aim of increasing speed and reducing memory usage. It is currently an opt-in feature. It can be used by passing --new-resolver to the update command, e.g.,

carthage update --new-resolver Box

If you are experiencing performance problems during updates, please give the new resolver a try

Nested dependencies

If the framework you want to add to your project has dependencies explicitly listed in a Cartfile, Carthage will automatically retrieve them for you. You will then have to drag them yourself into your project from the Carthage/Build folder.

If the embedded framework in your project has dependencies to other frameworks you must link them to application target (even if application target does not have dependency to that frameworks and never uses them).

Using submodules for dependencies

By default, Carthage will directly check out dependencies’ source files into your project folder, leaving you to commit or ignore them as you choose. If you’d like to have dependencies available as Git submodules instead (perhaps so you can commit and push changes within them), you can run carthage update or carthage checkout with the --use-submodules flag.

When run this way, Carthage will write to your repository’s .gitmodules and .git/config files, and automatically update the submodules when the dependencies’ versions change.

Automatically rebuilding dependencies

If you want to work on your dependencies during development, and want them to be automatically rebuilt when you build your parent project, you can add a Run Script build phase that invokes Carthage like so:

/usr/local/bin/carthage build --platform "$PLATFORM_NAME" --project-directory "$SRCROOT"

Note that you should be using submodules before doing this, because plain checkouts should not be modified directly.

Caching builds

By default Carthage will rebuild a dependency regardless of whether it's the same resolved version as before. Passing the --cache-builds will cause carthage to avoid rebuilding a dependency if it can. See information on version files for details on how Carthage performs this caching.

Note: At this time --cache-builds is incompatible with --use-submodules. Using both will result in working copy and committed changes to your submodule dependency not being correctly rebuilt. See #1785 for details.

Bash/Zsh/Fish completion

Auto completion of Carthage commands and options are available as documented in Bash/Zsh/Fish Completion.

Supporting Carthage for your framework

Carthage only officially supports dynamic frameworks. Dynamic frameworks can be used on any version of OS X, but only on iOS 8 or later. Additionally, since version 0.30.0 Carthage supports static frameworks.

Because Carthage has no centralized package list, and no project specification format, most frameworks should build automatically.

The specific requirements of any framework project are listed below.

Share your Xcode schemes

Carthage will only build Xcode schemes that are shared from your .xcodeproj. You can see if all of your intended schemes build successfully by running carthage build --no-skip-current, then checking the Carthage/Build folder.

If an important scheme is not built when you run that command, open Xcode and make sure that the scheme is marked as Shared, so Carthage can discover it.

Resolve build failures

If you encounter build failures in carthage build --no-skip-current, try running xcodebuild -scheme SCHEME -workspace WORKSPACE build or xcodebuild -scheme SCHEME -project PROJECT build (with the actual values) and see if the same failure occurs there. This should hopefully yield enough information to resolve the problem.

If you have multiple versions of the Apple developer tools installed (an Xcode beta, for example), use xcode-select to change which version Carthage uses.

If you’re still not able to build your framework with Carthage, please open an issue and we’d be happy to help!

Tag stable releases

Carthage determines which versions of your framework are available by searching through the tags published on the repository, and trying to interpret each tag name as a semantic version. For example, in the tag v1.2, the semantic version is 1.2.0.

Tags without any version number, or with any characters following the version number (e.g., 1.2-alpha-1) are currently unsupported, and will be ignored.

Archive prebuilt frameworks into zip files

Carthage can automatically use prebuilt frameworks, instead of building from scratch, if they are attached to a GitHub Release on your project’s repository or via a binary project definition file.

To offer prebuilt frameworks for a specific tag, the binaries for all supported platforms should be zipped up together into one archive, and that archive should be attached to a published Release corresponding to that tag. The attachment should include .framework in its name (e.g., ReactiveCocoa.framework.zip), to indicate to Carthage that it contains binaries. The directory structure of the archive is free form but, frameworks should only appear once in the archive as they will be copied to Carthage/Build/<platform> based on their name (e.g. ReactiveCocoa.framework).

To offer prebuilt XCFrameworks, build with --use-xcframeworks and follow the same process to zip up all XCFrameworks into one archive. Include .xcframework in the attachment name. Starting in version 0.38.0, Carthage prefers downloading .xcframework attachments when --use-xcframeworks is passed.

You can perform the archiving operation with carthage itself using:

-carthage build --no-skip-current
-carthage archive YourFrameworkName

or alternatively

carthage build --archive

Draft Releases will be automatically ignored, even if they correspond to the desired tag.

Use travis-ci to upload your tagged prebuilt frameworks

It is possible to use travis-ci in order to build and upload your tagged releases.

  1. Install travis CLI with gem install travis

  2. Setup travis-ci for your repository (Steps 1 and 2)

  3. Create .travis.yml file at the root of your repository based on that template. Set FRAMEWORK_NAME to the correct value.

    Replace PROJECT_PLACEHOLDER and SCHEME_PLACEHOLDER

    If you are using a workspace instead of a project remove the xcode_project line and uncomment the xcode_workspace line.

    The project should be in the format: MyProject.xcodeproj

    The workspace should be in the format: MyWorkspace.xcworkspace

    Feel free to update the xcode_sdk value to another SDK, note that testing on iphoneos SDK would require you to upload a code signing identity

    For more informations you can visit travis docs for objective-c projects

    language: objective-c
    osx_image: xcode7.3
    xcode_project: <PROJECT_PLACEHOLDER>
    # xcode_workspace: <WORKSPACE_PLACEHOLDER>
    xcode_scheme: <SCHEME_PLACEHOLDER>
    xcode_sdk: iphonesimulator9.3
    env:
      global:
        - FRAMEWORK_NAME=<THIS_IS_A_PLACEHOLDER_REPLACE_ME>
    before_install:
      - brew update
      - brew outdated carthage || brew upgrade carthage
    before_script:
      # bootstrap the dependencies for the project
      # you can remove if you don't have dependencies
      - carthage bootstrap
    before_deploy:
      - carthage build --no-skip-current
      - carthage archive $FRAMEWORK_NAME
  4. Run travis setup releases, follow documentation here

    This command will encode your GitHub credentials into the .travis.yml file in order to let travis upload the release to GitHub.com When prompted for the file to upload, enter $FRAMEWORK_NAME.framework.zip

  5. Update the deploy section to run on tags:

    In .travis.yml locate:

    on:
      repo: repo/repo

    And add tags: true and skip_cleanup: true:

    skip_cleanup: true
    on:
      repo: repo/repo
      tags: true

    That will let travis know to create a deployment when a new tag is pushed and prevent travis to cleanup the generated zip file

Build static frameworks to speed up your app’s launch times

If you embed many dynamic frameworks into your app, its pre-main launch times may be quite slow. Carthage is able to help mitigate this by building your dynamic frameworks as static frameworks instead. Static frameworks can be linked directly into your application or merged together into a larger dynamic framework with a few simple modifications to your workflow, which can result in dramatic reductions in pre-main launch times.

Carthage 0.30.0 or higher

Since version 0.30.0 Carthage project rolls out support for statically linked frameworks written in Swift or Objective-C, support for which has been introduced in Xcode 9.4. Please note however that it specifically says frameworks, hence Darwin bundles with .framework extension and statically linked object archives inside. Carthage does not currently support static library schemes, nor are there any plans to introduce their support in the future.

The workflow differs barely:

  • You still need to tick your Carthage-compliant project's schemes as shared in Product > Scheme > Manage Schemes..., just as with dynamic binaries
  • You still need to link against static .frameworks in your project's Build Phases just as with dynamic binaries

However:

  • In your Carthage-compliant project's Cocoa Framework target's Build Settings, Linking section, set Mach-O Type to Static Library
  • Your statically linked frameworks will be built at ./Carthage/Build/$(PLATFORM_NAME)/Static
  • You should not add any of static frameworks as input/output files in carthage copy-frameworks Build Phase

Carthage 0.29.0 or lower

See the StaticFrameworks doc for details.

Please note that a few caveats apply to this approach:

  • Swift static frameworks are not officially supported by Apple
  • This is an advanced workflow that is not built into Carthage, YMMV

Declare your compatibility

Want to advertise that your project can be used with Carthage? You can add a compatibility badge:

Carthage compatible

… to your README, by simply inserting the following Markdown:

[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Known issues

DWARFs symbol problem

Pre-built framework cannot be debugged using step execution on other machine than on which the framework was built. Simply carthage bootstrap/build/update --no-use-binaries should fix this, but for more automated workaround, see #924. Dupe rdar://23551273 if you want Apple to fix the root cause of this problem.

CarthageKit

Most of the functionality of the carthage command line tool is actually encapsulated in a framework named CarthageKit.

If you’re interested in using Carthage as part of another tool, or perhaps extending the functionality of Carthage, take a look at the CarthageKit source code to see if the API fits your needs.

Differences between Carthage and CocoaPods

CocoaPods is a long-standing dependency manager for Cocoa. So why was Carthage created?

Firstly, CocoaPods (by default) automatically creates and updates an Xcode workspace for your application and all dependencies. Carthage builds framework binaries using xcodebuild, but leaves the responsibility of integrating them up to the user. CocoaPods’ approach is easier to use, while Carthage’s is flexible and unintrusive.

The goal of CocoaPods is listed in its README as follows:

… to improve discoverability of, and engagement in, third party open-source libraries, by creating a more centralized ecosystem.

By contrast, Carthage has been created as a decentralized dependency manager. There is no central list of projects, which reduces maintenance work and avoids any central point of failure. However, project discovery is more difficult—users must resort to GitHub’s Trending pages or similar.

CocoaPods projects must also have what’s known as a podspec file, which includes metadata about the project and specifies how it should be built. Carthage uses xcodebuild to build dependencies, instead of integrating them into a single workspace, it doesn’t have a similar specification file but your dependencies must include their own Xcode project that describes how to build their products.

Ultimately, we created Carthage because we wanted the simplest tool possible—a dependency manager that gets the job done without taking over the responsibility of Xcode, and without creating extra work for framework authors. CocoaPods offers many amazing features that Carthage will never have, at the expense of additional complexity.

License

Carthage is released under the MIT License.

Header backdrop photo is released under the CC BY-NC-SA 2.0 license. Original photo by Richard Mortel.

carthage's People

Contributors

abbeycode avatar alanjrogers avatar aranoledur avatar baek-jinoo avatar bigboybad avatar bobeldevil avatar chuganzy avatar davidbrunow avatar elliottwilliams avatar erichoracek avatar flovilmart avatar giginet avatar ikesyo avatar iv-mexx avatar jasonboyle avatar jdhealy avatar jspahrsummers avatar lilyball avatar marcoconti83 avatar mattprowse avatar mdiep avatar nachosoto avatar nafu avatar norio-nomura avatar robb avatar robrix avatar scottrhoyt avatar sidepelican avatar tmspzz avatar younata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carthage's Issues

Automatically match up platforms for dependencies and application

Imagine this dependency structure:

  1. Mac Application depends upon…
  2. OctoKit Mac depends upon…
  3. ReactiveCocoa Mac

How do we know which ReactiveCocoa scheme to build when a command like carthage build is executed?

We could maybe figure it out by trying to align the architectures of each project, but that seems like a pretty hairy yak, and error-prone.

For iOS, we also need to consider the fact that iPhoneOS and iPhoneSimulator are two different platforms, and frameworks will accordingly need to be built for both.

It seems like the simplest solution might be to build all schemes of a project, then place the built frameworks into platform-specific directories. If we can use some magic Xcode configuration variable to find the right folders, and frameworks therein, maybe everything will Just Work™?

Carthage-managed submodules

Since Carthage has to create bare clones Git repositories of all your dependencies anyways, it could also git submodule add each repository into your local project folder—but use a local clone path instead of a remote URL. This would allow you to use Carthage as usual, but still have versioned submodules (if you're into it).

We could even make this clever and write the remote URL into .gitmodules, but use the local URL for cloning and updating the submodule in the particular user's working directory. This would allow you to set up a project with Carthage, but consume it with plain Git machinery.

Unfriendly prompt for username/password

After running sudo make install, I tried running carthage update in the project's root directory. I guess I've never entered my credentials for HTTPS cloning, since I was suddenly prompted to do so--once for each dependency!

$ carthage update
*** Cloning ReactiveCocoa
*** Cloning LlamaKit
*** Cloning Quick
*** Cloning xcconfigs
*** Cloning Nimble
Username for 'https://github.com': Username for 'https://github.com': Username for 'https://github.com': Username for 'https://github.com': Username for 'https://github.com':

I'm not sure if entering my username/password 5 times would have done the trick. But the following change fixed my problem:

diff --git a/CarthageKit/GitHub.swift b/CarthageKit/GitHub.swift
index 84f5714..966ee92 100644
--- a/CarthageKit/GitHub.swift
+++ b/CarthageKit/GitHub.swift
@@ -16,7 +16,7 @@ public struct Repository: Equatable {

    /// The URL string that should be used for cloning the Git repository.
    public var cloneURLString: String {
-       return "https://github.com/\(owner)/\(name).git"
+       return "[email protected]:\(owner)/\(name).git"
    }

    public init(owner: String, name: String) {

I also tried caching my username/password, but I couldn't authenticate. Maybe because I use 2-factor authentication? Not sure.

Suggestions:

  • HTTPS cloning is uncool. Why not SSH? Or an option to choose (sorry if that already exists).
  • It'd be nice to at least do one prompt at a time.

Empty errors

Scrub the codebase for uses of RACError.Empty or failure() without an argument, and replace them with real, informative errors.

Automatically aggregate build products in one, consistent location

Originally from #8.

The intention is that a Carthage user should be able to drag-and-drop a framework built by Carthage into their project/workspace, and have it Just Work™ going forward—even when building for a different platform, or if the dependency version changes, or when a different build configuration is chosen.

This might mean using Xcode's BUILT_PRODUCTS_DIR, but that worries me because it can get deleted frequently, and doesn't let users commit binaries to source control (if desired).

It might be easier to use a common, top-level subfolder of the application's repository. Users who don't want to commit the binaries can ignore this folder. However, this might require adding some search paths to their project settings.

`carthage build`

This command should use xcodebuild (or perhaps xctool) to build a linkable binary framework from your project.

The functionality here will eventually be part of the larger “set up my dependencies” command.

Public release checklist

  • Reach out to CocoaPods folks ahead of time
  • Tease about Carthage on Twitter, prior to opening it up
  • Publish GitHub release, along with a pkg installer
  • Change repo tagline
  • Dark ship the org (make everything public, with no announcement)
  • Actually, officially announce everything

Note that projects must have frameworks

Ideally dynamic frameworks (though these are iOS 8+).

I haven't checked whether roll-your-own static frameworks are supported, but I don't see why they'd have any trouble. Still, it might be easier to advise framework authors to just create dynamic framework targets.

Dependencies can't find their nested dependencies

If I put ReactiveCocoa into my Cartfile, how is it supposed to find its copy of LlamaKit to build successfully? Right now, everything is dropped at the application level, but it seems like we'll need symlinks or something into every dependency, so they can find each other.

Allow CWD to be overridden

Most of our commands default to the working directory of carthage, but we should always allow an arbitrary directory path to be passed in.

External Cartfile specifications for dependencies

It'd be nice to inject a custom Cartfile for use by a dependency of your project—in other words, specify external Cartfiles for dependencies listed in your top-level Cartfile.

I can foresee a few uses for this:

  1. Updating a project's dependencies before the maintainers are able to do so themselves, without needing to fork the project
  2. Relaxing a project's dependency requirements, if they've been specified too strictly
  3. Using Carthage on projects that have no awareness of it, or no desire to use it

That last point might make this a candidate for our initial release, since few—if any—projects will have Cartfiles when this repository is made public.

@Carthage/owners Any thoughts on whether this should be a prerequisite to shipping?

`carthage bootstrap`

This should:

  1. Download all dependencies, recursively
  2. Check out the locked version of each dependency
  3. Build all dependencies (#38)
  4. Put all built frameworks into a known location that the application project can link to (#39)

If a Cartfile.lock does not yet exist when this command is run, it should be equivalent to carthage update instead (and probably spit out a warning).

Review public API

Our API is super subject to change, so I'm not too fussed, but we should take a quick scan over the visibility annotations in CarthageKit and make sure that public is only applied to those APIs that make sense to export (or test).

I think anything public should meet at least one of the following criteria:

  • Non-trivial or duplicative for an application to implement themselves (e.g., most things to do with Xcode integration)
  • Part of the core functionality of Carthage (e.g., Cartfile parsing)
  • Exercised in the test target (because Swift is unable to use internal for this)

Anyone disagree with that list?

`carthage update`

This should:

  1. Download all dependencies, recursively
  2. Check out the latest version of each dependency that will satisfy all version requirements—or bail out, if the requirements conflict (#7)
  3. Write the resolved dependency version information to Cartfile.lock
  4. Build all dependencies (#38)
  5. Put all built frameworks into a known location that the application project can link to (#39)

Submodules of dependencies aren't checked out correctly

Discovered while testing #57. git clone --recursive doesn't do anything with bare repos, and git checkout (rightly) won't automatically update submodules.

Since the .gitmodules file is checked out to something that's not the top-level, git submodule init doesn't even work. We'll need to do something better.

Sudoless Install

Now, I'm very unfamiliar with Mac development but I think a sudoless install will provide a better user experience.

The obstacle seems to be the /Library/Frameworks folder.

Can the Framework be bundled into the binary, or can it be put in ~/Library/Frameworks?

GitHub Releases support

We should support cloning and building arbitrary tags to start with, but maybe there's something we can do specifically with capital-R Releases that would be interesting.

For example, if a release has detailed notes, maybe we could present those somehow. Or if it has binaries attached, maybe we can use those instead of building our own from scratch (extra important given that every Xcode update breaks something).

Local origin?

How would I specify a local git repository as an origin?

Default binary path is tricky to set up in parent projects

Apparently Xcode can't figure out that it can locate modules in Carthage.build/{Mac,iOS}, even if you drag a framework from the folder into the parent project.

That means the current installation steps look like:

  1. carthage {bootstrap,update,build} on the command line.
  2. For a framework ReactiveCocoa, drag platform-specific ReactiveCocoa.frameworks into the project, or add -framework ReactiveCocoa to the linker flags.
  3. Add Carthage.build/Mac to the Framework Search Paths for any OS X target(s), and Carthage.build/iOS to the Framework Search Paths for any iOS target(s). Sharing the path between both targets fails spectacularly.

I'd love to make that final step unnecessary, or at least use some Xcode build setting that lets the user add just one Framework Search Path—something like Carthage.build/$(SDKROOT), but not as fragile.

Prettify `carthage build` output

It's super noisy right now because we basically pass through xcodebuild output unimpeded. Maybe we should instead route all of that to a file, only show progress (e.g., Building scheme “ReactiveCocoa Mac” for OS X), and then inject errors if they occur.

Homebrew formula

Write and submit a formula to Homebrew, for even easier installation.

Depends on #18.

Cartfile.lock

We need a file to track which versions we resolved for dependencies, so checking out a past commit results in consistent dependency versions everytime.

Specify which configuration to use for `carthage build`

Originally from #8.

So, e.g., carthage build -configuration Debug would give you debug versions of all dependencies.

Eventually, we could do something more automatic, but this would be an easy first step to support customization.

Check out dependencies specified in Cartfile

We should clone dependencies—and their dependencies’ dependencies—while trying to find the versions of everything that match what's specified in the config.

Where would these checkouts live? A global folder, or something inside the repository? The latter could be useful if you want to commit your dependencies (to protect against them disappearing).

Update notifications

Carthage should notify you (politely) that a new version is available and perhaps even offer to open the URL to the newest release.

Auto updating will depend on this; notifications are a start.

Parse Cartfile for specifying dependencies and versions

A very basic first pass could perhaps use GitHub repository names and specific tags/releases to match.

One thing is clear: these files should not allow arbitrary code. They should just be a configuration file format.

Create Installer package

This package should install carthage into /usr/local/bin and CarthageKit.framework into /Library/Frameworks.

In other words, sudo make install, but as a nice binary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.