@@ -15,13 +15,15 @@ public class OutputGenerator : IOutputGenerator
1515 private readonly IConsole console ;
1616 private readonly IFileSystem fileSystem ;
1717 private readonly IOptions < GitVersionOptions > options ;
18+ private readonly Lazy < GitVersionContext > versionContext ;
1819 private readonly ICurrentBuildAgent buildAgent ;
1920
20- public OutputGenerator ( ICurrentBuildAgent buildAgent , IConsole console , IFileSystem fileSystem , IOptions < GitVersionOptions > options )
21+ public OutputGenerator ( ICurrentBuildAgent buildAgent , IConsole console , IFileSystem fileSystem , IOptions < GitVersionOptions > options , Lazy < GitVersionContext > versionContext )
2122 {
2223 this . console = console ?? throw new ArgumentNullException ( nameof ( console ) ) ;
2324 this . fileSystem = fileSystem ?? throw new ArgumentNullException ( nameof ( fileSystem ) ) ;
2425 this . options = options ?? throw new ArgumentNullException ( nameof ( options ) ) ;
26+ this . versionContext = versionContext ;
2527 this . buildAgent = buildAgent ;
2628 }
2729
@@ -30,7 +32,7 @@ public void Execute(VersionVariables variables, OutputContext context)
3032 var gitVersionOptions = options . Value ;
3133 if ( gitVersionOptions . Output . Contains ( OutputType . BuildServer ) )
3234 {
33- buildAgent ? . WriteIntegration ( console . WriteLine , variables ) ;
35+ buildAgent ? . WriteIntegration ( console . WriteLine , variables , versionContext . Value . Configuration . UpdateBuildNumber ) ;
3436 }
3537 if ( gitVersionOptions . Output . Contains ( OutputType . File ) )
3638 {
0 commit comments