Savant Build

Project Information

Savant build files must be placed at the root of the project and they should be named build.savant. Build files will define the project information, dependencies, workflow, and targets.

Let’s start out by looking at a simple Savant build file that defines a project. Edit the file build.savant in your IDE or favorite text editor. Put this in your build file.

project(group: "org.example", name: "my-project", version: "1.0", licenses: ["ApacheV2_0"]) {
  // More info here
}

You define your project details using the project method. This method takes a block, that allows you to define additional details about your project like dependencies. The key here is that the project requires these attributes:

One of the most important details is that Savant requires that everything uses Semantic Versions. This is vitally important when Savant calculates dependencies of your project. You should read the Semantic Version specification by visiting http://semver.org.

You also need to specify one or more licenses for your project. All projects must specify at least one license. This helps Savant determine if your project is in compliance with organizational requirements about software licensing.

Savant currently supports these licenses:

Some of these licenses require that the project supply their own license text. For example, the standard BSD license is a template and each project must change the license to include their name and assignee. Savant supports providing custom license texts using a text file at the root of the project. You can also override any of these licenses with custom text using this file. The file must follow this naming convention:

license-<type>.txt

So, if your project is using a Commercial license, you need to create a file named: license-Commercial.txt at the root of your project.

Here are the licenses that require a license text file:

Next, we’ll add some dependencies to our build file