Semmle analysis is run against one or more snapshots of a code base. Each snapshot represents the code base as it was after a defined revision.
Each snapshot is stored in a separate snapshot directory and each of these directories includes an XML configuration file called
snapshot. The snapshot configuration file is created automatically when the snapshot is added to the project. It includes a definition of where the source code for the snapshot is stored and the commands required to build this code (copied from the project file or defined on the command line at the time of creation). The information is used when the snapshot is built and the snapshot is indexed to create a Semmle snapshot database.
In normal operation there is no reason to edit the content of the
The format used for the
snapshot file is similar to the format of the
project file. The
snapshot file uses the following format:
In addition, a snapshot may contain a
<tags> element to define additional meta-data for the snapshot. By default, all snapshots created by the addSnapshot command include:
<tag> element with a value of
keep is present it prevents the snapshot from being deleted by the snapshot deletion policy for the project.
snapshot file for a project is stored directly within the snapshot directory. Snapshot directories are located in the project directory. For example,
By convention, snapshot directory names start with
revision-. For example,
The complete path to a
snapshot file might therefore be:
snapshot file uses a similar structure to the
project file, there are few user-configurable elements in a snapshot file. In particular, you should not edit data in any of the following elements:
In the snapshot file, the
<source-location> element is included only after the snapshot has been built. It defines the absolute location of the build. It is never necessary to change this location.
When a snapshot is created, each build command defined in the
project file is copied into a
<build> element in the
snapshot file. This ensures that all snapshots can be rebuilt in the future, even after the build commands defined in the project file have changed to reflect changes to the build process.
Under some circumstances you may need to edit the build commands stored in a snapshot file, but this is not commonly needed. Please see Build configuration in the project file topic for details of the requirements for defining build commands.
Any snapshot that contains a
<tag> value="keep"</tag> element is ignored when commands apply the snapshot deletion policy for the project. This ensures that any historic snapshots are not accidentally deleted. By default, snapshots created using the addLatestSnapshot command omit this tag and snapshots created using the addSnapshot command include this tag. However, you can also use
addSnapshot with the
--untagged flag to create a historic snapshot without this element.