**Summary** It appears to me that the largest contributor to compile times is `API.swift` and its re-generation in the "Generate Apollo GraphQL API" build phase. The build script currently overwrites "API.swift" on every build, resulting in a new last-modified timestamp. As such, the swift compiler won't use it's cached build of the file. (You'll have to excuse me, I don't know much about the compiler, so I may be butchering terminology.) In my estimation, this causes XCode to not only recompile API.swift, but also _all files that reference its contents_. **Fix** Modify the "Generate Apollo GraphQL API" build phase to only overwrite API.swift if the output of `check-and-run-apollo-codegen.sh` results in a different output than the previous build. The diff is hard to read, as it's in the pbxproj, so I've included the relevant lines below: ```sh TEMP_FILE=$(mktemp) [[ -f API.swift ]] || touch API.swift # ensure sure file exists $APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output $TEMP_FILE cmp API.swift $TEMP_FILE || cp $TEMP_FILE API.swift ``` In short, it outputs the generated API file to `TEMP_FILE`. Then, it uses `cmp` to test if `TEMP_FILE` is identifical to the existing `API.swift`. If they are not, it overrwrites `API.swift` with the newly generated code. **Result** Previously, re-builds (with no changes) were taking between 60-90 seconds (I have a slow-ish Mac). Now they're taking between 7-10.
GitHawk
The simplest way to read and respond to your GitHub notifications on iOS.
What
GitHawk is a small iOS app that makes managing GitHub accounts and projects a little easier. It exists because GitHub's mobile interface is missing features and is slow.
It is also proof that you can build rather complicated Swift apps with IGListKit.
Why
- Push
IGListKit+ Swift to its limits - Enable project management on mobile
- Explore GitHub's GraphQL API
- Scratch my Swift-itch
- Create a real, complex app in the open
How
GitHawk will be released with (at least) a three-phased rollout:
- Basic, "read only" version.
- Read notifications for PRs and Issues
- React to comments
- Mark notifications as read
- Add replies to PRs and Issues
- Close, lock, and re-open PRs and Issues
- Label PRs and Issues
- Repo management
- Browse & create Issues
- Browse PRs
- Create & delete labels
- Northstar
- Browse PR content
- Accept, reject, and merge PRs
- 🚀
Open Source & Copying
I ship GitHawk on the App Store for free and provide its entire source code for free as well. In the spirit of openness, I have licensed my work under MIT so that you can use my code in your app, if you choose.
However, I ask that you please do not ship this app under your own account. Paid or free.
Contributing
⚠️ This repo is moving fast! ⚠️
If you would like to test the latest changes, you can join the TestFlight by sending your e-mail address to @_ryannystrom in a DM on Twitter.
I'm happy to take PRs, but I'm working off of master at the moment, and your PR might go stale quick. Be warned!
You'll also need a Client ID and Client Secret.
Once this is released and development slows down I might get more formal about our work. Until then, its the wild, wild west.
