MSBuild allows you to build AB Suite applications on TFS . To build an application using TFS , you must create a Build Definition.
Note: By opening an AB Suite solution, the default values are assigned to the required fields.
To create a Build Definition without a solution file being open, perform the following:
Connecting to TFS
You must connect to TFS before creating a build definition.
On the View menu, click Team Explorer.
The Team Explorer window appears.
Click Manage Connections > Connect to Team Project.
The Connect to Team Foundation Server dialog box appears.
Select Servers… to select a server or to add a new server.
Select Team Project Collections where the AB Suite Team Project is located.
Select Team Projects where the AB Suite version files are located.
Click Connect.
Creating a Build Definition
You must create and configure a build definition to build an application. To create and configure build definitions, perform the following. The following example uses TFS 2018 to build the system for Windows runtime:
Select New Build Definition on the Team Explorer window from the Build context menu.
The New Build Definition dialog box appears.
Note: Create a build agent before creating a New Build definition. Refer to the Microsoft documentation for more information on configuring and managing your build systems.
Click Add build step….
The ADD BUILD STEPS dialog box appears.
In the ADD BUILD STEPS dialog box, select Build.
Scroll through the displayed list and locate to Visual Studio Build.
Click Add to add the visual studio build.
In the ADD BUILD STEPS dialog box, select Utility.
Select Batch Script and click Add.
Click Close to close the ADD BUILD STEPS dialog box.
A build definition is created.
Note: To rename the build definition, right click the build definition and click Rename…. Enter the Name and click OK.
To set project, MSBuild Arguments, configuration, and platform parameters under the Build tab, perform the following:
In the Solution field, browse the AB Suite project (System Modeler project (.smproj)) file that needs to be build.
Enter the build arguments in the MS Build arguments field in the following format:
/t:buildmode/p:s=<build_sqlserver>;d=<model_database>;u=<host_usercode>;p=<host_password>;sdp=generate;edp=install;ip=true
Description for various place holders in the build argument format is given in the following table:
Switch/Property |
Name |
Description |
---|---|---|
/t:buildmode | Target | Build mode: rebuild, build, or clean. |
s | SQLServer | SQL Server that contains the AB Suite model to build. (Local) is the default local SQL Server instance. |
d | Database | Name of a database containing the application you want to build. |
u | UserCode | User code to connect to the host machine. |
p | Password | Password used to connect to the host machine. For security purposes, you can encrypt the password using the Encrypt a Password utility. To encrypt a password, perform the following steps:
You can use this encrypted password while performing MSBuild or in the MSBuild Settings file. |
sdp | Start Deployment Phase | Generate MSI package is compiled and created |
edp | End Deployment Phase | Install Installs the package in the Package Installation Directory |
ip | ImportProject | When this property is set to True
Note: It is mandatory to set this property to True for a TFS Build. |
Enter Release in the Configuration field.
Enter Windows in the Platform field.
Expand the Advanced node and select MSBuild x86 in MSBuild Architecture.
On the Options tab, perform the following:
Select the Multiconfiguration checkbox if you want to continue running other configurations in case of any failure in the current configuration settings.
Or
Clear the Multiconfiguration checkbox if you do not want to continue running other configurations in case of any failure in the current configuration settings.
On the Repository tab, perform the following:
Select Team Foundation Version Control from the list as Repository type.
Repository name field displays the repository name.
On the Triggers tab, perform the following:
Select Continuous integration (CI) to build each check in.
Select Scheduled to schedule the build every week on a following day.
On the General tab, perform the following:
Select the Default Queue from the displayed list.
Enter the build description in the Description field.
Specify the maximum time (in minutes) for which the build can be executed on an agent before being cancelled by server in the Build job timeout in minutes field.
Using Build Definitions
You can add the build definitions to a queue and trigger a build for an application. To set a queue for a build definition, perform the following:
Select your application from the Team Explorer window, right-click, and select Queue New Build.
The Queue Build dialog box appears.
Click Queue.
The build begins and a message is displayed upon completion.
Notes:
You must run the build service as Administrator to perform a TFS build.
To run the build service as Administrator, perform the following:
On the left pane, select Build Configuration.
The Build configuration page appears on the right pane.
Click the Properties link.
The Build Service Properties dialog box appears.
In the Run the service as group, click Change to set the build service as Administrator.
Click OK.
To view the build summary, perform the following:
Select My Builds from the Team Explorer window.
Builds created are listed under My Builds.
Double-click the build for which you want to view the build summary.
The Build Summary page displaying build details appears.
Click Download all logs as zip to download all build logs.