{"id":16829802,"url":"https://github.com/mxcl/cake","last_synced_at":"2025-04-05T22:07:53.492Z","repository":{"id":66722934,"uuid":"157017884","full_name":"mxcl/Cake","owner":"mxcl","description":"A delicious, quality‑of‑life supplement for your app‑development toolbox.","archived":false,"fork":false,"pushed_at":"2019-06-04T13:20:00.000Z","size":1560,"stargazers_count":537,"open_issues_count":17,"forks_count":15,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-29T21:06:05.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/mxcl.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},"funding":{"github":"mxcl","patreon":"mxcl"}},"created_at":"2018-11-10T20:16:48.000Z","updated_at":"2024-12-19T19:51:12.000Z","dependencies_parsed_at":"2023-04-27T23:01:40.373Z","dependency_job_id":null,"html_url":"https://github.com/mxcl/Cake","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2FCake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2FCake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2FCake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2FCake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxcl","download_url":"https://codeload.github.com/mxcl/Cake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406090,"owners_count":20933803,"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":[],"created_at":"2024-10-13T11:35:43.414Z","updated_at":"2025-04-05T22:07:53.472Z","avatar_url":"https://github.com/mxcl.png","language":"Swift","funding_links":["https://github.com/sponsors/mxcl","https://patreon.com/mxcl","https://www.patreon.com/mxcl"],"categories":[],"sub_categories":[],"readme":"![Cake](../gh-pages/Cake.png)\n\n**We are aware of Xcode 11, probably don’t commit to Cake at this time**\n\nModules are a powerful Swift feature, yet existing tooling makes modulizing your\nprojects *so* tedious that most people don’t bother.\n\nA modular app gains:\n\n* **Encapsulation**. Internal scope is a criminally under-utilized Swift feature\n    that makes encapsulation significantly more achievable.\n* **Namespacing**. Modules have an implicit namespace; fear not about reusing\n    names, modulize instead.\n* **Hierarchy**. Once you start creating modules you automatically\n    arrange them so that some have more importance than others.\n    This naturally leads to a *structured* codebase where new files nestle into\n    their logical, encapsulated homes, *effortlessly*.\n* **Organization**. You no longer have to cram everything concerning an area of\n    responsibility into a single file to gain from file-private. Instead\n    separate all that code out into multiple files in its own module and use\n    `internal` access control.\n* **Testability**. Making a piece of functionality its own module means you can\n    make more of that module internal scope rather than private and this means\n    more of the module can be imported `@testable` making the functionality\n    easier to test without adopting practices that make your code less readable\n    for the sake of testing (like injection).\n\nCake makes working with Swift modules *a breeze*.\n\n# Xcode 10.2-beta Required\n\nSupporting Swift tools-version-5 and tools-version-4 is not our thing. Cake\nrequires at least Xcode 10.2 to function.\n\n# Support Cake’s development\n\nHey there, I’m Max Howell, a prolific producer of open source software and\nprobably you already use some of it (I created [`brew`]). I work full-time on\nopen source and it’s hard; currently *I earn less than minimum wage*. Please\nhelp me continue my work, I appreciate it 🙏🏻\n\n\u003ca href=\"https://www.patreon.com/mxcl\"\u003e\n\t\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\"\u003e\n\u003c/a\u003e\n\n[Other ways to say thanks](http://mxcl.dev/#donate).\n\n[`brew`]: https://brew.sh\n\n# How it works\n\n\u003e “The secret of getting ahead is getting started. The secret of getting started\n\u003e is breaking your complex overwhelming tasks into small, manageable tasks, and\n\u003e then starting on the first one.” —*Mark Twain*\n\nCake is an app that runs in your menu bar and watches your Xcode projects. If\nyou chose to integrate Cake into your App’s xcodeproj it will automatically\ngenerate your module hierarchy based on your directory structure. For example:\n\n    .\n    └ Sources\n      └ Model\n        ├ Module1\n        │ ├ a.swift\n        │ └ b.swift\n        └ Module2\n          ├ c.swift\n          └ d.swift\n\nNow **⌘B** and you’ll be able to `import`:\n\n```swift\nimport Module1\nimport Module2\n```\n\n\u003e **FAQ**: What is a cake project? A Cake project has a `Cakefile.swift` file \n\u003e in its root.\n\n\u003e **Delicious**: All your modules are built *statically* so there’s no\n\u003e launch-time consequences.\n\n\u003e **Curious?** Cake is made with Cake, so is [Workbench], check out the sources\n\u003e to see more about what a cake‐project looks like.\n\n\u003e **Details**: Cake generates a sub-project (Cake.xcodeproj), you *lightly*\n\u003e integrate this into your app’s project.\n\n[Workbench]: https://github.com/mxcl/Workbench\n\n## Module hierarchies\n\n\u003e “You’ve got to think about the big things while you’re doing small things, so\n\u003e that all the small things go in the right direction.” —*Alvin Toffler*\n\nBefore long you will need some modules to depend on others. This is an important\nstep since you are starting to acknowledge the relationships between components\nin your codebase. Cake makes declaring dependencies as easy as nesting\ndirectories.\n\n    .\n    └ Sources\n      └ Model\n        └ Base\n          ├ a.swift\n          ├ b.swift\n          └ Foo\n            ├ c.swift\n            └ d.swift\n\nHere `Foo` depends on `Base` and thus, `Foo` can *now* import `Base`.\n\n*All* other tools require you to specify relationships *cryptically*, either\ntextually or with a confounding GUI. With Cake, use the filesystem,\nrelationships are not only easy to read, but also, trivial to refactor (just\nmove the directory).\n\n\u003e **Further Reading**: [Advanced module hierarchies](Documents/Advanced-Module-Hierarchies.md)\n\n\u003e **FAQ**: What should go in your `Base` module? Cake’s `Base` module contains\n\u003e extensions on the standard library.\n\n## Dependencies\n\n\u003e “You can do anything, but not everything.” —*David Allen*\n\nCake makes using Swift packages in Xcode easy. Write out your\n[`Cakefile`](Documents/Cakefile.md), **⌘B**, Cake fetches your deps and\nintegrates them: no muss, no fuss.\n\n```swift\nimport Cakefile\n\ndependencies = [\n    .github(\"mxcl/Path.swift\" ~\u003e 0.8),\n    .github(\"Weebly/OrderedSet\" ~\u003e 3),\n]\n\n// ^^ naturally, using Cake to manage your deps is entirely optional\n```\n\nWe figure out your deployment targets, we make your deps available to *all* your\ntargets and we generate a stub module that imports all your deps in one line\n(`import Dependencies`).\n\nWe check out your dependencies *tidily*, for example the above `Cakefile` gives\nyou:\n\n    .\n    └ Dependencies\n      ├ mxcl/Path.swift-0.8.0\n      │ ├ Path.swift\n      │ └ …\n      └ Weebly∕OrderedSet-3.1.0.swift\n\nWhich generates this in your `Cake.xcodeproj`:\n\n\u003cimg src='../gh-pages/Screenshot.Deps.png' width='269.5'\u003e\n\nWhich you can then commit, *or not commit*: that’s up to you.\n[Though we suggest you do](Documents/FAQ.md#should-i-commit-my-deps).\n\n\u003e **Delicious**: All dependency modules are built *statically* so there are no\n\u003e launch-time consequences.\n\n\u003e **Delicious**: A fresh clone of a Cake project builds with vanilla Xcode,\n\u003e no other tools (even Cake) are required. Distribute away *without* worry!\n\n\u003e **Delicious**: Cake finally makes it possible to use SwiftPM packages for iOS\n\u003e development!\n\n\u003e **FAQ**: [Should I commit my deps?](Documents/FAQ.md#should-i-commit-my-deps)\n\n\u003e **Caveat**: We only support SwiftPM dependencies [*at this time*](../../issues/new?title=cocoapods).\n\n\u003e **Further Reading**: [Cakefile Reference]\n\n[more with your Cakefile]: Documents/Cakefile.md\n\n### Carthage \u0026 CocoaPods\n\nIf your app uses Carthage or CocoaPods we detect that and integrate them so\nyour cake modules (the `Batter`) can use these dependencies.\n\nNote, this only applies to cake modules (the `Batter`); for your App target\nfollow the instructions provided by CocoaPods and Carthage themselves; nothing\nis different.\n\n### Op‐Ed—an era for Swift µ-frameworks?\n\nCocoaPods and Carthage libraries tend to be on the *large* side, and this is at\nleast partly because being modular has been historically hard and tedious when\ndeveloping for Apple platforms and Swift. SwiftPM encourages smaller, tighter\nframeworks and using Cake means making apps with Swift packages is now possible.\n\nChoose small, modular, single‐responsibility libraries with 100% code coverage\nthat take semantic-versioning **seriously**. Reject bloated libraries that don’t\nknow how to say no to feature requests.\n\n## Constructing frameworks/dylibs\n\nSince everything Cake builds is a static archive, you can simply link whichever\nparts you like into whatever Frameworks or dylibs you need for your final\nbinaries.\n\nThis is a purely optional step, statically linking `Cake.a` into your App (which\nCake sets up by default for you) is perfectly fine. This more advanced option is\navailable to make apps with extensions more optimal in terms of disk usage and\nmemory consumption.\n\n# Installation\n\n1. [Download it](../../releases).\n2. Run it.\n3. Check your menu bar:\n\n    \u003cimg src='../gh-pages/Screenshot.Integrate-Cake.png' width='431'\u003e\n\n4. Open a project and integrate Cake; or\n5. Create a new Cake.\n\n    \u003cimg src='../gh-pages/Screenshot.New-Cake.png' width='431'\u003e\n\n\u003e **FAQ**: [What does integration do?](Documents/FAQ.md#what-does-integration-do)\n\n\u003e **Delicious**: We auto-update!\n\n# Bonus Features\n\n## Extracting your app’s version from Git\n\nCake determines your App’s version from your git tags, to use them simply\nset each target’s “Version” to: `$(SEMANTIC_PROJECT_VERSION)` and if you\nlike the “Build” number to: `$(CURRENT_PROJECT_VERSION)`.\n\n\u003e *Delicious!* We even append `-debug` to debug builds.\n\n## Xcode Remote Control \n\n\u003cimg src='../gh-pages/Screenshot.Xcode-Menu.png' width='724'\u003e\n\n# Caveats\n\nDue to some Xcode bugs Cake is not a complete *Cake‐walk* in use. Please see our\n[troubleshooting](Documents/Troubleshooting.md) guide for details.\n\n# Documentation\n\n* Handbook\n  * [FAQ](Documents/FAQ.md)\n  * [Suggested Usage](Documents/Suggested-Usage.md)\n  * [Troubleshooting](Documents/Troubleshooting.md)\n* Reference\n  * [Cakefile Reference]\n  * [Advanced Module Hierarchies](Documents/Advanced-Module-Hierarchies.md)\n\n[Cakefile Reference]: Documents/Cakefile.md\n\n# Icons credit\n\nIcons made by [Google](https://www.flaticon.com/authors/google) and\n[Freepik](https://www.freepik.com) from\n[www.flaticon.com](https://www.flaticon.com) licensed by\n[CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxcl%2Fcake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxcl%2Fcake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxcl%2Fcake/lists"}