Skip to main content
Version: Next

luban.conf and project layout

luban.conf is the project entry: it tells Luban where data lives, where schema is collected, and which export targets exist.

Minimal example

{
"groups": [
{"names": ["c"], "default": true},
{"names": ["s"], "default": true},
{"names": ["e"], "default": true}
],
"schemaFiles": [
{"fileName": "Defines", "type": ""},
{"fileName": "Datas/__tables__.xlsx", "type": "table"},
{"fileName": "Datas/__beans__.xlsx", "type": "bean"},
{"fileName": "Datas/__enums__.xlsx", "type": "enum"}
],
"dataDir": "Datas",
"targets": [
{"name": "server", "manager": "Tables", "groups": ["s"], "topModule": "cfg"},
{"name": "client", "manager": "Tables", "groups": ["c"], "topModule": "cfg"},
{"name": "all", "manager": "Tables", "groups": ["c", "s", "e"], "topModule": "cfg"}
]
}

Field reference

dataDir

Data root directory, required. A table’s input is resolved relative to this directory.

schemaFiles

FieldNotes
fileNameFile or directory; directories are collected recursively
typeRequired for Excel family: table / bean / enum; may be blank for XML definitions

You can use XML (Defines) and Excel schema (__*.xlsx) together; they merge into one definition set.

groups

FieldNotes
namesGroup name list; in practice often single characters c/s/e
defaultWhen true: tables with no group written automatically belong to this group

Notes:

  • An empty field group = belongs to all groups (most fields are like this).
  • Export of enum/bean is often decided by “whether an exported table references it”; you can also set group explicitly.

targets

FieldNotes
nameName used with the -t flag
managerEntry class name, usually Tables
groupsWhich groups this target exports
topModuleExtra top-level namespace for generated code, e.g. cfg
Project/
luban.conf
Defines/ # XML schema (optional)
Datas/
__tables__.xlsx
__beans__.xlsx
__enums__.xlsx
*.xlsx # data
gen.bat

Common pitfalls

  • schemaFiles omits __tables__ → no tables at all.
  • Wrong target.groups → tables or fields are silently trimmed; it looks like “lost data.”
  • Several projects share one conf but point at the wrong dataDir.