Class ValidateChangeLogTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.htshame.ValidateChangeLogTask
- 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="Validation task - output is build success/failure, not cacheable artifacts")
public abstract class ValidateChangeLogTask
extends org.gradle.api.DefaultTask
validateLiquibaseChangeLog task executor.
Validates Liquibase changeLog files against a set of naming-convention rules.
This task is wired to the check lifecycle task by
NamingConventionLiquibasePlugin.
-
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.DirectoryPropertyPath to the directory containing Liquibase changeLog files.abstract org.gradle.api.provider.Property<String> ChangeLog files format (xml, yaml, yml, json).abstract org.gradle.api.provider.Property<String> Exclusions file URL.abstract org.gradle.api.file.RegularFilePropertyPath to the XML file with exclusions.abstract org.gradle.api.file.RegularFilePropertyPath to the XML file with rules.abstract org.gradle.api.provider.Property<String> The version of this plugin, embedded via the JAR manifest at build time.abstract org.gradle.api.provider.Property<String> Rules file URL.abstract org.gradle.api.provider.Property<Boolean> Flag that determines whether the build will fail when violations are found.abstract org.gradle.api.provider.Property<Boolean> Flag that determines whether the exclusions file content will be generated when the build fails.voidValidates the Liquibase changeLog files using the configured rules and exclusions.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
ValidateChangeLogTask
public ValidateChangeLogTask()Default constructor.
-
-
Method Details
-
getPathToRulesFile
@PathSensitive(RELATIVE) @InputFile @Optional public abstract org.gradle.api.file.RegularFileProperty getPathToRulesFile()Path to the XML file with rules. Exactly one ofpathToRulesFileorrulesFileUrlmust be set.- Returns:
- file property
-
getPathToExclusionsFile
@Optional @PathSensitive(RELATIVE) @InputFile public abstract org.gradle.api.file.RegularFileProperty getPathToExclusionsFile()Path to the XML file with exclusions. Optional.- Returns:
- file property
-
getChangeLogDirectory
@PathSensitive(RELATIVE) @InputDirectory public abstract org.gradle.api.file.DirectoryProperty getChangeLogDirectory()Path to the directory containing Liquibase changeLog files. Required.- Returns:
- directory property
-
getShouldFailBuild
Flag that determines whether the build will fail when violations are found. Default value istrue.- Returns:
- boolean property
-
getChangeLogFormat
ChangeLog files format (xml, yaml, yml, json). Default value isxml.- Returns:
- string property
-
getShouldGenerateExclusions
Flag that determines whether the exclusions file content will be generated when the build fails. Default value isfalse.- Returns:
- boolean property
-
getPluginVersion
The version of this plugin, embedded via the JAR manifest at build time.- Returns:
- string property
-
getRulesFileUrl
Rules file URL. Exactly one ofpathToRulesFileorrulesFileUrlmust be set. Optional- Returns:
- url.
-
getExclusionsFileUrl
Exclusions file URL. Optional- Returns:
- url.
-
validateChangeLogs
public void validateChangeLogs()Validates the Liquibase changeLog files using the configured rules and exclusions.Fails the build (throws
GradleException) when violations are found andshouldFailBuildistrue.
-