Class ResolveServiceDependenciesTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.konfigyr.gradle.ResolveServiceDependenciesTask
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>

@CacheableTask public abstract class ResolveServiceDependenciesTask extends org.gradle.api.DefaultTask
Task that generates ArtifactMetadata for each of this project's resolved runtime dependencies that expose Spring Boot configuration metadata, then writes the results to the output directory.

This is the dependency-scanning half of the Service Release flow: the ArtifactMetadata produced here, together with this project's own metadata from GenerateArtifactMetadataTask, form the full candidate list CreateServiceReleaseTask submits to open a service's release. This task is only ever needed when the project has opted into the service-release scenario via konfigyr { service { } }, otherwise it does not run.

Every project in the build is identified through getProjectArtifacts(), populated at configuration time so this task never needs to access Project objects during execution, keeping it compatible with the Gradle configuration cache.

Output files are named after the artifact coordinates, for example: com.konfigyr-konfigyr-artifactory-1.0.0.json

Since:
1.1.0
  • 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.provider.Property<org.gradle.api.artifacts.ArtifactCollection>
    Collection that contains transformed artifact metadata from the ArtifactMetadataTransform.
    abstract org.gradle.api.file.DirectoryProperty
    The output directory where serialized ArtifactMetadata for each dependency should be written.
    abstract org.gradle.api.file.RegularFileProperty
    The manifest file that should be written that contains all the processed dependency artifacts.
    abstract org.gradle.api.provider.MapProperty<String,com.konfigyr.artifactory.Artifact>
    A map of every project in the build, keyed by Gradle project path, with each value being a pre-built Artifact descriptor.
    abstract org.gradle.api.file.ConfigurableFileCollection
    The collection of files that represent the runtime classpath of the current project.
    abstract org.gradle.api.provider.Property<ArtifactoryService>
    Returns the ArtifactoryService to use for constructing and writing the artifact metadata.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the project's konfigyr { service { } } block has been configured.
    abstract org.gradle.api.provider.Property<String>
    The Konfigyr service name.

    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

    • ResolveServiceDependenciesTask

      public ResolveServiceDependenciesTask()
  • Method Details

    • getService

      @Internal public abstract org.gradle.api.provider.Property<ArtifactoryService> getService()
      Returns the ArtifactoryService to use for constructing and writing the artifact metadata.
      Returns:
      the artifactory service to use, never null.
    • getArtifacts

      @Internal public abstract org.gradle.api.provider.Property<org.gradle.api.artifacts.ArtifactCollection> getArtifacts()
      Collection that contains transformed artifact metadata from the ArtifactMetadataTransform.

      Each ResolvedArtifactResult should be associated with the metadata.json file containing the serialized PropertyDescriptors.

      Returns:
      the transformed artifact metadata, never null.
    • getRuntimeClasspath

      @InputFiles @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getRuntimeClasspath()
      The collection of files that represent the runtime classpath of the current project. This is declared purely as a stable, cacheable proxy for getArtifacts(), an ArtifactCollection is not itself a safe cache key.
      Returns:
      the project's runtime classpath, never null.
    • getProjectArtifacts

      @Input public abstract org.gradle.api.provider.MapProperty<String,com.konfigyr.artifactory.Artifact> getProjectArtifacts()
      A map of every project in the build, keyed by Gradle project path, with each value being a pre-built Artifact descriptor.

      The map is populated at configuration time so the task action never needs to access live Project objects, keeping this task compatible with the Gradle configuration cache.

      Returns:
      the project artifacts map, never null.
    • getServiceConfigured

      @Input public abstract org.gradle.api.provider.Property<Boolean> getServiceConfigured()
      Whether the project's konfigyr { service { } } block has been configured. Only used to gate whether this task should run at all, not otherwise consumed by the task action.
      Returns:
      true if the service-release scenario is enabled for this project.
    • getServiceName

      @Input public abstract org.gradle.api.provider.Property<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.
    • getDependencyManifest

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getDependencyManifest()
      The manifest file that should be written that contains all the processed dependency artifacts.
      Returns:
      the output manifest file location, never null.
    • getDependencyDirectory

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getDependencyDirectory()
      The output directory where serialized ArtifactMetadata for each dependency should be written.
      Returns:
      the output dependency artifact directory, never null.