Verbosity for a
build will help us to debug the build results to see what exactly went into
build. In TFS 2013, default build process template TfvcTemplate.12.xaml verbosity level is set to “Normal” by default
and if we need to change the verbosity level we have to download and open the
template and set the Verbosity property value of RunMsBuild activity to
Detailed or Diagnostic or Minimal (Image 1.0)
and then check-in in TFS and then upload it to build.
Steps to enable the logging Verbosity parameter in Build
definition process tab.
Also this change is applicable for all the build definitions which
makes use of build template. So it is not maintain different verbosity levels
for all build definitions. And if we observe the default build process template
(TfvcTemplate.12.xaml) of TFS 2013 we will not find the logging verbosity parameter to set it Minimal, Normal,
Detailed or Diagnostic. (This option is available for TFS 2012 or TFS 2010
build templates by default). But this can be achieved by little customization
to the template
Steps to enable the logging Verbosity parameter in Build
definition process tab.
Download the template TfvcTemplate.12.xaml from build definition
wizard and add it to the version control folder.
Now open this
file in Visual Studio and you can see the workflow defined for TfvcTemplate.12.xaml
template. Click on Arguments tab down the page and create new argument called
Verbosity.
Let the argument
Direction be “In” and change argument type to “Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity”. And set Default value as “Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal” as shown in Image
1.1
This completes defining the build argument and setting its default
value. Now let’s make this argument be available in build definition Process
Tab.
For this, click on Metadata argument in the argument tab and click on the ellipses (…) button under default value column of Metadata argument shown in
Image 1.2
Image 1.2 |
In “Process Parameter Metadata
Editor” window we can add the parameter that has to be appeared in build
definition process parameters Image 1.4
Let us add the parameter Logging verbosity parameter under category
2. Build after
5. Advanced parameter i.e.
6. Logging verbosity
To do this, open” Process Parameter Metadata Editor” and make note of make note of parameter
ProjectsToBuild, because we are adding parameter under same category.
Image 1.5,in our template category value is #200 Build
Image 1.5 |
Now click on Add button and give details as shown in Image 1.6.
Parameter Name | : Verbosity |
Display Name | : 6. Logging verbosity |
Category | : #200 Build |
Description | : Specify the level of logging desired for this build. Higher verbosity levels will typically result in slower builds. |
Value Format String | : Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity |
View this parameter when | : Always show the parameter |
Refer figure Image 1.6
Where Parameter Name should be same as argument name defined, Display Name how you want to display this parameter in build definition, Category under which category you want
to display the parameter, Description explains the parameter in build definition and View this parameter when for enabling this parameter either only in build
definition or only when queuing the build or both definition and queuing the build or never.
Image 1.6 |
Then click ok and save the changes then check-in the template to Source Control. Use this customized template in build definition and you will be able to see the new parameter logging verbosity as shown in Image 1.7
Create a new build definition and while queuing you can edit this verbosity value in queue build parameter window as shown in
Image 1.8
Image 1.8 |
Thank you for reading this blog.
No comments:
Write comments