Class VerifyApiSpecTask
- 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>
-
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.file.DirectoryPropertygetInto()Where the fetched documents are, and are checked.abstract org.gradle.api.file.RegularFilePropertyThe lockfile the fetched documents are checked against.abstract org.gradle.api.provider.Property<String> The contract being checked.voidverify()Fails when a fetched contract no longer matches what was locked.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, getLoggingManager, 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
-
VerifyApiSpecTask
public VerifyApiSpecTask()Creates the task. Gradle instantiates this when a subscription is declared.
-
-
Method Details
-
getTarget
The contract being checked.- Returns:
- the target name, used to find its entry in the lockfile
-
getInto
@Internal public abstract org.gradle.api.file.DirectoryProperty getInto()Where the fetched documents are, and are checked.Deliberately
@Internalrather than@InputDirectory. This task has no outputs and is not cacheable, so it runs every time regardless and there is no up-to-date check for a declared input to inform. Declaring it would only add Gradle's own existence check, which fires before this task runs and reports a missing property where the reader needs to be told that nothing has been fetched yet.- Returns:
- the directory holding the fetched documents
-
getLockfile
@Internal public abstract org.gradle.api.file.RegularFileProperty getLockfile()The lockfile the fetched documents are checked against.@Internalfor the same reason asgetInto(). A missing lockfile is an ordinary first-run state, not a misconfiguration: a project that applies the plugin and runscheckbefore it has ever fetched anything has no lockfile yet.- Returns:
- the lockfile location
-
verify
public void verify()Fails when a fetched contract no longer matches what was locked.Every problem found is reported at once rather than the first, since a contract that has drifted has usually drifted in more than one file.
- Throws:
org.gradle.api.GradleException- if nothing has been fetched, if there is no lockfile or no entry for this target, or if any document is missing or no longer hashes to what was locked
-