Debian Codegraph @

tools/build-tool/data/README.md

raw
1 Data of the Castle Game Engine Build Tool.
2
3 Some of the files and subdirectories here (like android/integrated/ , ios/xcode_project/) are copied to the final project (e.g. for Android and iOS) using our custom system for templates and macros.
4
5 Basic syntax of macros (which you can use in any text template file):
6
7 - ${MacroVariableName} - Insert given variable name. See the TCastleProject.ReplaceMacros implementation for a list of possible macros.
8
9 This can be used in a "normal" context (outside of an expression within ${IF xxx}, ${CALCULATE xxx} or similar). Then we simply insert the value without any additional processing.
10
11 This can also be used in CastleScript expressions (inside ${IF xxx}, ${CALCULATE xxx} or similar). In this case we insert the value converted to a CastleScript string constant (with added apostrophes around, quoted apostrophes inside).
12
13 - ${CALCULATE xxx}
14
15 Calculate the xxx as a CastleScript expression that should return String.
16
17 - ${IF xxx}
18 one text to include
19 ${ELSE}
20 alternative text to include
21 ${ENDIF}
22
23 Calculate the xxx as a CastleScript expression that should return Boolean.
24 If true, executes 1st part, otherwise executes the 2nd.
25 The "${ELSE} .. " block is optional.
26
27 TODO: Nesting ${IF} within ${IF} is not implemented yet.
28
29 See https://castle-engine.io/castle_script.php for the documentation of CastleScript.
30
31 The core of it is implemented in TCastleProject.ExtractTemplateFile, TCastleProject.ReplaceMacros and ToolMacros unit.