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
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.DirectoryProperty
    Path 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.RegularFileProperty
    Path to the XML file with exclusions.
    abstract org.gradle.api.file.RegularFileProperty
    Path 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.
    void
    Validates 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, 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 Object

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

    Methods 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 of pathToRulesFile or rulesFileUrl must 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

      @Input public abstract org.gradle.api.provider.Property<Boolean> getShouldFailBuild()
      Flag that determines whether the build will fail when violations are found. Default value is true.
      Returns:
      boolean property
    • getChangeLogFormat

      @Input public abstract org.gradle.api.provider.Property<String> getChangeLogFormat()
      ChangeLog files format (xml, yaml, yml, json). Default value is xml.
      Returns:
      string property
    • getShouldGenerateExclusions

      @Input public abstract org.gradle.api.provider.Property<Boolean> getShouldGenerateExclusions()
      Flag that determines whether the exclusions file content will be generated when the build fails. Default value is false.
      Returns:
      boolean property
    • getPluginVersion

      @Input public abstract org.gradle.api.provider.Property<String> getPluginVersion()
      The version of this plugin, embedded via the JAR manifest at build time.
      Returns:
      string property
    • getRulesFileUrl

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getRulesFileUrl()
      Rules file URL. Exactly one of pathToRulesFile or rulesFileUrl must be set. Optional
      Returns:
      url.
    • getExclusionsFileUrl

      @Input @Optional public abstract org.gradle.api.provider.Property<String> 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 and shouldFailBuild is true.