# Packaging

Audio Path Tone Tester packages as a one-file Windows executable plus release
metadata and license notices in a `dist/` directory.

## Default Release Package

Default packaging keeps `ENABLE_ASIO=OFF` and links the MSVC runtime statically
so the app executable does not require a separate Visual C++ runtime installer.
Normal Windows system DLLs and user-installed audio drivers remain external
system components.

Run from a Visual Studio developer shell with Ninja on `PATH`:

```powershell
cmake --preset vs2026-ninja-release
cmake --build --preset vs2026-ninja-release --target package_onefile_smoke
```

Output layout:

```text
dist/
  audio_path_tone_tester-0.1.0-no-asio-windows-x64/
    audio_path_tone_tester-0.1.0-no-asio-windows-x64.exe
    RELEASE_MANIFEST.txt
    THIRD_PARTY_NOTICES.txt
    ASIO_DISTRIBUTION_GATE.txt
    ASIO_LICENSE_DECISION.md
    SMOKE_CHECKLIST.md
    THIRD_PARTY.md
    licenses/
      dear_imgui_LICENSE.txt
```

## ASIO-Enabled Release Package

If `ENABLE_ASIO=ON`, the `package_onefile` target refuses to package unless the
GPLv3 source/notices acknowledgement is explicitly set. ASIO-enabled package
names use an `asio-gplv3` suffix.

ASIO-enabled packaging requires:

```powershell
-DAPTT_PACKAGE_ACK_ASIO_GPLV3_SOURCE=ON
-DAPTT_ASIO_CORRESPONDING_SOURCE_PACKAGE=<path-or-name>
-DAPTT_ASIO_CORRESPONDING_SOURCE_SHA256=<sha256>
```

The corresponding source package should be the exact source archive published
with the binary release. Compute the SHA-256 after creating that archive and
pass the same value to CMake. The generated package writes those values to
`SOURCE_AVAILABILITY.txt`.

The ASIO-enabled binary package also copies:

```text
licenses/
  dear_imgui_LICENSE.txt
  steinberg_asio_sdk_LICENSE.txt
  steinberg_asio_sdk_README.md
  steinberg_asio_sdk_common_LICENSE.txt
```

Do not bundle vendor ASIO drivers. Do not add ASIO logo artwork to the release
package, website, screenshots, or social images. Use ASIO only as a descriptive
backend/API label.

## Creating Corresponding Source

Create the source archive from the public repository root, not from a build
directory. Exclude generated outputs and local artifacts:

- `build/`
- `dist/`
- `.tools/`
- `diagnostic_bundles/`
- logs
- object/debug files
- local hardware smoke artifacts

Example:

```powershell
Compress-Archive -Path . -DestinationPath ..\audio_path_tone_tester-0.1.0-gplv3-source.zip -Force
Get-FileHash ..\audio_path_tone_tester-0.1.0-gplv3-source.zip -Algorithm SHA256
```

Review the archive before publishing. It should contain `COPYING`, `LICENSE`,
`NOTICE`, source, tests, CMake files, selected Dear ImGui source files, and the
included Steinberg ASIO SDK source subset and license files.

## Package Smoke

`package_onefile_smoke` runs the packaged executable with `--smoke`. The smoke
path exits before the GUI, Direct3D, audio-device enumeration, stream
initialization, or playback starts.

## Publication Checklist

See `PUBLICATION_CHECKLIST.md` before pushing a public repository or uploading a
binary release.
