Files
swift-nio-imap/Examples/README.md
T
Daniel Eggert b7783878e8 Replace PerformanceTester with ordo-one/benchmark suite
IMAPDispatchClient: a DispatchData client (parse + encode), measured
with allocation counters (plus ARC counters for parsing) instead of
Date(). Needs Swift 6.3 (malloc-interposer), so CI builds it in its own
job.

The "Legacy" file name anticipates the migration's
DispatchClient+Current.
2026-11-24 09:47:23 +09:00

32 lines
1.6 KiB
Markdown

# Examples
This directory contains example and tool projects built on top of `swift-nio-imap`.
Each subdirectory is its **own standalone Swift package** that depends on the library
in the repository root via a local path dependency (`.package(path: "../..")`).
Keeping them out of the root package means the library's own dependency graph stays
smaller — consumers don't resolve example-only dependencies such as `ArgumentParser`.
(Dependencies that the library products themselves use — for example `swift-log`, which
`IMAPCommands` depends on — remain part of the root package's graph.)
| Example | What it is |
| --- | --- |
| [`IMAPTool`](IMAPTool) | Command-line IMAP debugging tool (`imap-tool`) built on the `IMAPToolLib` library product. |
| [`CLI`](CLI) | A smaller command-line interface plus its supporting `CLILib` (with tests). |
| [`Proxy`](Proxy) | An IMAP proxy that logs the traffic flowing through it. |
| [`Fuzzer`](Fuzzer) | Fuzzing harness for the IMAP parser (`NIOIMAPFuzzer`). |
| [`PerformanceTester`](PerformanceTester) | Parser and encoder benchmarks, built on [ordo-one/benchmark](https://github.com/ordo-one/benchmark). |
## Building and running
Each example builds independently. From the repository root:
```sh
swift build --package-path Examples/IMAPTool
swift run --package-path Examples/IMAPTool imap-tool --help
```
Because they are separate packages, `swift build` / `swift test` at the repository
root builds only the library targets — not these examples. CI builds them in the
`Build examples` job; `PerformanceTester` has its own `Build benchmarks` job.