class PluginBuildPlugin extends java.lang.Object
Configures a Gradle build to build and publish a Gradle plugin. Opinionated.
| Type | Name and description |
|---|---|
static java.lang.String |
ARTIFACTORY_PLUGIN_ID |
static java.lang.String |
BINTRAY_PLUGIN_ID |
static java.lang.String |
GRADLE_PLUGIN_PUBLISH_PLUGIN_ID |
static java.lang.String |
GRGIT_PLUGIN_ID |
static java.util.List<java.lang.String> |
PLUGIN_IDSThe plugins to apply to the plugin build project. |
static java.util.List<java.lang.String> |
REQUIRED_PROPERTIESThe project-specific properties that must be set. |
static java.lang.String |
SHADOW_PLUGIN_ID |
java.util.Map<java.lang.String, groovy.lang.Closure<java.lang.Boolean>> |
pluginInclusionMaps plugin identifier to project property. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(org.gradle.api.Project project)Applies the plugin and configures the build. |
|
static void |
checkProjectProperties(org.gradle.api.Project project, java.util.List<java.lang.String> requiredProperties)Checks that values have been provided for the required project properties. |
|
static void |
configureArtifactory(org.gradle.api.Project project)Configures Artifactory publishing. |
|
static void |
configureBintray(org.gradle.api.Project project)Configures Bintray publishing. |
|
static void |
configureDefaultTasks(org.gradle.api.Project project)Configures the local and all tasks and assigns
all as the project default. |
|
static void |
configureDependencies(org.gradle.api.Project project)Adds dependencies. |
|
static void |
configureDerivedPropertiesWithPlugins(org.gradle.api.Project project)Configure the properties that we couldn't get values for without plugins. |
|
static void |
configureDerivedPropertiesWithoutPlugins(org.gradle.api.Project project)Defines additional properties that are derived from the required properties. |
|
static void |
configureGradlePlugin(org.gradle.api.Project project)Configures the Gradle plugin to build and publish. |
|
static void |
configureJarTask(org.gradle.api.Project project)Configures jar task including manifest attributes. |
|
static void |
configureJavaPlugin(org.gradle.api.Project project)Configures the Java plugin including source and target compatibility. |
|
static void |
configureJavaPublishing(org.gradle.api.Project project)Configures publishing. |
|
static void |
configureJavadocJarTask(org.gradle.api.Project project)Configures the Javadoc jar task. |
|
static void |
configurePlugin(org.gradle.api.Project project, java.lang.String id, java.util.Map<java.lang.String, groovy.lang.Closure<java.lang.Boolean>> pluginInclusion)Applies the plugin identified by the parameter plugin identifier. |
|
static void |
configurePluginBundle(org.gradle.api.Project project)Configures the plugin bundle being published. |
|
static void |
configurePluginInclusion(org.gradle.api.Project project, java.util.Map<java.lang.String, groovy.lang.Closure<java.lang.Boolean>> pluginInclusion) |
|
static void |
configurePlugins(org.gradle.api.Project project, java.util.List<java.lang.String> pluginIds, java.util.Map<java.lang.String, groovy.lang.Closure<java.lang.Boolean>> pluginInclusion)Applies the plugins in the PLUGIN_IDS list. |
|
static void |
configureRepositories(org.gradle.api.Project project)Adds repository definitions. |
|
static void |
configureShadowJarTask(org.gradle.api.Project project)Configures the shadow jar task. |
|
static void |
configureSourceJarTask(org.gradle.api.Project project)Configures the source jar task. |
|
static boolean |
isArtifactoryPublishingEnabled(org.gradle.api.Project project)Determines whether produced artifacts should be published to Artifactory. |
|
static boolean |
isBintrayPublishingEnabled(org.gradle.api.Project project)Determines whether the produced artifacts should be published to Bintray. |
|
static boolean |
isGitHosted(org.gradle.api.Project project)Checks whether git integration should be enabled. |
|
static boolean |
isPluginPublishingEnabled(org.gradle.api.Project project)Determines whether the produced artifacts should be published to the Gradle plugin portal. |
|
static boolean |
isProjectPropertySet(org.gradle.api.Project project, java.lang.String propertyName)Checks that the parameter property has a non-empty string that does not evaluate to false,or a non-empty collection value. |
|
static boolean |
isShadowJarEnabled(org.gradle.api.Project project)Checks whether a shadow jar should be built. |
|
static void |
logProperties(org.gradle.api.Project project)Logs the required and derived project properties. |
|
static boolean |
shouldApplyPlugin(org.gradle.api.Project project, java.lang.String pluginId, java.util.Map<java.lang.String, groovy.lang.Closure<java.lang.Boolean>> pluginInclusion)Uses the pluginInclusion map to determine whether the plugin
identified by the parameter identifier should be applied to the project. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The plugins to apply to the plugin build project.
The project-specific properties that must be set.
Maps plugin identifier to project property. If a plugin identifier is included in this map then the plugin will only be applied if the project property is present with a non-empty value that does not evaluate to false.
Applies the plugin and configures the build.
project - The project to configureChecks that values have been provided for the required project properties.
project - The project to configure Configures Artifactory publishing. Disabled by default.
Set artifactoryContextUrl, artifactoryRepoKey,
artifactoryUser and artifactoryToken to enable
Artifactory publishing.
project - The project to configure Configures Bintray publishing. Disabled by default.
Set bintrayContextUrl, bintrayUser and
bintrayKey to enable Bintray publishing.
project - The project to configure Configures the local and all tasks and assigns
all as the project default.
project - The project to configureAdds dependencies.
project - The project to configureConfigure the properties that we couldn't get values for without plugins.
project - The project to configureDefines additional properties that are derived from the required properties. Some of these are used when figuring out which plugins to apply.
project - The project to configureConfigures the Gradle plugin to build and publish.
project - The project to configureConfigures jar task including manifest attributes.
project - The project to configureConfigures the Java plugin including source and target compatibility.
project - The project to configureConfigures publishing.
project - The project to configureConfigures the Javadoc jar task.
project - The project to configure Applies the plugin identified by the parameter plugin identifier. If the
plugin identifier is included as a key in the pluginInclusion
map then it will only be applied if the value is present as a property on
the project with a non-empty value.
project - The project to apply the plugin toid - The identifier of the plugin to applypluginInclusion - Optional losures to check plugin inclusion Configures the plugin bundle being published.
Snapshot versions are not published.
Projects without an isOpenSource property that evaluates to
true are not published.
project - The project to configure Applies the plugins in the PLUGIN_IDS list.
project - The project to configurepluginInclusion - Optional losures to check plugin inclusionAdds repository definitions.
project - The project to configureConfigures the shadow jar task.
project - The project being configuredConfigures the source jar task.
project - The project to configureDetermines whether produced artifacts should be published to Artifactory.
As of version 4.16.1, the Artifactory plugin can only be applied to the
root project using the plugins { .. } Gradle syntax. When the
plugin needs to be applied to subprojects, it has to be included as a build
script class path dependency and then applied using the
apply plugin: syntax. This plugin only supports applying the
Artifactory when configuring a root project. Multi-project builds can
instead be explicitly configured with a subprojects { .. }
clause in the root project.
See https://www.jfrog.com/confluence/display/JFROG/Gradle+Artifactory+Plugin.
Determines whether the produced artifacts should be published to Bintray.
Bintray publishing is only applicable for open source projects that define
the isOpenSource property with the value true.
Bintray publishing is enabled when the Bintray URL and credential project
properties are provided, and the project build number is not SNAPSHOT.
(Bintray does not provide snapshot publishing; attempts to publish
snapshots simply crash the build.)
project - The project being configured Checks whether git integration should be enabled. This is determined by
the presence of the isGitHosted project property, with a
non-empty value.
The - project to check Determines whether the produced artifacts should be published to the
Gradle plugin portal.
Plugin publishing is only applicable for open source projects that define
the isOpenSource property with the value true.
Plugin publishing is enabled when the Gradle plugin key and secret project
properties are provided, and the project build number is not SNAPSHOT.
project - The project being configured Checks that the parameter property has a non-empty string that does not
evaluate to false,or a non-empty collection value.
project - The project to checkpropertyName - The property name to check Checks whether a shadow jar should be built. This is determined by the
presence of the buildShadowJar project property, with a
non-empty value.
project - The project to checkLogs the required and derived project properties.
project - The project to configure Uses the pluginInclusion map to determine whether the plugin
identified by the parameter identifier should be applied to the project.
project - The project being configuredpluginId - The plugin identifierpluginInclusion - Optional closures to check plugin inclusion