This article briefly discusses local development setup.
The following tools are required for the best possible development experience:
- The latest version of Xcode.
- The tvOS simulator (otherwise provisioning fails for tvOS when archiving the tvOS app).
- bundler
- ffmpeg
- gem
- markdownlint-cli
- Periphery
- Python
- shellcheck
- swiftlint
- xcodes
- yamllint
Most of these tools can easily be installed with Homebrew.
The project provides a demo application which can be run to test features offered by the Pillarbox package.
Unit tests are provided with the Pillarbox package. Since Apple players cannot play local manifests we are using Python to run a simple web server serving various test streams from a local directory.
The web server must be manually started using make test-streams-start
before running the tests and remains running afterwards. It can be stopped at any time with make test-streams-stop
.
If unit tests fail you should check that streams are served correctly at http://localhost:8123
and start the server if this is not the case. Note that some sample streams require ~20 seconds to be fully available after the server started.
A Makefile provides several commands to perform quality checks, run unit tests or deliver demo app builds. Just run:
make
to list all available commands.
Quality checks can be run using:
make check-quality
This ensures that Swift files, scripts and documentation conform to common best practices.
Git hooks can be installed by running the following command:
make git-hook-install
Git hooks can be uninstalled by running the following command:
make git-hook-uninstall
This ensures to keep a clean codebase by removing unnecessary imports from the code.
make clean-imports
This ensures to catch some parts of code which are potentially unused.
make find-dead-code
Before using the make find-dead-code
command, ensure you have installed Periphery.
An editor configuration file and several linter configuration files are provided to ensure common styling and best practices. Editors can usually be configured to apply some of these rules automatically and consistently.
Xcode Text Editing settings should be configured as follows:
- Enable Automatically trim trailing whitespaces with Including whitespace-only lines enabled as well.
- Set Default Text Encoding to UTF-8.
- Set Default Line Endings to macOS / Unix (LF).
- Use Spaces for indentation (with 4 spaces both for Tab Width and Indent Width).
Please ensure that the target an Xcode preview belongs to is selected before attempting to render an Xcode preview (otherwise rendering will crash). Note that attempting to use the Pillarbox
umbrella target does not work.
We are currently using cloud signing with automatic provisioning updates. Code signing requires access to our internal configuration repository which is automatically pulled when running make setup
, provided you have been granted access to it.
SwiftUI view behavior is documented with the terminology introduced in the following article.