跳到正文
本頁目錄

構建與貢獻

構建

Windows x64,另需(winget install -e --id <id>;LLVM、Build Tools 需要管理員權限;裝完重開終端):

工具id
xmakeXmake-io.Xmake
LLVM clang-cl(模組工具鏈)LLVM.LLVM
Build Tools 2022/2026,C++(MSVC 14.4x+)Microsoft.VisualStudio.2022.BuildTools / Microsoft.VisualStudio.BuildTools + --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
.NET 10 SDKMicrosoft.DotNet.SDK.10
Node.js 24+OpenJS.NodeJS.LTS
構建命令輸出
模組$env:PATH = "C:\Program Files\LLVM\bin;$env:PATH"
xmake f -P . -y -m release -p windows --target_type=client(-m debug)
xmake -P . -y
git checkout -- xmake-requires.lock
bin\BeDD\
服務端模組git checkout -- xmake-requires.lock
xmake f -P . -y -m release -p windows --target_type=server
xmake -P . -y
git checkout -- xmake-requires.lock
bin\BeDD-server\ → 服務器 mods\BeDD-server\(配置 mods\BeDD-server\config\config.json;操作)
應用$env:PATH = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer;$env:PATH"(AOT 需要 vswhere)
dotnet publish app/BeDD/BeDD.csproj -c Release -o bin\app
dotnet test app/BeDD.slnx(無需 vswhere)
bin\app\BeDD.exe
安裝程序dotnet build packaging/wix/Bundle/BeDD.Bundle.wixproj -c Release -p:Platform=x64packaging\wix\Package\bin\x64\Release\bedd.msi、packaging\wix\Bundle\bin\x64\Release\bedd-setup.exe
文檔cd docs; npm ci; npm run buildhttps://levimc.org/BeDD/(CI:docs.yml)
  • -P .:否則 xmake 可能構建上級檢出(在 worktree 中時)。
  • 版本取自 git describe:需要提交和標籤(淺克隆時 git fetch --tags)。
  • xmake-requires.lock 固定兩個目標的依賴;xmake 會只按一個目標改寫它:每次構建後恢復。新固定:配置兩個目標,提交 並集。
  • 服務端模組:WebSocket、迴環網絡、src/ServerTimeScale.cpp(列表見 xmake.lua)。
  • 安裝程序(WiX 7 來自 NuGet,AcceptEula 在 packaging/wix/Directory.Build.props):按用戶安裝的 MSI + setup.exe (英文/中文界面),來源 bin\release\BeDD(由 .github/actions/stage 從 bin\app、bin\BeDD、bin\BeDD-server、 spec 生成);版本取自 app/BeDD/BeDD.csproj 或 -p:ProductVersion=。測試:tests/installer/installer.test.mjs (當前用戶;已安裝 BeDD 的機器上拒絕運行;CI)。

開發循環

bin\app\BeDD.exe dev:克隆槽位 9(--slot),安裝 bin\BeDD(--from <dir>),啟動(標籤 dev,--label),並把 前臺和光標裁剪變化記錄到 tools\out\desktop-watch.log(--watch-log)。以 MINECRAFT HAS THE FOREGROUND 結尾的行 (同時警告):有遊戲搶了焦點。裁剪必須保持 full。

Ctrl+C 或 dev.stop(日誌目錄中):關閉遊戲(除非 --keep)並退出;dev.restart:重新安裝並重新啟動;遊戲退出時 dev 也退出。--watch-only:只監視。

只關閉自己克隆的遊戲;鎖 %LOCALAPPDATA%\BeDD\locks\dev-<slot>.lock;佔住當前 shell。

文檔與展示素材

docs/public/showcase/:畫廊和 README 素材,由 tools/showcase/record.mjs [--keep-open] [--dry-run] 和 encode.mjs 生成(詳情)。

源碼結構

每個源文件及其內容:CONTRIBUTING.md。

代碼規範(SDK 頭文件,僅 MCAPI)、pull request、許可證:CONTRIBUTING.md。