STS2 compile refs (maintainers)

Last updated:

Published on

Pinned beta API refs, LFS capture, and CI checks for KitLib maintainers. Mod authors who only need runtime compatibility should start with STS2 version compatibility.

KitLib 维护者用的 beta API 引用、LFS 捕获与 CI 检查。仅需运行时兼容说明的 mod 作者请先看 STS2 版本兼容

Pinned beta ref

固定的 beta 引用

KitLib compiles against one pinned game build (see scripts/lib/sts2_profiles.py and Sts2ProfileMap.PinnedGameVersion):

SettingValue
Profilebeta
Pinned version0.110.1 (update when Steam beta moves)
MSBuild-p:Sts2Profile=beta (default)
Ref patheng/sts2-refs/beta/0.110.1/data_sts2_windows_x86_64/sts2.dll

CI and dotnet format use the LFS ref — not your local Steam install.

KitLib 只针对一条固定的游戏构建编译(见 scripts/lib/sts2_profiles.pySts2ProfileMap.PinnedGameVersion):

Profilebeta
固定版本0.110.1(Steam beta 前进时更新)
MSBuild-p:Sts2Profile=beta(默认)
Ref 路径eng/sts2-refs/beta/0.110.1/data_sts2_windows_x86_64/sts2.dll

CI 与 dotnet format 使用 LFS ref,而非本机 Steam 安装目录。

One-time setup

一次性准备

bash
git lfs install

Refresh refs

刷新 ref

bash
# Steam → public-beta branch
make capture-sts2-ref

git add eng/sts2-refs .gitattributes
git commit -m "Update STS2 beta compile ref"

Refs are stored as:

eng/sts2-refs/beta/0.110.1/data_sts2_windows_x86_64/sts2.dll
eng/sts2-refs/beta/0.110.1/data_sts2_windows_x86_64/0Harmony.dll

Daily dev

日常开发

make init writes local.props (Sts2Dir, Sts2Profile=beta) → make sync-full builds and deploys to that install. Local builds still compile against eng/sts2-refs/beta/ when Sts2Dir is unset (CI-style).

make init 写入 local.propsSts2DirSts2Profile=beta)→ make sync-full 构建并部署到该安装。未设置 Sts2Dir 时本地构建仍使用 eng/sts2-refs/beta/(与 CI 一致)。

Commands

命令

TargetPurpose
make capture-sts2-refCopy DLLs from local.props Sts2Dir into eng/sts2-refs/beta/
make buildCompile mod bundle against beta ref
make check-apiReflect touchpoints against beta sts2.dll
make verifybuild + check-api (pre-release)
make extract-touchpointsRegenerate eng/api_touchpoints.yaml from src/

When Megacrit ships a new beta

Steam beta 更新 API 时

  1. Bump pinned version in scripts/lib/sts2_profiles.py, eng/Sts2Refs.props, eng/api_touchpoints.yaml, and Sts2ProfileMap.PinnedGameVersion.
  2. make capture-sts2-ref from a matching Steam install.
  3. make verify → fix code / touchpoint aliases → CHANGELOG.
  1. 更新 scripts/lib/sts2_profiles.pyeng/Sts2Refs.propseng/api_touchpoints.yamlSts2ProfileMap.PinnedGameVersion 中的固定版本。
  2. 在匹配的 Steam 安装上执行 make capture-sts2-ref
  3. make verify → 修代码 / touchpoint alias → CHANGELOG。