TFS shows success for a failed ANT build

136 Views Asked by At

Hi Even though my ant build fails, TFS shows that step as successful and proceeds further. I have tried using failonerror but it seems there are very few tasks for which failonerror works.Is there a workaround so that TFS actually fails when ANT build fails.

1

There are 1 best solutions below

5
PatrickLu-MSFT On

You could be able to return warnings and errors from your powershell script using logging commands. Catch the ant build log first and determine whether the ant build failed. Then with using task.logissue type=error in powershell build task,you could fail the build task and then fail the build.

More details you could take a look at this similar question: Is it possible to raise and display build warnings from build steps using TFS 2015