Build VS - BredaUniversityGames/JenkinsLib GitHub Wiki

vs.build()

Builds a Visual Studio / MSBuild project (.sln or .vcxproj).

Usage

stages {
    git.sync()
    vs.build()
    // ...
}

With overrides:

stages {
    git.sync()
    vs.build(
        VS_CONFIG: 'Release',
        VS_PLATFORM: 'x64'
    )
    // ...
}

Prerequisites

  • Visual Studio or MSBuild installed on the build agent
  • The solution/project file accessible in the workspace

Parameters

Parameter Default Description
VS_MSBUILD_PATH (empty) Path to MSBuild.exe
VS_PROJECT_PATH (empty) Path to .sln or .vcxproj file
VS_CONFIG Debug Build configuration
VS_PLATFORM x64 Target platform

How It Works

  1. Invokes MSBuild with the specified configuration and platform
  2. Uses diagnostic verbosity by default for detailed build output
  3. Sets ctx.buildConfig, ctx.buildPlatform, ctx.buildEngine for downstream stages

Finding MSBuild.exe

Common MSBuild paths:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe

You can also find it using the VS Developer Command Prompt:

where msbuild
⚠️ **GitHub.com Fallback** ⚠️