Configuration & variables
The project configuration is centralized in a single file : TelosysTools/telosys-tools.cfg
This file is a "properties file" (i.e. a file containing parameters with their value).
Each line has the following syntax :
1
name = value
Copied!
Each line starting with a "#" is a comment :
1
# this is a comment
Copied!
Each parameter can be :
    a standard variable
    a specific variable
    a specific location (a folder where to get the templates or where to generate the files)
    a network proxy setting (for templates installation via http)
With Telosys-CLI you can print the current configuration using the cfg command.

Variables

By convention, the variables defined at the project level are always in upper case. All the defined variables (standard & specific) are visible and usable in templates (".vm" files). They can also be used in the "templates.cfg" file in bundles of templates.

Standard variables

A "standard variable" is a variable which is supposed to be defined in most cases (for all types of projects).
Examples :
1
# -------------------------------------------
2
# STANDARD VARIABLES
3
# -------------------------------------------
4
# --- Folders
5
SRC = src/main/java
6
RES = src/main/resources
7
WEB = src/main/webapp
8
TEST_SRC = src/test/java
9
TEST_RES = src/test/resources
10
DOC = doc
11
TMP = tmp
12
# --- Packages
13
ROOT_PKG = org.foo.bar
Copied!

Specific project variables

A "project-specific variable" is a variable defined specifically for the current project. For example, a project variable can be defined in a project to generate PHP code and not defined in another project which aims to generate Python code.
Note : a project variable cannot override a standard variable.
Examples :
1
# -------------------------------------------
2
# SPECIFIC VARIABLES
3
# -------------------------------------------
4
# Project configuration :
5
ProjectVariable.PROJECT_NAME = cool-project
6
ProjectVariable.MAIN_ENTITY = Employee
7
ProjectVariable.PROJECT_VERSION = 1.0.0-SNAPSHOT
8
ProjectVariable.MAVEN_GROUP_ID = com.foo.bar
9
10
# Modules directories :
11
ProjectVariable.MICROSERVICE_DIR = employee-ms
12
ProjectVariable.APPLICATION_DIR = application
13
ProjectVariable.COMMONS_DIR = commons
Copied!

Specific folders

In the configuration file you can define the following specic folders :
    SpecificTemplatesFolder : Specific location for templates
    SpecificDestinationFolder : Specific destination for code generation
Examples :
1
#-- Specific location for templates (Windows) :
2
SpecificTemplatesFolder=C\:\\dir1\\dir2
3
4
#-- Specific location for templates (Linux) :
5
SpecificTemplatesFolder=/dir1/dir2
6
7
#-- Specific destination for code generation (Windows) :
8
SpecificDestinationFolder=C\:\\dir1\\dir2
9
10
#-- Specific destination for code generation (Linux) :
11
SpecificDestinationFolder=/dir1/dir2
Copied!
Last modified 3mo ago