Package com.mooltiverse.oss.nyx.gradle
Class NyxExtension
- java.lang.Object
-
- com.mooltiverse.oss.nyx.gradle.NyxExtension
-
public abstract class NyxExtension extends Object
The plugin configuration object. This object is responsible for reading thenyx {...}
configuration block that users define within thebuild.gradle
script. See Modeling DSL-like APIs for more o developing extension. See Developing Custom Gradle Types, Developing Custom Gradle Plugins, Implementing Gradle plugins and Lazy Configuration for an introduction on custom Gradle types development.- See Also:
ExtensionAware
,ExtensionContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NyxExtension.Service
The class to model a single service item within the 'services' block within the extension.
-
Constructor Summary
Constructors Constructor Description NyxExtension()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static NyxExtension
create(Project project)
Creates the extension into the given project.Property<String>
getBump()
Returns the name of the version identifier to bump.DirectoryProperty
getDirectory()
Returns the directory to use as the base repository location.Property<Boolean>
getDryRun()
Returns the flag that, whentrue
, prevents Nyx from applying any change to the repository or any other resource.Property<String>
getInitialVersion()
Returns the initial version to use when no past version can be inferred from the commit history.protected abstract ObjectFactory
getObjectfactory()
Returns an object factory instance.protected abstract ProjectLayout
getProjectLayout()
Returns a project layout instance.Property<Boolean>
getReleaseLenient()
Returns the flag that, whentrue
, lets Nyx interpret release names with whatever prefix.Property<String>
getReleasePrefix()
Returns the prefix used to generate release names.Property<String>
getScheme()
Returns the versioning scheme to use.NamedDomainObjectContainer<NyxExtension.Service>
getServices()
Returns the nested 'service' blocks.Property<String>
getVerbosity()
Returns the logging verbosity.
-
-
-
Field Detail
-
NAME
public static final String NAME
The name of the extension object. This is the name of the configuration block inside Gradle scripts.- See Also:
- Constant Field Values
-
-
Method Detail
-
getObjectfactory
@Inject protected abstract ObjectFactory getObjectfactory()
Returns an object factory instance. The instance is injected by Gradle as soon as this getter method is invoked. Using property injection instead of constructor injection has a few advantages: it allows Gradle to refer injecting the object until it's required and is safer for backward compatibility (older versions can be supported).- Returns:
- the object factory instance
-
getProjectLayout
@Inject protected abstract ProjectLayout getProjectLayout()
Returns a project layout instance. The instance is injected by Gradle as soon as this getter method is invoked. Using property injection instead of constructor injection has a few advantages: it allows Gradle to refer injecting the object until it's required and is safer for backward compatibility (older versions can be supported).- Returns:
- the project layout instance
-
create
public static NyxExtension create(Project project)
Creates the extension into the given project.- Parameters:
project
- the project to create the extension into- Returns:
- the extension instance, within the given project
-
getBump
public Property<String> getBump()
Returns the name of the version identifier to bump. When this is set by the user it overrides the inference performed by Nyx. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the name of the version identifier to bump
-
getDirectory
public DirectoryProperty getDirectory()
Returns the directory to use as the base repository location. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the directory to use as the base repository location TODO: add a link to constants from Nyx configuration classes
-
getDryRun
public Property<Boolean> getDryRun()
Returns the flag that, whentrue
, prevents Nyx from applying any change to the repository or any other resource. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the flag that, when
true
, prevents Nyx from applying any change to the repository or any other resource - See Also:
Defaults.DRY_RUN
-
getInitialVersion
public Property<String> getInitialVersion()
Returns the initial version to use when no past version can be inferred from the commit history. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the flag that, when
true
, prevents Nyx from applying any change to the repository or any other resource - See Also:
Defaults.DRY_RUN
-
getReleasePrefix
public Property<String> getReleasePrefix()
Returns the prefix used to generate release names. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the prefix used to generate release names
- See Also:
Defaults.RELEASE_PREFIX
-
getReleaseLenient
public Property<Boolean> getReleaseLenient()
Returns the flag that, whentrue
, lets Nyx interpret release names with whatever prefix. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the flag that, when
true
, lets Nyx interpret release names with whatever prefix - See Also:
Defaults.RELEASE_LENIENT
-
getScheme
public Property<String> getScheme()
Returns the versioning scheme to use. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the versioning scheme to use
- See Also:
Defaults.SCHEME
-
getVerbosity
public Property<String> getVerbosity()
Returns the logging verbosity. Please note that the verbosity option is actually ignored in this plugin implementation and the backing Nyx implementation as it's controlled by Gradle. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the logging verbosity
-
getServices
public NamedDomainObjectContainer<NyxExtension.Service> getServices()
Returns the nested 'service' blocks. We provide an implementation of this method instead of using the abstract definition as it's safer for old Gradle versions we support.- Returns:
- the nested 'service' blocks TODO: add a link to constants from Nyx configuration classes
-
-