{"id":27923343,"url":"https://github.com/kayak/carthage_remote_cache","last_synced_at":"2025-05-06T22:32:33.897Z","repository":{"id":29226760,"uuid":"120472697","full_name":"kayak/carthage_remote_cache","owner":"kayak","description":"Centralized cache to serve carthage frameworks. Useful for distributed CI setup with several build machines.","archived":false,"fork":false,"pushed_at":"2025-03-11T02:42:20.000Z","size":149,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T16:16:14.663Z","etag":null,"topics":["apple","bcsymbolmap","cache","cartfile","carthage","dsym","dsym-files","framework","ios","launchagent","mac","macos","ruby","ruby-gem","serve-carthage-frameworks","swift","tvos","versioning","watchos","xcode"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kayak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-06T14:46:49.000Z","updated_at":"2025-02-13T21:38:56.000Z","dependencies_parsed_at":"2023-11-23T22:32:04.937Z","dependency_job_id":"56bcf696-94b9-4ce2-83a9-5eac6966d6d5","html_url":"https://github.com/kayak/carthage_remote_cache","commit_stats":{"total_commits":98,"total_committers":4,"mean_commits":24.5,"dds":"0.11224489795918369","last_synced_commit":"6098e6269a7abfdb7dcb9bea2f3f996884454580"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fcarthage_remote_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fcarthage_remote_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fcarthage_remote_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fcarthage_remote_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayak","download_url":"https://codeload.github.com/kayak/carthage_remote_cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779472,"owners_count":21802957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","bcsymbolmap","cache","cartfile","carthage","dsym","dsym-files","framework","ios","launchagent","mac","macos","ruby","ruby-gem","serve-carthage-frameworks","swift","tvos","versioning","watchos","xcode"],"created_at":"2025-05-06T22:32:23.233Z","updated_at":"2025-05-06T22:32:33.885Z","avatar_url":"https://github.com/kayak.png","language":"Ruby","readme":"# CarthageRemoteCache\n\n[![Test Status](https://github.com/kayak/carthage_remote_cache/actions/workflows/ruby.yml/badge.svg)](https://github.com/kayak/carthage_remote_cache/actions/workflows/ruby.yml)\n[![Gem Version](https://badge.fury.io/rb/carthage_remote_cache.svg)](https://badge.fury.io/rb/carthage_remote_cache)\n\nCentralized cache to serve Carthage frameworks. Useful for distributed CI setup with several build machines. It's aware of your `xcodebuild` and `swift` versions and builds on top of Carthage's `.xyz.version` file mechanism.\n\n## Installation\n\nThe gem is published at [rubygems.org](https://rubygems.org/gems/carthage_remote_cache), installation is as easy as:\n\n    $ gem install carthage_remote_cache\n\n_Note: Installing ri documentation for sinatra can be quite slow. Install with_ `--no-rdoc --no-ri` _if you don't want to wait._\n\n## Quickstart\n\n1. Run `carthagerc server` to start the cache on a remote server\n2. `cd` to your project's root folder\n3. Run `carthagerc init` to create `Cartrcfile` and point the server property to your  running server URL\n4. Assuming your `Carthage` directory is already built, run `carthagerc upload` to populate remote cache\n5. Push your `Cartrcfile` and from a different machine run `cartrcfile download` to fetch frameworks into `Carthage/Build/` folder\n6. Build your app without having to wait for `carthage bootstrap`\n\n## Usage\n\n### Init\n\nBefore running any other commands, it's required to initialize `carthagerc` in your project directory by running:\n\n    $ carthagerc init\n\nWhich produces a `Cartrcfile`. Configuration is done via plain `ruby` code, so it is as simple as:\n\n    Configuration.setup do |c|\n      c.server = \"http://localhost:9292/\"\n    end\n\n`Cartrcfile` is supposed to be version controlled (e.g. included in git repository), so that it lives along your code and all consumers of the repository have access to same configuration.\n\n### Upload Workflow\n\nMake sure that all your framework binaries have been built with `carthage`, otherwise there is nothing to upload.\n\n    $ carthage bootstrap\n\nStart the upload with:\n\n    $ carthagerc upload\n\nAfter couple of seconds you should be able to see confirmation in terminal:\n\n    Uploaded 53 archives (97.2 MB), skipped 0.\n\n#### Overwriting Existing Cache\n\nAttempting to run `carthagerc upload` again will not upload any framework binaries, since all of them are already present on the cache server:\n\n    Uploaded 0 archives (0.0 MB), skipped 53.\n\nIf your cache happens to be tainted by invalid framework binaries, you can overwrite existing cache with\n\n    $ carthagerc upload --force\n\n#### Upgrading Xcode or Swift\n\nIt is recommended to always perform the upload workflow after upgrading Xcode and Swift versions since `carthagerc` cached frameworks are not only bound to framework versions, but also to your build environment.\n\n### Download Workflow\n\nOnce the cache server has been populated with framework binaries, it's time to fetch frameworks from a different machine. Make sure to pull in `Cartrcfile` from the repository before executing:\n\n    $ carthagerc download\n\nYou should expect to see the following output on a machine with empty `Carthage` folder:\n\n    Downloaded and extracted 53 archives (97.2 MB), skipped 0 archives.\n\nYour project should be ready for building.\n\n#### Overwrite Local Carthage Folder\n\nIn case you happen to change a file in `Carthage/Build` by accident, it's possible to force download all frameworks again with:\n\n    $ carthagerc download --force\n\n#### Download Only Some Platforms\n\nThe example above downloaded all frameworks for all platforms (iOS, macOS, tvOS, watchOS). If large dependencies or network speed are an issue, you can download only a subset of the platforms by using the `--platform` argument:\n\n    $ carthagerc download --platform iOS,macOS,tvOS,watchOS\n\nPlease note, that invoking the `download` command multiple times with different platform arguments is not supported. The `.version` file will \"forget\" that `carthagerc` already downloaded the platform specified before the last download. If you need multiple platforms, specify them in a single `download` command once, delimited with a comma.\n\n### Config\n\nTo get a quick overview on Xcode / Swift / Framework versions, execute\n\n    $ carthagerc config\n\nWhich will print similar information:\n\n    Xcodebuild: 9C40b\n    ---\n    Swift: 4.0.3\n    ---\n    Server: http://localhost:9292/\n    ---\n    Cartfile.resolved:\n    github \"kayak/attributions\" \"0.3\"\n    ---\n    Local Build Frameworks:\n    Attributions 0.3 [:iOS]\n\n### Verify Framework Versions\n\nWhen switching between development branches, it's very easy to lose track of whether existing framework binaries in `Carthage/Build` match version numbers from `Cartfile.resolved`. As a result, you will probably lose several minutes of your development time, because `Xcode` doesn't tell you about outdated or missing framework binaries.\n\nLuckily, `carthage_remote_cache` provides following command:\n\n    carthagerc verify\n\nIf existing frameworks match `Cartfile.resolved`, script exits with `0` and doesn't print anything.\n\nIn the event of framework version mismatch, you'll be able to observe following output:\n\n    Detected differences between existing frameworks in 'Carthage/Build' and entries in 'Cartfile.resolved':\n\n    +-----------------+----------------+-------------------+\n    | Framework       | Carthage/Build | Cartfile.resolved |\n    +-----------------+----------------+-------------------+\n    | CocoaLumberjack |          3.2.1 |             3.4.1 |\n    | PhoneNumberKit  |          1.3.0 |             2.1.0 |\n    | HelloWorld      |              - |             3.0.0 |\n    +-----------------+----------------+-------------------+\n\n    To resolve the issue:\n    - run `carthagerc download` to fetch missing frameworks from the server.\n    - if the issue persists, run `carthage bootstrap` to build frameworks and `carthagerc upload` to populate the server.\n\n#### Git Hook\n\nRunning `carthagerc verify` manually on every git checkout / merge / pull could be quite cumbersome. To automate this task, integrate following script [carthagerc-verify-githook](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/carthagerc-verify-githook) into your repository's git hooks, e.g. `post-checkout`.\n\nSee `$ man githooks` for all available git hooks and their documentation.\n\n\n### Cache Server\n\nStart the server with\n\n    $ carthagerc server\n\nand browse to [localhost:9292](http://localhost:9292/) where you should be able to see the default _Welcome_ message.\n\nFramework binaries will be stored in `~/.carthagerc_server` folder.\n\nServer is bound to port 9292 by default. If you need to use different port, specify the port number via `-pPORT` or `--port=PORT` command line arguments, e.g.:\n\n    $ carthage server -p9000\n    $ carthage server --port=9000\n\nDon't forget to change port number in your version controlled `Cartrcfile`.\n\n#### Version Compatibility\n\nBefore each `carthagerc [upload|download]`, the script compares its version number against cache server. If the version doesn't match, `carthagerc` aborts with:\n\n    Version mismatch:\n      Cache server version: 0.0.7\n      Client version:       0.0.6\n\n    Please use the same version as cache server is using by running:\n    $ gem install carthage_remote_cache -v 0.0.7\n\nPlease note, that this functionality only works with clients starting with version [0.0.6](https://github.com/kayak/carthage_remote_cache/releases/tag/0.0.6).\n\n#### Directory Structure\n\nCache server stores version files and framework archives in following directory structure:\n\n    .carthagerc_server/\n      9C40b/                            # Xcode version\n        4.0.3/                          # Swift version\n          Framework1/\n            1.0.0/                      # Framework1 version\n              .Framework1.version       # Carthage .version file\n              Framework1-iOS.zip        # Framework binary, dSYM and bcsymbolmap files\n              Framework1-macOS.zip\n              Framework1-tvOS.zip\n              Framework1-watchOS.zip\n            2.0.3/                      # Framework1 version\n              .Framework1.version\n              Framework1-iOS.zip\n          Framework2/\n            v3.2/                       # Framework2 version\n              .Framework2.version\n              Framework2-iOS.zip\n\nIt's safe to delete whole directories since no other metadata is stored.\n\n#### Launch Agent\n\nYou can also run the cache server as a launch agent. Copy the template [com.kayak.carthagerc.server.plist](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/com.kayak.carthagerc.server.plist) file to `~/Library/LaunchAgents`, change log\npaths to include your username and run:\n\n    $ launchctl load -w ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist\n\nIf you want to stop the agent, run:\n\n    $ launchctl unload ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist\n\nCheck out official documentation on [Launch Agents](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) for more info.\n\n#### Docker\n\nTo build an image based on the latest released gem, run\n\n    $ docker build -t carthagerc .\n\nAfterwards you can run the image in a container using\n\n    $ docker run -d --publish 9292:9292 --name carthagerc carthagerc:latest\n\nThe server will now be available on port 9292 on `localhost`. Note that the command above will cause any data added to `~/.carthagerc_server` to be written into the container layer. While this works, it's generally discouraged due to decreased performance and portability. To avoid this, you can use a volume.\n\n    $ docker run -d --publish 9292:9292 --mount \"source=carthagerc,target=/root/.carthagerc_server\" --name carthagerc carthagerc:latest\n\nWe also recommend adding the `--log-opt` option to limit the size of logs, e.g. `--log-opt max-size=50m`.\n\nTo inspect the logs after running, use\n\n    $ docker logs carthagerc\n\nTo stop the container, run\n\n    $ docker container stop carthagerc\n\n### Version\n\n    $ carthagerc version\n\n### Help\n\nDocumentation is also available when running `carthagerc` or `carthagerc --help`. Both commands print list of available commands with brief description.\n\n    carthagerc COMMAND [OPTIONS]\n\n    ...\n\n    COMMANDS\n        config\n            print environment information and Cartrcfile configuration\n\n        download [-f|--force] [-v|--verbose] [-mPLATFORM|--platform=PLATFORM]\n            fetch missing frameworks into Carthage/Build\n\n        init\n            create initial Cartrcfile in current directory\n\n        upload [-f|--force] [-v|--verbose]\n            archive frameworks in Carthage/Build and upload them to the server\n\n        server [-pPORT|--port=PORT]\n            start cache server\n\n        verify\n            compare versions from Cartfile.resolved to existing frameworks in Carthage/Build\n\n        version\n            print current version number\n\n    OPTIONS\n        -f, --force                      Force upload/download of framework archives even if local and server .version files match\n        -h, --help                       Show help\n        -m, --platform=PLATFORM          Comma delimited list of platforms which should be downloaded from the server; e.g. `--platform iOS,macOS`; Supported values: iOS, macOS, tvOS, watchOS\n        -n, --no-retry                   Don't retry download or upload on network failures\n        -p, --port=PORT                  Server application port used when starting server, default port is 9292\n        -v, --verbose                    Show extra runtime information\n\n## Development\n\n### Setup\n\nAfter checking out the repo, run `dev/setup` to install dependencies. You can also run `dev/console` for an interactive prompt that will allow you to experiment.\n\n### Development Server\n\nTo start development server, run `dev/start_server`, which utilizes `rerun` for automatic reloading of source code and resources.\n\n### Tests\n\nExecute unit tests with `rake test` or start monitoring directories for changes with `bundle exec guard`.\n\n### Source Code Format\n\nBefore committing, make sure to auto-format source code wit `rake format`.\n\n### Gem Lifecycle\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/carthage_remote_cache).\n\n### Experiments With Example Folder\n\nRepository is bundled with an example Carthage setup for your experiments. Open the [example](https://github.com/kayak/carthage_remote_cache/blob/master/example) folder, where you should be able to see following files, which are preconfigured to bring in a couple of frameworks:\n- Cartfile\n- Cartfile.resolved\n- Cartrcfile\n\nMake sure to build these dependencies with `carthage bootstrap` before attempting to upload them.\n\nTry out a few commands:\n\n    $ carthagerc config\n    $ carthagerc upload\n    $ carthagerc download\n\n## License\n\nThe gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fcarthage_remote_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayak%2Fcarthage_remote_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fcarthage_remote_cache/lists"}