This repo is now the single player-facing mod. It bundles the whole engine and all three feature layers into one folder -- Core, Contraband, Justice, and Gangs DLLs plus Contraband's Defs -- with one About.xml and a settings shim that turns each layer on or off from a checkbox (all on by default). A player installs one mod (this) and Harmony; no separate Core dependency. - Source/Institution: the only new code, a settings shim (InstitutionMod + InstitutionModSettings) that writes the player's choices into Core's shared InstitutionSettings. It owns no gameplay. - Tools/package.sh: rebuilds the sibling DLLs clean and vendors them + Contraband's content in here, so the repo stays a complete drop-in. - Assemblies/, Defs/, Textures/, Languages/: the vendored, assembled mod. Still fully modular and splittable: the feature code stays in its own repos and DLLs (their About.xml files remain), so breaking this back into separate mods is just shipping them individually -- no code change.
49 lines
2.3 KiB
Bash
Executable File
49 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Assemble the shippable, drop-in "Institution" mod into this repo.
|
|
#
|
|
# The Institution suite's code lives in SEPARATE sibling repos (rimworld-core, -contraband, -justice,
|
|
# -gangs) as independent projects/DLLs -- that is what keeps it modular and splittable. For DISTRIBUTION
|
|
# they are vendored into ONE mod folder (this repo) with one About.xml and a settings shim that toggles
|
|
# each layer. This script rebuilds the sibling DLLs clean (no self-test) and copies them + Contraband's
|
|
# Defs in here, so the repo is a complete installable mod.
|
|
#
|
|
# To split back into separate mods later: stop running this, and ship each sibling repo as its own mod
|
|
# (their About.xml files still exist). Nothing in the code changes.
|
|
#
|
|
# Usage: Tools/package.sh (assumes siblings at ../rimworld-<name>)
|
|
set -euo pipefail
|
|
|
|
HERE="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SIB="$(dirname "$HERE")"
|
|
CORE="$SIB/rimworld-core"
|
|
CB="$SIB/rimworld-contraband"
|
|
JUST="$SIB/rimworld-justice"
|
|
GANGS="$SIB/rimworld-gangs"
|
|
|
|
command -v dotnet >/dev/null || { echo "dotnet not on PATH" >&2; exit 1; }
|
|
|
|
echo "==> building the engine + feature DLLs (clean, no self-test)"
|
|
dotnet build "$CORE/Source/Core/Core.csproj" -c Release -v q --nologo
|
|
dotnet build "$JUST/Source/Justice/Justice.csproj" -c Release -v q --nologo
|
|
dotnet build "$CB/Source/Contraband/Contraband.csproj" -c Release -v q --nologo
|
|
dotnet build "$GANGS/Source/Gangs/Gangs.csproj" -c Release -v q --nologo
|
|
|
|
echo "==> vendoring DLLs into Assemblies/"
|
|
mkdir -p "$HERE/Assemblies"
|
|
rm -f "$HERE/Assemblies/"*.dll # clear old layout
|
|
dotnet build "$HERE/Source/Institution/Institution.csproj" -c Release -v q --nologo # (re-)emit Institution.dll here
|
|
cp "$CORE/Assemblies/InstitutionCore.dll" "$HERE/Assemblies/"
|
|
cp "$CB/Assemblies/Contraband.dll" "$HERE/Assemblies/"
|
|
cp "$JUST/Assemblies/InstitutionJustice.dll" "$HERE/Assemblies/"
|
|
cp "$GANGS/Assemblies/InstitutionGangs.dll" "$HERE/Assemblies/"
|
|
|
|
echo "==> vendoring Contraband's content"
|
|
for d in Defs Patches Languages Textures; do
|
|
rm -rf "$HERE/$d"
|
|
[[ -e "$CB/$d" ]] && cp -r "$CB/$d" "$HERE/$d"
|
|
done
|
|
|
|
echo "==> done. Assemblies:"
|
|
ls -1 "$HERE/Assemblies/" | sed 's/^/ /'
|
|
echo "The repo is now a complete drop-in Institution mod (Core bundled). Requires only Harmony."
|