settings.xml - metzzo/123-basic GitHub Wiki
This file located at 123basic.app/Target/settings.xml
tells the compiler what to do with the compiled code, so any target specific stuff.
This is the root node which contains multiple <target>
tags.
The <header>
tag adds a header to the compiled source. This is a file that is included to the beginning of every 123basic project.
The <target>
tag introduces a new target to the compiler. This tag may contain <template>
, <lib>
, <extension>
, <file>
or <action>
tags.
Attributes:
-
name
attribute is the internal name of that target. With this parameter the compiler knows which target it has to compile when it is launched -
lang
attrribute specifies the backend that is used when compiling. Currently there is only JS fully working (cs for C# and vm for the virtual machine do not fully support the language)
The <template>
tag is the "exe" file which will be run when finished. $GFX_WIDTH and $GFX_HEIGHT is replaced with the respective set width and height in the configuration file.
Attributes:
-
path
specifies the path to the template, base path is123basic.app/TARGETNAME
-
name
The name of the created file in the compiled project -
mode
Depending on the current compilation mode (console mode/2d mode/3d mode) different templates may be used. Only if the current mode is in this attribute included it is active.
The <lib>
tag embeds a new library into the source code (which may be a js file or cs file or whatever, it is simply put into the resulting file).
Attributes:
-
path
specifies the path to the library, base path is the path of the current compiled project. -
mode
Depending on the current compilation mode (console mode/2d mode/3d mode) different libraries may be used. Only if the current mode is in this attribute included it is active.
The <extension>
tag specified what should happen with certain file extensions in the project. Some files need to be converted into a certain file format, others ignored
Attributes:
-
name
Specifies which extension this rule should apply to. -
action
Specifies what should be done. Possible values are: ignore (ignores the file), warning (emits a compiler warning stating that this file extension is not supported), mp3 (converts this file to a mp3 file), ogg (converts this file to an ogg file)
The <file>
tag specified what should happen with certain file names in the project. Some files need to be converted into a certain file format, others ignored
Attributes:
-
name
Specifies which file this rule should apply to. -
action
Specifies what should be done. Possible values are: ignore (ignores the file), warning (emits a compiler warning stating that this file extension is not supported), mp3 (converts this file to a mp3 file), ogg (converts this file to an ogg file)
The <action>
tag specifies what commands should be executed after compilation was successful. There are multiple possible action types:
-
embeddata
Embeds all the necessary meta data into the meta data file (DIR_STRUCTURE
) -
appbeforelibs
Insert all libraries into the generated file -
optimize
Optimizes code with a given optimizer (name
), currently onlyclosure
for Google Closure is supported -
save
Saves the generated code into the target directory undername
(base path is project directory) -
insertfont
insertssmalfont.png
file into the project directory -
run
Runs a command in the command line