Class VersionReporter
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
org.jdrupes.builder.core.VersionReporter
- All Implemented Interfaces:
Generator, Renamable, ResourceProvider
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <R extends Resource>
Collection<R> doProvide(ResourceRequest<R> requested) Invoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.Methods inherited from class AbstractGenerator
cleanup, name, project, toStringMethods inherited from class AbstractProvider
context, name, of, rename, vavrStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
context, name, of, resources
-
Constructor Details
-
VersionReporter
Instantiates a new version reporter.- Parameters:
project- the project
-
-
Method Details
-
doProvide
Description copied from class:AbstractProviderInvoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
R- the generic type- Parameters:
requested- the request for resources- Returns:
- the stream
-