TeamCity On-Premises
 
Get TeamCity On-Premises

Build Files Cleaner (Swabra)

Edit pageLast modified: 18 September 2024

Swabra is a bundled TeamCity plugin that allows you to add the Swabra build feature to your build configurations. This build feature allows you to do the following:

  • Remove files generated during a build. The feature creates a list of all files in the checkout directory after the sources checkout is complete. After a build finishes (or before the next build starts), files that are not on this list are automatically removed.

  • Detect files modified or deleted during the build. Such files are reported to the build log (however, deleted files are not restored). This allows you to ensure your new builds do not start with certain source files deleted or modified by previous builds, and initiate a clean checkout if this is the case.

  • Dump processes that lock directory by the end of the build (requires handle.exe).

Swabra saves the checkout directory state to the <checkout-directory-name-hash>.snapshot file in the caches directory using the DiskDir format. The path to the checkout directory to be cleaned is stored in the snapshot.map file. The snapshot stores information about existing files, their last modification and size. This information is used when a build finishes (or a new build is about to start) to identify changes.