The syntax of MSBuild command line to build a project includes several switches to specify the various features of the building process:
MSBuild.exe [ProjectFile] [Switches]
The syntax of MSBuild command line arguments for an AB Suite application is as follows:
Without using MSBuild Settings File
MSBuild.exe <ProjectPath> </p:c> </p:pf> [/p:d] [/p:s] [/p:el] [/p:ef] [/p:u] [/p:bp] [/p:ac][/p:ap][/p:cc][/p:fc][/p:fp] [/p:fa] [/p:fob] [/p:od] [/p:bd] [/p:sdp] [/p:edp] [/p:rca] [/p:BuildDebugSystem] [/p:CreateDatabase] [/target] [/flp:LogFile=logfilename] [/nologo / noconsolelogger]
Using MSBuild Settings File
MSBuild.exe <ProjectPath> </p: MSBuildSettingsFile> [/p:c] [/p:pf] [/p:d] [/p:s] [/p:el] [/p:ef] [/p:u] [/p:bp] [/p:ac][/p:ap][/p:cc][/p:fc][/p:fp] [/p:fa] [/p:fob] [/p:od] [/p:bd] [/p:sdp] [/p:edp] [/p:rca] [/p:BuildDebugSystem] [/p:CreateDatabase] [/p:BuilderLogMsgLevel] [/p:th] [/p:thdmin] [/p:thdmax] [/p:rbt] [/p:bc] [/p:bo] [/p:sbfge] [/p:sbgw] [/p:pdt] [/p:ni] [/target] [/flp:LogFile=logfilename] [/nologo / noconsolelogger]
Examples:
Msbuild C:\MSBuildSample.smproj /Property: MSBuildSettingsFile=c:\ MSBuildSettings.xml
Msbuild C:\MSBuildSample.smproj /target:clean /Property:
MSBuildSettingsFile=c:\ MSBuildSettings.xml
Msbuild C:\MSBuildSample.smproj /
Property:Platform=Windows;Configuration=Release;UserCode=Cust;Password=Cust
Msbuild C:\MSBuildSample.smproj /
Property:Platform=Windows;Configuration=Release;
UserCode=Cust;Password=Cust;ElementList= EAESAMPLE.Reports;
EAESAMPLE.ORDER_ENTRY.COMP_ORD
Msbuild “C:\MSBuildSample.smproj” /
Property:Platform=Windows;Configuration=Release;
BuildDebugSystem=true;Database=dbname;CreateDatabase=true
The following tables lists the command line arguments used to build an AB Suite application, which are listed as Common, Windows, MCP, and Debugger switches:
Common Switches
Switch |
Short Form |
Description |
---|---|---|
ProjectPath |
| Specifies the complete path of an AB Suite project file that needs to be built. This input is mandatory for MSBuild.exe. |
Target | /t | Specifies the target to be built. For example, /target: rebuild |
Property | /p | Specifies the properties to build or rebuild an application. For example, /p:configuration=release;platform= windows |
LogFile | /flp | Specifies the name of the file where logging information is stored. A log file is not created if a file name is not specified. For example, /flp:LogFile=MyLogFileFullName |
NoConsoleLogger | /nologo | Stops displaying logging message at the command prompt. By default, logging messages are displayed. For example, /noconsolelogger /nologo |
Target Switches
Switch Value |
Short Form |
Description |
---|---|---|
Clean |
| Specifies removing the generated files for the selected model. The cleaned elements are rebuilt next time an application is built. For example, /target:Clean Note: The /target: Clean command must not be used with /el command. |
Rebuild | b | The elements associated with the build are rebuilt even if they have not changed since the last build. For example, /target:Rebuild |
Property Switches
Switch |
Short Form |
Description |
---|---|---|
Configuration | Specifies the name of the configuration you want to build. For example, /Property:configuration=Release | |
Database | d | Specifies the name of a model containing the application you want to build. For example, /Property:d=MyDatbaseName Note: This parameter is optional if the sf option is used and if you specify the <Database> option in the builder setting file. |
Configuration | c | Specifies the name of a configuration that you want to build. For example, /Property:c=Release Note: This parameter is optional if the sf option is used and if you specify the <Configuration> option in the builder setting file. |
Platform | - | Specifies the name of a platform on which the application is built. For example, /Property:platform=MCP Note: This parameter is optional if the sf option is used and if you specify the <Platform> option in the builder setting file. |
MSBuildSettingsFile | sf | Specifies the path to the MSBuild SettingsFile. For example: /Property:sf= MSBuildSettingsFileFullName Note: MSBuild SettingsFile is an XML file and contains all the build details to build an AB Suite application. |
SQLServer | s | Specifies the SQL Server that contains the model stated previously. The server is the name of the SQL Server that contains the model and (Local) is the default local SQL Server instance. For example, /Property:s=MyDatabaseInstance |
ElementsList | el | Specifies a deployable element, fully qualified name of a single report, fully qualified name of a single ispec in the model that you want to build. For example, /Property:el=”segment1;segment2”; |
ElementsFile | ef | Specifies a file name containing a list of elements you want to build. For example, /Property:ef =MyElementsFileFullName |
UserCode | u | Specifies the user code to connect to the host machine. For example, /Property:u=MyUserCode |
Password | p | Specifies the password used to connect to the host machine. For example, /Property:p=MyPassword |
FolderOnlyBuild | fob | Builds the specified folder and does not build the sub folders. If a deployable element argument is not specified, this argument is ignored. This means, the whole model is built using the d <model name> switch. For example, /Property:fob=True |
NumberofThreads | th | Specifies the number of build threads. For example, /Property:th=5 |
MinimumDependency LogThreads | thdmin | Specifies the minimum dependency log threads during the generate phase. For example, /Property: thdmin=5 |
MaximumDependency LogThreads | thdmax | Specifies the maximum dependency log threads after the generate phase. For example, /Property:thdmax=5 |
BuilderLogMsgLevel | - | Specifies the log level. For example, /Property:BuilderLogMsgLevel =<L/H/M> |
RebuildThreshold | rbt | Specifies the rebuild threshold. For example, /Property:rbt=<L/O/H/I/M> |
BuildCache | bc | Specifies the location of the build cache. For example, /Property:bc=“<tmp directory>\BuilderCache” |
BuildOutput | bo | Specifies the location of the build output files. For example, /Property:bo=“<tmp directory>\BuilderOutput” |
OverwriteDatabase | od | If set to true, overwrites the existing database. For example, /Property:od=True |
BackupDatabase | bd | If set to true, creates a backup of the runtime database. For example, /Property:bd=True |
BuildPreview | bp | If set to true, the build displays a summary of the elements that require regeneration. For example, /Property:bp=True |
ImportProject | ip | If set to true, imports the project and creates a new model database (specified by the property id), in case the database does not exist. For example, /Property:ip=True |
StopBuildAt FirstGenerateError | sbfge | If set to true, stops the build when the first generate error appears. For example, /Property:sbfge=True |
StopBuild IfGenerationWarning | sbgw | If set to true, stops the build when a generation warning appears. For example, /Property:sbgw=True |
PrintDate | pdt | If set to false, does not print the current date and time. For example, /p:pdt=False |
NativeImages | ni | If set to true, generates the native images. For example, /p:ni=True |
Windows Switches for Property
Switch |
Short Form |
Description |
---|---|---|
StartDeployPhase | sdp | Specifies the initiation of the deploy phase for a build. For example, /Property: sdp =generate |
EndDeployPhase | edp | Specifies the termination of the deploy phase for a build. For example, /Property: edp =generate |
EnableRCA | rca | If set to true, enables to analyze the online changes for reports; that is, not ignoring the dependencies on report build. For example, /Property: rca =True |
MCP Switches for Property
Switch |
Short Form |
Description |
---|---|---|
AccessCode | ac | Specifies the Access Code for an MCP host. For example, /Property:ac=MyAccessCode |
AccessPassword | ap | Specifies the Access Password for an MCP host. For example, /Property:ac=MyAccessPassword |
ChargeCode | cc | Specifies the Charge Code for an MCP host. For example, /Property:cc=MyChargeCode |
EnableIDR | idr | If set to true, online dependencies for a report are ignored by the report build, that is, the analysis of online changes for a report build is disabled. For example, /Property: idr=True |
IgnoreDependency OnReportBuild | idr | If set to true, change analysis will ignore any report dependencies on classes, methods, or segment attributes and allow the report build to proceed. For example, /Property: idr=True Note: You must ensure that any legitimate requirement for a system build is not ignored. |
FTPUserCode | fu | Specifies the FTP User Code for an MCP host. For example, /Property:fu=MyFTPUserCode |
FTPPassword | fp | Specifies the FTP Password for an MCP host. For example, /Property:fp=MyFTPPassword |
FTPAccount | fa | Specifies the FTP Charge Code for an MCP host. For example, /Property:fa=MyFTPAccount |
Debugger Switches for Property
Switch | Short Form | Description |
---|---|---|
BuildDebugSystem | bds | If set to true, builds the System for the Debugger. For example, /Property:BuildDebugSystem=True Note: By default, build process uses the Debugger properties that are set on the Model node of an AB Suite system. You can override these properties by using the Property switch. See Overridable Debugger Properties for more information on properties that you can override using the Property switch. |
CreateDatabase | cdd | If set to true, a database is created automatically for the model containing the application that you want to build. For example, /Property:CreateDatabase=True The database is not recreated if the database exists. Note: This parameter can be used only if the BuildDebugSystem parameter is set true. |
The following MSBuild switches are supported but do not have any effect on AB Suite build and there is no change in the MSBuildSettings.xml file:
/maxcpucount [:n]
/toolsversion:<version>
verbosity:<level>
/consoleloggerparameters
/fileLogger[n]
/fileloggerparameters[n]:<parameters>
/distributedFileLogger
/logger:<logger>
/validate
/validate:<schema>
/ignoreprojectextenstions : <extensions>
/nodeReuse:<parameters>
/preprocess[:file]
/detailedsummary
@<file>
/noautoresponse
/version
/maxcpucount [:n]
Note: Refer to the MSDN documentation for more information on the above mentioned MSBuild options.
Overridable Debugger Properties
The AB Suite project imports a project file, SystemModeler.targets, that enables MSBuild to build a project. The SystemModeler.targets file calls the AB Suite System Modeler build task and passes the values to the Build task. The Build task then instantiates the AB Suite Builder.
The following is an extract from the SystemModeler.targets file. The properties that are in bold can be overridden for building a Debugger system when BuildDebugSystem is set to true.
<Target Name="CoreBuild">
<SystemModelerBuildTask BuildMode="$(BuildMode)"
ProjectPath="$(MSBuildProjectFullPath)"
ImportProject="$(ImportProject)"
Database="$(Database)"
SQLServer="$(SQLServer)"
BuildDebugSystem="$(BuildDebugSystem)"
DeploymentFolder="$(DeploymentFolder)"
CreateDatabase="$(CreateDatabase)"
DebugLanguage="$(DebugLanguage)"
AlternateName="$(AlternateName)"
ClassDBName="$(ClassDBName)"
HostDatabaseAccess="$(HostDatabaseAccess)"
ReorgDatabase="$(ReorgDatabase)"
RemoteCallStatements="$(RemoteCallStatements)"
DebugSysNamePrefix="$(DebugSysNamePrefix)"
DatabaseServerRegistration="$(DatabaseServerRegistration)"
DatabaseName="$(DatabaseName)"
MCPLanguageMode="$(MCPLanguageMode)"
ValueOfGlbMachine="$(ValueOfGlbMachine)"
AllowRecovery="$(AllowRecovery)"
ReportOutputMode="$(ReportOutputMode)"
UserMaintainedTables="$(UserMaintainedTables)"
DatabaseKind="$(DatabaseKind)"
DatabaseUserName="$(DatabaseUserName)"
DatabasePassword="$(DatabasePassword)"
DatabaseHostName="$(DatabaseHostName)"
DatabasePortNumber="$(DatabasePortNumber)"
RSSUserName="$(RSSUserName)"
RSSPassword="$(RSSPassword)"
RSSDataTranslationRoutineexists="$(RSSDataTranslationRoutineexists)"
RSSServerName="$(RSSServerName)"
RSSPrimaryDisk="$(RSSPrimaryDisk)"
RSSSecondaryDisk="$(RSSSecondaryDisk)">
</SystemModelerBuildTask>
</Target>
The SystemModeler.targets file imports two files, <ABSuiteProjectName>.smproj.smsfm file and <ABSuiteProjectName>.user file.
The <ABSuiteProjectName>.smproj.smsfm file contains details of the Database and Server.
The <ABSuiteProjectName>.user file contains details of the Debugger properties.
When the project file is loaded, it loads the properties that match the conditions set on the PropertyGroup for the Configuration and Platform.
The following is a sample <ABSuiteProjectName>.user file:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Platform Condition="'$(Platform)' == ''">Windows</Platform> <Configuration Condition="'$(Configuration)' == ''">Release</Configuration> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Windows'"> <AlternateName>SampleProject</AlternateName> <UseGateway>False</UseGateway> <ReorgDatabase>Yes</ReorgDatabase> <ClientTechnoFolder>6fa18df0-15b4-11dd-8aa3-0003ff0b781b</ClientTechnoFolder> <ClassToDebug>00000000-0000-0000-0000-000000000000</ClassToDebug> <DebugSystemNamePrefix>SP</DebugSystemNamePrefix> <DatabaseServerRegistration>default</DatabaseServerRegistration> <DatabaseName><SampleProjectDB/DatabaseName> <ClassDBName>SampleProj</ClassDBName> <WorkingDirectory>C:\Projects\debug\bin\</WorkingDirectory> <DeploymentFolder>4eeed320-fbbf-11dc-b501-0003ff0b781b</DeploymentFolder> <ValueOfGlbMachine>AsPerHost</ValueOfGlbMachine> <AllowRecovery>Yes</AllowRecovery> <DatabaseUserName>ABC</DatabaseUserName> <DatabasePassword>/WsMiGUypqwbHKDsTF7CVQ==</DatabasePassword> <DatabasePortNumber>1769</DatabasePortNumber> <ReportOutputMode>OutputWindow</ReportOutputMode> <UserMaintainedTables>False</UserMaintainedTables> </PropertyGroup> </Project>
Notes:
If you delete the .user file the Debugger settings will be lost. Furthermore, all the properties will be reset to the default values.
If you delete the .smsfm file you will be prompted to select a database for the project.
MSBuild Settings File
The MSBuildSettings.xml file consists of all the build details to build and clean the AB Suite application. You can modify the value of any item with customized values and MSBuild.exe reads the values to build or clean AB Suite application.
A sample MSBuildSettings.xml file is provided in the bin directory of AB Suite for you to use. The following is the content of the sample MSBuildSettings.xml file:
<?xml version=1.0 ?> <configuration xmlns=http://tempuri.org/config.xsd version=1.0> <?xml version=1.0 ?> <Builder> <Database></Database> <SQLServer></SQLServer> <ImportProject>false</ImportProject> <BuildPreview>false</BuildPreview> <FolderOnlyBuild>false</FolderOnlyBuild> <Configuration>Release</Configuration> <Platform>Windows</Platform> <ElementList> <Element></Element> </ElementList> <BackupDatabase>true</BackupDatabase> <EnableRCA>false</EnableRCA> <OverwriteDatabase>false</OverwriteDatabase> <IgnoreDependencyOnReportBuild>false</IgnoreDependencyOnReportBuild> <ValidateAll>false</ValidateAll> <NumThreads>1</NumThreads> <MinDependencyLogThreads>1</MinDependencyLogThreads> <MaxDependencyLogThreads>5</MaxDependencyLogThreads> <ReBuildThreshold>25</ReBuildThreshold> <BuildCache>C:\ProgramData\Unisys\ABSuite\7.0\Build\Cache</BuildCache> <BuildOutput>C:\ProgramData\Unisys\ABSuite\7.0\Build\Output</BuildOutput> <Windows> <UserCode>Windows UserCode</UserCode> <Password>Windows password</Password> <Domain>Windows domain</Domain> <StartDeployPhase>Generate</StartDeployPhase> <EndDeployPhase>Generate</EndDeployPhase> </Windows> <MCP> <UserCode>MCP UserCode</UserCode> <Password>MCP Password</Password> <AccessCode>MCP AccessCode</AccessCode> <AccessPassword>MCP Access Password</AccessPassword> <ChargeCode>MCP Charge Code</ChargeCode> <FTPUserCode>FTP UserCode</FTPUserCode> <FTPPassword>FTP Password</FTPPassword> <FTPAccount>FTP Account</FTPAccount> <DelayDate>YYYYMMDD</DelayDate> <DelayTime>HHMM</DelayTime> <NumberOfParallelGenerates>2</NumberOfParallelGenerates> <NumberOfReorgTasks>1</NumberOfReorgTasks> <NumberOfParallelCompiles>1</NumberOfParallelCompiles> </MCP> </Builder> </configuration>
Meaning of the XML Tags in MSBuildSettings.xml
The following table lists the XML tags in the MSBuildSettings.xml file for each platform, which are listed as common, Windows, and MCP tags:
Common XML tags
XML Tags |
Description |
---|---|
Database | Specifies the name of the model containing the application you want to build. |
SqlServer | Specifies the SQL Server that contains the model stated previously. The server is the name of the SQL Server that contains the model and. (Local) is the default local SQL Server instance. |
ImportProject | If set to true, the project is imported. |
Configuration | Specifies the name of the configuration you want to build. |
UserCode | Specifies the user code to connect to the host machine. |
Password | Specifies the password used to connect to the host machine. |
Platform | Specifies the name of the platform on which the application is built. |
Elementlist | Specifies the elements that are built apart from the model. |
Backupdatabase | If set to true, creates a backup of the runtime database. |
OverwriteDatabase | If set to true, overwrites the existing database. |
BuildPreview | If set to true, displays a summary of the elements that require regeneration. |
FolderOnlyBuild | Builds the specified folder and does not build the subfolders. If a deployable Element argument is not specified, this argument is ignored. This means, the whole model is built using the d <model name> switch. |
NumThreads | Specifies the number of build threads. |
MinDependencyLogThreads | Specifies the minimum dependency log threads during the generate phase. |
MaxDependencyLogThreads | Specifies the maximum dependency log threads after the generate phase. |
RebuildThreshold | Specifies the rebuild threshold. |
BuildCache | Specifies the location of the build cache. |
BuildOutput | Specifies the location of the build output files. |
Windows XML tags
XML Tags |
Description |
---|---|
Domain | Specifies the domain name. |
StartDeployPhase | Specifies the initiation of the deploy phase for a build. |
EndDeployPhase | Specifies the termination of the deploy phase for a build. |
MCP XML tags
XML Tags |
Description |
---|---|
AccessCode | Specifies the MCP AccessCode set on the target host under which the application is generated. |
AccessPassword | Specifies the Password of the Accesscode used in the AccessCode tag. |
ChargeCode | Specifies the MCP ChargeCode set on the target host. |
FTPUserCode | Specifies a valid usercode for FTP connection to the host. This usercode must be defined as a valid user in the FTP Server software on the specified target host. You must first log into the Builder Server by using MCP login details before generating a System or Report. The information required to log in is determined by the target host. In addition, an FTP session must be established for all hosts and the FTP login details must be specified. |
FTPPassword | Specifies the password of the FTP username specified in the FTPUserCode tag. |
FTPAccount | Specifies the MCP chargecode for the FTP Server software on the specified target host. |
DelayDate | Specifies the date to delay the host part of the build. |
DelayTime | Specifies the time to delay the host part of the build. |
NumberOfParallelGenerates | Specifies the number of Build threads used. |
NumberOfReorgTasks | Specifies the maximum number of reorganization tasks that can occur simultaneously. By default, the value is 1 and can range from 1 to 9,999. |
NumberOfParallelCompiles | Specifies the number of compile threads (multithreading) running concurrently. By default, the value is 1 and can range from 1 to 9,999. |
Use of MSBuild with Migrated AB Suite Applications
You must use MSBuild to build an AB Suite application as Builder.exe is deprecated from AB Suite 7.0 onwards. To use MSBuild with migrated AB Suite applications you require a .smproj file, which is created when you create a new AB Suite application. However, you can use a dummy .smproj file, which is an empty AB Suite project file, and reuse it when you want to build any AB Suite application. You can use a dummy .smproj file as all values are passed through the command line or through the Debugger properties that are set on the Model node of an AB Suite application.
The following table describes the property switches that were used when using the Builder.exe and the corresponding property switches that you must use when using MSBuld:
Builder.exe | MSBuild |
---|---|
- | <smproj file path> |
/m <DatabaseName> For example, /m SampleModel | /p:d=<DatabaseName> For example, /p:d=SampleModel |
/c <Configuration> For example, /c Release | /p:configuration=<Configuration> For example, c=Release |
- | /p:platform=<Platform> For example, pf=Windows; |
/x <StartBuildPhase> For example, /x generate | /p:sdp=<StartBuildPhase> For example, sdp=Generate; |
/y <EndBuildPhase> For example, /y install | /p:edp=<EndBuildPhase> For example, edp=Install; |
/u <AppUser> For example, /u AppUser | /p:u=<AppUser> For example, u=AppUser; |
/p <AppuserPassword> For example, /p App1User | /p:p=<AppuserPassword> For example, p=App1User; |
/re <ElementName> For example, /re SampleFolder | /p:el=<ElementName> For example, el=SampleFolder; |
/o | /p:fob=True |
/s <MyDatabaseInstance> | /p:s= <MyDatabaseInstance> |
/rf <ElementFileName> | /p:ef=<ElementFileName> |
/f <BuildSettingsXMLFile> (Not identical) | /p:sf=<MSBuildSettingsFile> (Not identical) |
/d | /p:od=True |
/bp | /p:bp=True |
/dbg | /p:BuildDebugSystem=True |
/va | /p:ValidateAll=True |
/vn | /p:BuilderLogMsgLevel:<level> |
/w | /p:rca=True |
/c <AccessCode> | /p:ac=<AccessCode> |
/ap <AccessPassword> | /p:ap=AccessPassword |
/cc <ChargeCode> | /p:cc=<ChargeCode> |
/fc <FTPUserCode> | /p:fu=<FTPUserCode> |
/fp <FTPPassword> | /p:fp=<FTPPassword> |
/fa <FTPAccount> | /p:fa=<FTPAccount> |
/q | /noconsolelogger, /nologo |
/b, /e | /t:rebuild/clean For example, /t:rebuild |
/l <LogFileName> For example, /l "C:\SampleSys_SysOnlyRebuild_Trunk3.log" | /flp:LogFile=<LogFileName> For example, /flp:LogFile= "C:\SampleSys_SysOnlyRebuild_Trunk3.log" |
/th <Number of threads> | /p:th=<Number of threads> |
/thdmin <no.> | /p:thdmin=<Number of minimum dependency log threads> |
/thdmax <no.> | /p:thdmax=<Number of maximum dependency log threads> |
- | /p:rbt=<L/O/H/I/M> |
- | /p:sbfge=True |
- | /p:sbgw=True |
/pdt | /p:pdt=True |
/ni | /p:ni=True |
- | /p:aft=<Number of AsyncFTPNumThreads> |
/nl | /p:nl=True |