Build and Test
This article explains how to build LOICollectionA from source, run tests, and package releases.
Environment Requirements
- xmake 3.0+
clang-cltoolchain (LLVM + MSVC environment)- Git
Update the xmake repository before the first build:
xmake repo -uProject dependencies (automatically downloaded by xmake):
| Dependency | Version |
|---|---|
| levilamina | 26.51.6 |
| sqlitecpp | 3.3.3 |
| nlohmann_json | 3.12.0 |
| asio | 1.36.0 |
| gtest | v1.17.0 (debug mode only) |
| preloader | 1.15.7 |
| levibuildscript | Latest |
| imgui | v1.92.9+b (client target only) |
Building
Basic Build
# Clone and enter the repository
git clone https://github.com/loitietu/LOICollectionA.git
cd LOICollectionA
# Build with default configuration (release, server)
xmake
# Build debug (also compiles the test code)
xmake f -m debug
xmakeBuild Options
| Option | Default | Description |
|---|---|---|
| `-m debug | release` | release |
| `--target_type=server | client` | server |
| `--shared=y | n` | y |
# Clean and reconfigure
xmake f -c
xmake f -m debug --target_type=server
xmakeBuild Artifacts
The artifact is a shared library (LOICollectionA.dll on Windows), packaged with the modpacker rule (see below). The compile macros LL_PLAT_S (server)/LL_PLAT_C (client) are automatically defined by target_type, and modules/server/* and modules/client/* in the source are compiled mutually exclusively by target.
NOTE
The project uses c++.unity_build (batch size 8) to speed up compilation and enables the Global.h precompiled header. Recompiling after modifying a header file may be slow, which is normal.
Testing
Tests are based on gtest and run inside the game server: a debug build compiles tests/** into the plugin, and after deploying it to a LeviLamina server you trigger the whole suite by running /test all in the console.
xmake f -m debug --target_type=server -y
xmake -yTIP
The test entry point is triggered automatically by tests/server/TestMain.cpp when it receives ServerStartedEvent, and tests execute after a simulated player (TestSimulatedPlayer) is created.
For the full testing guide — directory layout and the responsibility of each layer, how to add a test, the unity-build naming convention you must follow, fuzzing, and the current CI situation — see Testing Guide.
Packaging and Release
modpacker
xmake.lua registers the modpacker rule via scripts/modpacker.lua, which automatically organizes the plugin directory during the build (plugin files, gui, lang, and other resources).
tooth.json
The release manifest tooth.json defines the plugin metadata and installation method:
tooth: release address (github.com/loitietu/LOICollectionA)version: plugin version (must matchset_versioninxmake.lua)variants: platform variants and dependencies (e.g.win-x64+ LeviLamina 26.50.*)assets: release assets (zip packages in the Release)
Release Workflow
.github/workflows/release.yml runs automatically when a tag (e.g. v1.17.1) is created: build → package zip → create GitHub Release → upload lip install assets. Users install via lip install github.com/loitietu/LOICollectionA.
Code Standards
The repository comes with the following configurations; keep them before committing:
| File | Purpose |
|---|---|
.clang-format | Code formatting (clang-format 15+) |
.clang-tidy | Static analysis rules |
.clangd | clangd language server configuration |
Other conventions:
Global.his the precompiled header, centrally including the base libraries (ll/api, base/ tools); new public headers can be considered for addition- Compile options
set_exceptions("none")+/EHa,/utf-8,/permissive-; do not rely on C++ exceptions - Put platform-related code in
modules/server/*ormodules/client/*, and public headers ininclude/server/*orinclude/client/* - Use the
LOICOLLECTION_A_API/LOICOLLECTION_A_NDAPIexport macros for the public API