Use plugin-helper profiles in builder skill

This commit is contained in:
pleb
2026-07-01 12:45:58 -07:00
parent eed12376c6
commit c0a167dc67
4 changed files with 81 additions and 43 deletions
@@ -6,7 +6,8 @@ This workflow comes from `/home/pleb/ops/beatsaber/setlist/docs/pc-modding.md` a
## Toolchain
- PC BSIPA plugins are usually .NET Framework `net472` class libraries.
- PC BSIPA plugins are .NET Framework class libraries; current projects
commonly target `net48`, while older projects may still target `net472`.
- Linux `dotnet` SDK 6+ can build them because output DLLs are platform-agnostic CIL loaded by Beat Saber under Proton.
- `BeatSaberModdingTools.Tasks` supplies the MSBuild targets normally driven by Visual Studio/Rider BSMT extensions.
- On this host, `dotnet --list-sdks` should show a usable SDK. NuGet is available for package inspection.
@@ -24,16 +25,13 @@ Plugins/
winhttp.dll
```
Preferred local managed instance root:
In `plugin-helper`, prefer the profile selected from
`plugin-helper.local.toml` as the source of truth for the managed instance root
and state directory:
```text
/home/pleb/.local/share/BSManager/BSInstances/<version>
```
Windows mirror root:
```text
/home/pleb/Windows/Users/pleb/BSManager/BSInstances/<version>
```bash
sed -n '1,220p' plugin-helper.local.toml
PYTHONPATH=src .venv/bin/python -m plugin_helper --profile <profile-id> instances
```
Use `BeatSaberVersion.txt` for the exact game version. The manifest `gameVersion` normally uses the `major.minor.patch` prefix, not the build suffix.
@@ -45,7 +43,7 @@ Prefer machine-local configuration in `<Project>.csproj.user`:
```xml
<Project>
<PropertyGroup>
<BeatSaberDir>/home/pleb/.local/share/BSManager/BSInstances/1.40.8</BeatSaberDir>
<BeatSaberDir>/path/from/selected/profile/instances_root/1.44.1</BeatSaberDir>
</PropertyGroup>
</Project>
```
@@ -60,7 +58,10 @@ For those, pass `-p:LocalRefsDir=/path/to/instance` or add a local `.csproj.user
When changing a project file for Linux portability, prefer the smallest explicit fix:
- Add `Microsoft.NETFramework.ReferenceAssemblies.net472` when MSBuild reports missing .NET Framework reference assemblies.
- Add the `Microsoft.NETFramework.ReferenceAssemblies.*` package matching the
project target framework, usually `Microsoft.NETFramework.ReferenceAssemblies.net48`
for current projects, when MSBuild reports missing .NET Framework reference
assemblies.
- Set or pass `DisableCopyToPlugins=True` for artifact-only builds.
- Keep hint paths rooted at `$(BeatSaberDir)` where possible.
- Do not add broad multi-version compatibility logic unless requested.
@@ -105,7 +106,9 @@ If the purpose is to install the built artifact, copy it into plugin-helper's st
## Common Reference Failures
- `MSB3644` or missing `.NETFramework,Version=v4.7.2` reference assemblies: add `Microsoft.NETFramework.ReferenceAssemblies.net472`.
- `MSB3644` or missing `.NETFramework,Version=v4.x` reference assemblies: add
the matching `Microsoft.NETFramework.ReferenceAssemblies.*` package, usually
`Microsoft.NETFramework.ReferenceAssemblies.net48` for current projects.
- Missing game assemblies such as `Main.dll`, `HMUI.dll`, `UnityEngine.CoreModule.dll`: `BeatSaberDir` is wrong or incomplete.
- Missing mod dependencies such as `BSML.dll`, `SongCore.dll`, `SiraUtil.dll`, `BeatSaberPlaylistsLib.dll`: install or point at an instance containing those plugins, or fetch the dependency DLL from its verified release only when appropriate.
- `IPA.Loader.dll` missing: BSIPA is not bootstrapped in that instance.
@@ -115,17 +118,17 @@ If the purpose is to install the built artifact, copy it into plugin-helper's st
For a built plugin DLL intended for a managed instance:
```bash
mkdir -p .state/instances/<instance>/downloads/<plugin-id>
cp <checkout>/<path>/bin/Release/<Plugin>.dll .state/instances/<instance>/downloads/<plugin-id>/<Plugin>.dll
sha256sum .state/instances/<instance>/downloads/<plugin-id>/<Plugin>.dll
mkdir -p <state_dir>/instances/<instance>/downloads/<plugin-id>
cp <checkout>/<path>/bin/Release/<Plugin>.dll <state_dir>/instances/<instance>/downloads/<plugin-id>/<Plugin>.dll
sha256sum <state_dir>/instances/<instance>/downloads/<plugin-id>/<Plugin>.dll
```
Then update registry/lock data only if the user asked to manage/install the artifact, and use:
```bash
PYTHONPATH=src python -m plugin_helper --state-dir .state check --instance <instance>
PYTHONPATH=src python -m plugin_helper --state-dir .state plan --instance <instance> --plugin <plugin-id>
PYTHONPATH=src python -m plugin_helper --state-dir .state apply <plan-path>
PYTHONPATH=src .venv/bin/python -m plugin_helper --profile <profile-id> check --instance <instance>
PYTHONPATH=src .venv/bin/python -m plugin_helper --profile <profile-id> plan --instance <instance> --plugin <plugin-id>
PYTHONPATH=src .venv/bin/python -m plugin_helper --profile <profile-id> apply <plan-path>
```
Inspect the generated plan before applying.