Prerequisites
Before you begin, ensure you have the following installed:- macOS 14.0 or later
- Xcode 15 or later (with Swift 5.9+)
- Homebrew - Install from brew.sh
The minimum deployment target is currently macOS 15.0 as specified in
project.yml. Make sure your development machine meets this requirement.Quick Start
Clone the Repository
Fork the repository on GitHub, then clone your fork locally:Replace
YOUR_USERNAME with your GitHub username.Run Setup Script
The setup script installs all required tools, configures git hooks, and generates the Xcode project:This script will:
- Check and install required Homebrew packages
- Install
xcodegen,swiftlint,swiftformat,xcbeautify, andlefthook - Set up git hooks for automatic formatting and linting
- Generate the Xcode project from
project.yml
Development Tools
XcodeGen
Ora uses XcodeGen to generate the Xcode project fromproject.yml. This ensures consistent project configuration across all contributors.
When to regenerate:
- After modifying
project.yml - After pulling changes that update project configuration
- When adding new files or targets
SwiftFormat
Automatic code formatting is handled by SwiftFormat. It runs automatically via git hooks, but you can also run it manually:SwiftLint
Code quality and style enforcement is handled by SwiftLint. It also runs automatically via git hooks:Lefthook
Lefthook manages git hooks. The configuration inlefthook.yml ensures code quality before commits and pushes:
Pre-commit hooks:
- Run SwiftFormat on staged files
- Run SwiftLint on staged files
- Automatically stage fixed files
- Build the project to catch compilation errors
Running Tests
Ora includes unit and UI tests to ensure code quality.In Xcode
Press ⌘U (Product → Test) to run all tests.Command Line
Run tests viaxcodebuild:
All new features should include appropriate tests, and existing tests must continue to pass before submitting a pull request.
Build Configurations
Ora has two build configurations defined inproject.yml:
Debug
- Uses
OraIconDevapp icon (distinguishes debug builds) - Enables hot reloading via InjectionIII
- Sets
EMIT_FRONTEND_COMMAND_LINES = YESfor InjectionIII compatibility - Adds
-Xlinker -interposablefor runtime function replacement - Uses
ora-debug.entitlements
Release
- Uses
OraIconproduction app icon - No hot reloading support
- Optimized for performance
- Uses
ora.entitlements
Common Issues
Homebrew Packages Not Found
If the setup script can’t find required packages, ensure Homebrew is in your PATH:~/.zshrc or ~/.bash_profile.
Xcode Project Out of Sync
If Xcode shows unexpected errors or missing files:- Close Xcode
- Regenerate the project:
xcodegen - Reopen Xcode
Build Errors After Pulling Changes
Try these steps:- Clean build folder: ⇧⌘K (Product → Clean Build Folder)
- Regenerate project:
xcodegen - Restart Xcode
Git Hooks Not Running
Reinstall lefthook hooks:Next Steps
Project Architecture
Learn about Ora’s architecture and code organization
Hot Reloading
Set up InjectionIII for instant SwiftUI updates
Contributing Guidelines
Read the contribution guidelines and workflow
Architecture Guide
Learn about the codebase architecture
