Class FlywayTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
net.ltgt.gradle.flyway.tasks.FlywayTask
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>
Direct Known Subclasses:
FlywayClean, MigrationsFlywayTask

@UntrackedTask(because="Depends on the database") public abstract class FlywayTask extends org.gradle.api.DefaultTask
The base class for all Flyway tasks.
  • 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
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.ConfigurableFileCollection
    The classpath for executing Flyway.
    abstract org.gradle.api.provider.MapProperty<String,String>
    Additional configuration properties to be merged with the configuration file (overriding it).
    abstract org.gradle.api.file.RegularFileProperty
    The Flyway configuration file (must be a Java properties file encoded in UTF-8, might not exist)
    abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher>
    Configures the java executable to be used to run Flyway.
    protected abstract org.gradle.api.file.ConfigurableFileCollection
    The directories containing migration scripts.
    abstract org.gradle.api.provider.Property<String>
    The password to use to connect to the database.
    protected abstract org.gradle.api.provider.Property<String>
    The target version up to which Flyway should consider migrations.
    abstract org.gradle.api.provider.Property<String>
    The jdbc url to use to connect to the database.
    abstract org.gradle.api.provider.Property<String>
    The user to use to connect to the database.
    protected abstract org.gradle.workers.WorkerExecutor
     

    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
  • Method Details

    • getWorkerExecutor

      @Inject protected abstract org.gradle.workers.WorkerExecutor getWorkerExecutor()
    • getClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getClasspath()
      The classpath for executing Flyway.

      Defaults to the flywayClasspath configuration, itself extending the flyway configuration.

    • getUrl

      @Input public abstract org.gradle.api.provider.Property<String> getUrl()
      The jdbc url to use to connect to the database.

      Defaults to the project-level flyway extension's url property.

    • getUser

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getUser()
      The user to use to connect to the database.

      Defaults to the project-level flyway extension's user property.

    • getPassword

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getPassword()
      The password to use to connect to the database.

      Defaults to the project-level flyway extension's password property.

    • getConfigurationFile

      @Internal public abstract org.gradle.api.file.RegularFileProperty getConfigurationFile()
      The Flyway configuration file (must be a Java properties file encoded in UTF-8, might not exist)

      Defaults to the project-level flyway extension's configurationFile property.

    • getConfiguration

      @Input public abstract org.gradle.api.provider.MapProperty<String,String> getConfiguration()
      Additional configuration properties to be merged with the configuration file (overriding it).

      Defaults to the project-level flyway extension's configuration property.

    • getMigrationLocations

      @Internal protected abstract org.gradle.api.file.ConfigurableFileCollection getMigrationLocations()
      The directories containing migration scripts.

      Declared here as internal as an implementation detail to make it easier to implement the task action.

    • getTarget

      @Internal protected abstract org.gradle.api.provider.Property<String> getTarget()
      The target version up to which Flyway should consider migrations.

      Declared here as internal as an implementation detail to make it easier to implement the task action.

    • getJavaLauncher

      @Optional public abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> getJavaLauncher()
      Configures the java executable to be used to run Flyway.

      If it is the same as the one used to run Gradle, then Flyway will run in-process.

      When the java-base plugin is applied, it defaults to using the toolchain configured at the project level.