Class CreateServiceReleaseTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.konfigyr.gradle.CreateServiceReleaseTask
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="Performs a network call against a stateful remote service") public abstract class CreateServiceReleaseTask extends org.gradle.api.DefaultTask
Task that opens (or takes over) this service's current ServiceRelease, uploads metadata for every candidate artifact the server reports as ArtifactUploadStatus.UPLOAD_REQUIRED, then completes the release so it becomes the service's current Manifest.

The candidate list submitted to the release is this project's own artifact metadata (from GenerateArtifactMetadataTask, if it produces any) together with every dependency scanned by ResolveServiceDependenciesTask.

This task only runs when the project has opted into the service-release scenario via Konfigyr service DSL configuration. The namespace owning the service is resolved server-side from the registry's authenticated access token, never asserted here.

Since:
1.1.0
See Also:
  • Nested Class Summary

    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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.DirectoryProperty
    The directory where serialized dependency ArtifactMetadata is located, written by ResolveServiceDependenciesTask.
    abstract org.gradle.api.file.RegularFileProperty
    The manifest file containing the dependency artifact metadata file locations, written by ResolveServiceDependenciesTask.
    abstract org.gradle.api.provider.Property<@NonNull String>
    The name of the registry this task opens the service release against.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether this task is eligible to run: the project's konfigyr { service { } } block has been configured, and the registry named by getRegistryName() is fully configured (a url and either clientCredentials { } or tokenExchange { } grant).
    abstract org.gradle.api.provider.Property<ArtifactoryService>
    Returns the ArtifactoryService to use for creating the service release.
    abstract org.gradle.api.file.RegularFileProperty
    The file containing this project's own serialized ArtifactMetadata, written by GenerateArtifactMetadataTask.
    abstract org.gradle.api.provider.Property<@NonNull String>
    The Konfigyr service name.
    abstract org.gradle.workers.WorkerExecutor
    The WorkerExecutor to use for executing the ServiceReleaseArtifactUploadAction for every artifact the release reports as requiring an upload.

    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, usesService

    Methods 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, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • CreateServiceReleaseTask

      public CreateServiceReleaseTask()
  • Method Details

    • getService

      @Internal public abstract org.gradle.api.provider.Property<ArtifactoryService> getService()
      Returns the ArtifactoryService to use for creating the service release.
      Returns:
      the artifactory service to use, never null.
    • getWorkerExecutor

      @Inject public abstract org.gradle.workers.WorkerExecutor getWorkerExecutor()
      The WorkerExecutor to use for executing the ServiceReleaseArtifactUploadAction for every artifact the release reports as requiring an upload.
      Returns:
      the worker task executor, never null.
    • getServiceArtifactMetadata

      @Internal public abstract org.gradle.api.file.RegularFileProperty getServiceArtifactMetadata()
      The file containing this project's own serialized ArtifactMetadata, written by GenerateArtifactMetadataTask. The file itself may not exist if this project's own jar does not expose Spring Boot configuration metadata, in which case it is not part of the candidate list.

      It is declared as Internal rather than @InputFile, since Gradle's input validation requires an @InputFile to exist whenever its property has a value, even if marked @Optional; this task is already DisableCachingByDefault and never eligible for up-to-date checks, so nothing is lost by not tracking it as a cacheable input.

      Returns:
      the artifact metadata file location, never null.
    • getDependencyManifest

      @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getDependencyManifest()
      The manifest file containing the dependency artifact metadata file locations, written by ResolveServiceDependenciesTask.
      Returns:
      the dependency artifact manifest file location, never null.
    • getDependencyDirectory

      @InputDirectory @PathSensitive(RELATIVE) public abstract org.gradle.api.file.DirectoryProperty getDependencyDirectory()
      The directory where serialized dependency ArtifactMetadata is located, written by ResolveServiceDependenciesTask.
      Returns:
      the dependency metadata directory, never null.
    • getRegistryName

      @Input public abstract org.gradle.api.provider.Property<@NonNull String> getRegistryName()
      The name of the registry this task opens the service release against.
      Returns:
      the registry name, never null.
    • getServiceName

      @Input public abstract org.gradle.api.provider.Property<@NonNull String> getServiceName()
      The Konfigyr service name. Must match the identifier this service already has in the Konfigyr app; there is no default, it must always be set explicitly via konfigyr { service { name = ... } }.
      Returns:
      the service name, never null.
    • getReleaseConfigured

      @Input public abstract org.gradle.api.provider.Property<Boolean> getReleaseConfigured()
      Whether this task is eligible to run: the project's konfigyr { service { } } block has been configured, and the registry named by getRegistryName() is fully configured (a url and either clientCredentials { } or tokenExchange { } grant). See the onlyIf predicate this task is registered with in KonfigyrPlugin.
      Returns:
      true if this task should run.