Skip to content

Latest commit

 

History

History
124 lines (76 loc) · 4.45 KB

DEVELOPMENT_SETUP.md

File metadata and controls

124 lines (76 loc) · 4.45 KB

Development setup

This article briefly discusses local development setup.

Required tools

The following tools are required for the best possible development experience:

Most of these tools can easily be installed with Homebrew.

Demo

The project provides a demo application which can be run to test features offered by the Pillarbox package.

Unit tests

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.

Remark

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.

Makefile

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

Quality checks can be run using:

make check-quality

This ensures that Swift files, scripts and documentation conform to common best practices.

Git hooks

Installation

Git hooks can be installed by running the following command:

make git-hook-install

Uninstallation

Git hooks can be uninstalled by running the following command:

make git-hook-uninstall

Clean imports

This ensures to keep a clean codebase by removing unnecessary imports from the code.

make clean-imports

Find dead code

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.

Editor configuration

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

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).

Visual Studio Code

Xcode previews

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.

Code signing

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.

Other resources

SwiftUI view behavior is documented with the terminology introduced in the following article.