@@ -16,6 +16,10 @@ parameters:
1616 displayName : Optional OptProfDrop Override
1717 type : string
1818 default : ' default'
19+ - name : EnableOptProf
20+ displayName : Enable OptProf data collection for this build
21+ type : boolean
22+ default : true
1923
2024variables :
2125 # if OptProfDrop is not set, string '$(OptProfDrop)' will be passed to the build script.
@@ -153,6 +157,7 @@ extends:
153157 AccessToken : ' $(System.AccessToken)'
154158 feedSource : ' https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
155159 displayName : ' Install OptProf Plugin'
160+ condition : and(succeeded(), ${{ parameters.EnableOptProf }})
156161
157162 # Required by MicroBuildBuildVSBootstrapper
158163 - task : MicroBuildSwixPlugin@4
@@ -188,7 +193,7 @@ extends:
188193 toLowerCase : false
189194 usePat : true
190195 displayName : ' OptProf - Publish to Artifact Services - ProfilingInputs'
191- condition : succeeded()
196+ condition : and( succeeded(), ${{ parameters.EnableOptProf }} )
192197
193198 # Build VS bootstrapper
194199 # Generates $(Build.StagingDirectory)\MicroBuild\Output\BootstrapperInfo.json
@@ -200,7 +205,7 @@ extends:
200205 outputFolder : ' $(Build.SourcesDirectory)\artifacts\VSSetup\$(BuildConfiguration)\Insertion'
201206 bootstrapperCoreVersion :
202207 displayName : ' OptProf - Build VS bootstrapper'
203- condition : succeeded()
208+ condition : and( succeeded(), ${{ parameters.EnableOptProf }} )
204209
205210 # Publish run settings
206211 - task : PowerShell@2
@@ -212,7 +217,7 @@ extends:
212217 /p:BootstrapperInfoPath=$(Build.StagingDirectory)\MicroBuild\Output\BootstrapperInfo.json
213218 /p:VisualStudioIbcTrainingSettingsPath=$(Build.SourcesDirectory)\eng\config\OptProf.runsettings
214219 displayName : ' OptProf - Build IBC training settings'
215- condition : succeeded()
220+ condition : and( succeeded(), ${{ parameters.EnableOptProf }} )
216221
217222 # Publish bootstrapper info
218223 - task : 1ES.PublishBuildArtifacts@1
@@ -221,7 +226,7 @@ extends:
221226 ArtifactName : MicroBuildOutputs
222227 ArtifactType : Container
223228 displayName : ' OptProf - Publish Artifact: MicroBuildOutputs'
224- condition : succeeded()
229+ condition : and( succeeded(), ${{ parameters.EnableOptProf }} )
225230
226231 - task : 1ES.PublishBuildArtifacts@1
227232 displayName : ' Publish Artifact: logs'
@@ -290,7 +295,7 @@ extends:
290295 displayName : Tag build as ready for optimization training
291296 inputs :
292297 tags : ' ready-for-training'
293- condition : succeeded()
298+ condition : and( succeeded(), ${{ parameters.EnableOptProf }} )
294299
295300 - task : ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
296301 displayName : Execute cleanup tasks
0 commit comments