Class VersionReporter

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

public class VersionReporter extends AbstractGenerator

A provider that reports the version of a project as a ProjectVersion resource. The version is obtained from the project's Version property.

Add the generator to a project like this:

generator(VersionReporter::new);

Also add a command alias that requests the ProjectVersion resource:

commandAlias("version")
    .resources(of(ProjectVersionType).using(Supply));

This makes it possible to query the project version from the command line with:

./jdbld version