Class ConventionalVersionPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.plugins.PluginAware>
Calculates only. It never creates a tag, never writes a changelog and contributes no task: release-please remains the release authority and this predicts the number it will publish.
There is no configuration block. Every option that changes a number lives in release-please-config.json, under the name release-please gives it, so the two cannot disagree.
One id, applicable at two levels. Applied in a settings file it versions the whole build; applied to a project - directly or by a convention plugin - it versions that project. Which level suits a build is that build's structural choice and not a different feature, so this dispatches on what it was applied to rather than publishing two ids.
Declared Plugin<PluginAware> because Gradle types a plugin by its target and no class
can implement Plugin<Settings> and Plugin<Project> at once. The cost is that Gradle
no longer refuses a wrong target on this plugin's behalf, so pluginFor(PluginAware) has to say so
itself.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.gradle.api.plugins.PluginAware target) The target type is resolved before the target is touched, so an unsupported one fails without the plugin having reached into it first.protected Class<? extends org.gradle.api.Plugin<?>> pluginFor(org.gradle.api.plugins.PluginAware target) Gradleis aPluginAwaretoo, so an init script reaches here.
-
Constructor Details
-
ConventionalVersionPlugin
public ConventionalVersionPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.plugins.PluginAware target) The target type is resolved before the target is touched, so an unsupported one fails without the plugin having reached into it first.- Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.plugins.PluginAware>
-
pluginFor
@VisibleForTesting protected Class<? extends org.gradle.api.Plugin<?>> pluginFor(org.gradle.api.plugins.PluginAware target) Gradleis aPluginAwaretoo, so an init script reaches here. It names what it was given, because the alternative is a plugin that appears to apply and silently does nothing.
-