Skip to main content
Version: Next

groups and multi-target export

This page covers: how client, server, and editor receive different tables and fields.

Decision tree

Need per-side split?
├─ No → one target (e.g. all), groups include everything
└─ Yes → one target per side
├─ client → groups: ["c"]
├─ server → groups: ["s"]
└─ editor → groups: ["e"] (optional)

When generating:

dotnet Luban.dll --conf luban.conf -t client -c cs-simple-json -d json -x outputCodeDir=... -x outputDataDir=...
dotnet Luban.dll --conf luban.conf -t server -c cs-dotnet-json -d json -x ...

Table-level vs field-level

LocationMeaning of empty group
tableIf a group has default: true, the table automatically belongs to that group
fieldEmpty = exported for all groups

When a field is client-only: put c on the Excel ##group row, or set the field’s group in schema.

Default export set and * semantics

The default export set is computed by recursively following references from tables exported for the current target. Enums/beans in that set are exported even if their groups do not match the target.

RuleNotes
groups contains *Belongs to all groups
enum/bean contains *Generated even if not referenced
table/enum/bean groups emptyExported when target has a default: true group; otherwise not
field groups emptyExported to all groups (unlike table rules)

When index is omitted and mode is empty or map, the first field of valueType is often the primary key; multiple index fields usually imply list mode.

Common combinations

ScenarioApproach
Numeric values server-onlyField group=s
Table client-onlyTable group=c
Editor wants full raw structuretarget editor includes e or c,s,e, and pick an editor-oriented codeTarget

Common pitfalls

  • Thinking “no group means not exported”—for field the opposite is true.
  • client/server sharing one output directory and overwriting each other.
  • Changed groups but still using the old -t, and thinking config was lost.