Skip to content

XAML PostBuild script

Codeblack edited this page Mar 12, 2017 · 2 revisions

This is a script that is to be used as the post-build script in a build-workflow. It uses the Remove-BOM and Invoke-SonarRunner functions to remove the Byte Order Marks from the source-files and then run a sonar-analysis.

Select this script as the 'Post-build script path' process parameter. It is in the 'Advanced' sub-section of the 'Build' section, which is collapsed by default. The actual path depends on how you installed the scripts into your version-control.

The parameters for the script are provided as the 'Post-build script arguments' process parameter. See the description of the Invoke-SonarRunner function to see what parameters are available. The SourcesDirectory for both functions is provided by this script and taken from the build-environment; it cannot be provided to this script. The other parameters are passed to the Invoke-SonarRunner function.

The image below shows an example of explicitly provided parameters. (This is a build-definition for a Git-repository.)

PostBuild-script in build-definition

Parameters

SonarRunnerBinDirectory

Specifies the directory containing the SonarRunner binaries. Default is 'C:\sonar\bin'.

SonarPropertiesFileName

Specifies the name of the sonar-properties file. Default is 'sonar-project.properties'. This file-name should be relative to the sources-directory on the build-agent, as specified by the $(SourceDir) in the workspace of the build-definition.

Disabled

Specifies that no changes should be made.

Verbose

Specifies that more detailed logging should be provided.