Class GenerateArtifactMetadataTask
- 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>
ArtifactMetadata for each resolved dependency and for the
current project itself, then writes the results to the output directory.
The current project and all other projects in the build are identified through
getProjectPath() and getProjectArtifacts(). Both properties are populated
at configuration time, avoiding any access to Project objects during
task execution and keeping the task compatible with the Gradle configuration cache.
The resolved artifact metadata locations are recorded in the manifest file. This manifest
is later consumed by PublishArtifactMetadataTask to upload only the affected
entries to the Konfigyr Artifactory.
Output files are named after the artifact coordinates, for example:
com.konfigyr-konfigyr-artifactory-1.0.0.json
- Since:
- 1.0.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 -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.Property<org.gradle.api.artifacts.ArtifactCollection> Collection that contains transformed artifact metadata from theArtifactMetadataTransform.abstract org.gradle.api.file.ConfigurableFileCollectionThe collection of files that represent the classpath of the current project.abstract org.gradle.api.file.RegularFilePropertyThe manifest file that should be written that contains all the processed artifacts.abstract org.gradle.api.file.DirectoryPropertyThe output directory where serializedArtifactMetadatashould be written.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-builtArtifactdescriptor.abstract org.gradle.api.provider.Property<String> The Gradle path of the project this task belongs to (e.g.abstract org.gradle.api.file.ConfigurableFileCollectionThe collection of files that represent the classpath of the current project.abstract org.gradle.api.provider.Property<ArtifactoryService> Returns theArtifactoryServiceto use for constructing and writing the artifact metadata.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
-
GenerateArtifactMetadataTask
public GenerateArtifactMetadataTask()
-
-
Method Details
-
getService
Returns theArtifactoryServiceto 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 theArtifactMetadataTransform.Each
ResolvedArtifactResultshould be assocated with themetadata.jsonfile containing the serializedPropertyDescriptors.- 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 classpath of the current project. This classpath file collection is used to create a customClassLoaderthat would generate theArtifactMetadatafor the current Gradle project.- Returns:
- the project's classpath, never null.
-
getClasspath
@InputFiles @CompileClasspath public abstract org.gradle.api.file.ConfigurableFileCollection getClasspath()The collection of files that represent the classpath of the current project. This classpath file collection is used to create a customClassLoaderthat would generate theArtifactMetadatafor the current Gradle project.- Returns:
- the project's classpath, never null.
-
getManifest
@OutputFile public abstract org.gradle.api.file.RegularFileProperty getManifest()The manifest file that should be written that contains all the processed artifacts.- Returns:
- the output manifest file location, never null.
-
getOutput
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutput()The output directory where serializedArtifactMetadatashould be written.- Returns:
- the output directory, never null.
-
getProjectPath
The Gradle path of the project this task belongs to (e.g.:orders).Used as the lookup key into
getProjectArtifacts()to identify the current project when generating itsArtifactMetadata.- Returns:
- the project path, 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-builtArtifactdescriptor.The map is populated at configuration time so the task action never needs to access live
Projectobjects, keeping this task compatible with the Gradle configuration cache.- Returns:
- the project artifacts map, never null.
-