# CI, Build, Release & Code Style This document covers the CrossPoint Reader build system, CI pipeline, release process, code formatting rules, static analysis, and contribution guidelines. ## Build System The project uses **PlatformIO** with the Arduino framework targeting the ESP32-C3. ### Build Environments Defined in `platformio.ini`: | Environment | Purpose | Version String | |---|---|---| | `default` | Local development builds | `1.0.0-dev` | | `gh_release` | Official tagged releases | `1.0.0` | | `gh_release_rc` | Release candidates | `1.0.0-rc+{7-char SHA}` | ### Build Command ```bash # Development build pio run # Release build pio run -e gh_release # Release candidate build (requires CROSSPOINT_RC_HASH env var) CROSSPOINT_RC_HASH=abc1234 pio run -e gh_release_rc ``` ### Build Flags All environments share a common set of flags (`[base]` section): | Flag | Purpose | |---|---| | `-std=c++2a` | C++20 standard | | `-DARDUINO_USB_MODE=1` | USB mode selection | | `-DARDUINO_USB_CDC_ON_BOOT=1` | Enable USB CDC serial on boot | | `-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES=1` | Avoid miniz/zlib symbol conflicts | | `-DEINK_DISPLAY_SINGLE_BUFFER_MODE=1` | Single frame buffer (saves RAM) | | `-DDISABLE_FS_H_WARNING=1` | Suppress Arduino FS.h warning | | `-DXML_GE=0` | Disable expat general entity expansion | | `-DXML_CONTEXT_BYTES=1024` | Expat context buffer size | | `-DUSE_UTF8_LONG_NAMES=1` | Enable UTF-8 long filenames in SdFat | ### Pre-Build Step `scripts/build_html.py` runs before compilation (configured via `extra_scripts = pre:scripts/build_html.py`). It: 1. Finds all `.html` files under `src/`. 2. Minifies them (strips comments, collapses whitespace, preserves `
`, ``, `