Class WrapperNeo
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.glavo.gradle.wrapper.neo.plugin.WrapperNeo
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault(because="Generates project wrapper files and may resolve checksums from the network.")
public abstract class WrapperNeo
extends org.gradle.api.DefaultTask
Generates the Gradle Wrapper Neo launchers, Java source, and standard Wrapper properties.
The generated files use the conventional project layout. Distribution and archive settings are exposed as Gradle properties so builds can configure the generated Wrapper.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe Gradle distribution variant used when the distribution URL is derived from a version.static enumThe base directory used for distribution and archive paths.Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionWrapperNeo(org.gradle.api.file.ProjectLayout layout) Creates the task and configures its conventional output locations and Wrapper defaults. -
Method Summary
Modifier and TypeMethodDescriptionvoidSetsgetDistributionSha256Sum()from the checksum task option.voidconfigureDistributionType(String value) SetsgetDistributionType()from the--distribution-typetask option.voidconfigureDistributionUrl(String value) SetsgetDistributionUrl()from the--gradle-distribution-urltask option.voidconfigureGradleVersion(String value) SetsgetGradleVersion()from the--gradle-versiontask option.voidconfigureNetworkTimeout(String value) SetsgetNetworkTimeout()from the--network-timeouttask option.voidgenerate()Writes the launchers, source file, and Wrapper properties using the configured values.abstract org.gradle.api.provider.Property<WrapperNeo.PathBase>Returns the base directory for downloaded distribution archives.abstract org.gradle.api.provider.Property<String>Returns the path belowgetArchiveBase()used for downloaded archives.abstract org.gradle.api.provider.Property<WrapperNeo.PathBase>Returns the base directory for the installed Gradle distribution.abstract org.gradle.api.provider.Property<String>Returns the path belowgetDistributionBase()used for installed distributions.abstract org.gradle.api.provider.Property<String>Returns the optional SHA-256 checksum written to the generated Wrapper properties.abstract org.gradle.api.provider.Property<WrapperNeo.DistributionType>Returns the distribution variant.abstract org.gradle.api.provider.Property<String>Returns the optional complete distribution URL, which overrides the version and distribution type.abstract org.gradle.api.provider.Property<Boolean>Returns whether a missing checksum is downloaded from the distribution URL with a.sha256suffix.abstract org.gradle.api.provider.Property<String>Returns the Gradle version selector used to derive the distribution URL.abstract org.gradle.api.file.RegularFilePropertyReturns the legacy Wrapper JAR removed whengetRemoveLegacyWrapperJar()is enabled.abstract org.gradle.api.provider.Property<Integer>Returns the connection and read timeout in milliseconds.abstract org.gradle.api.provider.Property<Boolean>Returns whether generation removes the legacygradle-wrapper.jar.abstract org.gradle.api.provider.Property<Integer>Returns the number of additional distribution download attempts made by the generated Wrapper.abstract org.gradle.api.provider.Property<Integer>Returns the initial delay in milliseconds between distribution download attempts.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
WrapperNeo
@Inject public WrapperNeo(org.gradle.api.file.ProjectLayout layout) Creates the task and configures its conventional output locations and Wrapper defaults.- Parameters:
layout- the target project layout
-
-
Method Details
-
getGradleVersion
Returns the Gradle version selector used to derive the distribution URL.Complete versions, the dynamic labels supported by the standard Wrapper task, and Gradle 9 or later major/minor selectors are accepted. The value defaults to the current Gradle version.
- Returns:
- the configurable Gradle version selector
-
getDistributionType
@Input public abstract org.gradle.api.provider.Property<WrapperNeo.DistributionType> getDistributionType()Returns the distribution variant. Defaults toWrapperNeo.DistributionType.BIN.- Returns:
- the configurable distribution variant
-
getDistributionUrl
Returns the optional complete distribution URL, which overrides the version and distribution type.- Returns:
- the configurable distribution URL
-
getDistributionSha256Sum
@Optional @Input public abstract org.gradle.api.provider.Property<String> getDistributionSha256Sum()Returns the optional SHA-256 checksum written to the generated Wrapper properties.- Returns:
- the configurable distribution checksum
-
getDownloadDistributionSha256Sum
Returns whether a missing checksum is downloaded from the distribution URL with a.sha256suffix.- Returns:
- the configurable checksum download flag
-
getDistributionBase
Returns the base directory for the installed Gradle distribution.- Returns:
- the configurable distribution base
-
getDistributionPath
Returns the path belowgetDistributionBase()used for installed distributions.- Returns:
- the configurable distribution path
-
getArchiveBase
Returns the base directory for downloaded distribution archives.- Returns:
- the configurable archive base
-
getArchivePath
Returns the path belowgetArchiveBase()used for downloaded archives.- Returns:
- the configurable archive path
-
getNetworkTimeout
Returns the connection and read timeout in milliseconds. Defaults to10000.- Returns:
- the configurable network timeout
-
getRetries
Returns the number of additional distribution download attempts made by the generated Wrapper.- Returns:
- the configurable retry count
-
getRetryBackOffMs
Returns the initial delay in milliseconds between distribution download attempts.- Returns:
- the configurable retry backoff
-
getRemoveLegacyWrapperJar
Returns whether generation removes the legacygradle-wrapper.jar. Defaults totrue.- Returns:
- the configurable legacy JAR removal flag
-
getLegacyWrapperJar
@Internal public abstract org.gradle.api.file.RegularFileProperty getLegacyWrapperJar()Returns the legacy Wrapper JAR removed whengetRemoveLegacyWrapperJar()is enabled.- Returns:
- the internal legacy Wrapper JAR location
-
configureGradleVersion
SetsgetGradleVersion()from the--gradle-versiontask option.- Parameters:
value- the Gradle version
-
configureDistributionType
SetsgetDistributionType()from the--distribution-typetask option.- Parameters:
value-binorall
-
configureDistributionUrl
SetsgetDistributionUrl()from the--gradle-distribution-urltask option.- Parameters:
value- the complete distribution URL
-
configureDistributionSha256Sum
SetsgetDistributionSha256Sum()from the checksum task option.- Parameters:
value- the 64-character hexadecimal SHA-256 checksum
-
configureNetworkTimeout
SetsgetNetworkTimeout()from the--network-timeouttask option.- Parameters:
value- the timeout in milliseconds
-
generate
Writes the launchers, source file, and Wrapper properties using the configured values.- Throws:
IOException- if a generated file or checksum response cannot be read or written
-