11.4 Visual LANSA Command Line Compiler
Windows command file compile.cmd is located in <RootDir>\LANSA where <RootDir> is the root directory where Visual LANSA is installed. This command file is used to compile Visual LANSA objects from the command line in a Visual LANSA version controlled (VCS) configuration. This allows you to schedule jobs, utilise CI/CD methodology or simply to run your builds from the command line to utilise the options available.
Syntax:
compile /PARTITION= [/PROJECT=] [/OBJECTS=] [/VCONLY=] [/EXCLUDE=] [/OBJTYPE=] [/BUILDID=]
where
/PARTITION = Partition identifier
/PROJECT = A project represented by a Visual LANSA list. The list identifier should be specified in this setting. This determines the "scope". If /PROJECT is specified then only objects in the Visual LANSA list will be compiled. If it is not specified then all objects in the partition will be compiled (subject to any other filters).
/OBJECTS =comm ALL, CHG, CHGXREF
where
ALL = Compile all objects in scope
CHG = Compile only changed objects in scope
CHGXREF = Compile changed objects and objects that refer to them within the scope (Default).
/VCONLY = YES, NO
where
YES = Only include objects under version control (Default)
NO = Include objects whether under version control or not.
/EXCLUDE = Identifier of the Visual LANSA list that contains objects that should not be compiled.
/OBJTYPE = "RUP TABL FORM PROC FUNC THEM SRVM DLG VIEW WEBP WDGT WAM"
where
RUP = Reusable Partition
TABL = Table
FORM = Form
PROC = Process
FUNC = Function
THEM = Theme
SRVM = Server Module
DLG = Dialog
VIEW = View
WEBP = Web page
WDGT = Widget
WAM = Web Application Module.
Specify one or more of these values surrounded by double quotes and space delimited. (Default is all object types).
/BUILDID = Job identifier used to store logs and other information for this specific build. The logs are stored in a directory under <RootDir>\x_win95\x_lansa\x_<PPP>\Compile (where <RootDir> is the root directory where Visual LANSA is installed and <PPP> is the partition identifier). It is recommended that you use a unique BUILDID for every build so the previous build's log files are not lost.
A good tip is to use the current timestamp in the BUILDID. Default is a timestamp in the following format YYYYMMDD_HHMMSSFF (FF is fraction of second).
Examples:
Compile only objects that have changed, are in version control and are part of the project represented by list OL1 in partition DEM:
Compile /PARTITION=DEM /PROJECT=OL1 /OBJECTS=CHG
Compile all objects in partition DEM except for those listed in Visual LANSA list OL5. The build identifier will be 20200702_BetaBuild:
Compile /PARTITION=DEM /VCONLY=NO /EXCLUDE=OL5 /BUILDID=20200702_BetaBuild
Compile all Reusable Parts, Tables, WebPages and Views that have changed in partition DEM:
Compile /PARTITION=DEM /VCONLY=NO /OBJECTS=CHG /OBJTYPE="RUP TABL WEBP VIEW"
Notes
Using /OBJECTS=CHG or CHGXREF:
Ensure that Visual LANSA is not open when using these options. When compile.cmd is run, it will first update Visual LANSA with any changes from the version control folder and it will take note of which objects have changed so that it knows which objects to compile. It is important to note that having Visual LANSA open results in changes in the version control folder automatically being loaded into Visual LANSA. Hence, if you run compile.cmd with these options while Visual LANSA is running or after Visual LANSA has run and before a git pull (or similar action in other version control products) has been performed then no objects will be compiled.