Class UpdateApiOnlySubscriberDslTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.arc_e_tect.gradle.apionly.subscriber.UpdateApiOnlySubscriberDslTask
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="Rewrites a source file in place; a cache restore would bypass that entirely") public abstract class UpdateApiOnlySubscriberDslTask extends org.gradle.api.DefaultTask
Adds missing apiOnlySubscriber DSL properties to a consumer's build.gradle, using their real plugin defaults.

Groovy DSL (build.gradle) only. Subscription declarations are never invented because their targets and versions belong to the consuming project.

  • 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
    Creates a new task instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyCleanupDsl(boolean value)
    Sets getCleanupDsl() for this run.
    void
    applyGenerateDsl(boolean value)
    Sets getGenerateDsl() for this run.
    abstract org.gradle.api.file.RegularFileProperty
    The consumer project's build.gradle.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether to remove managed comments from the DSL block.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether to generate a missing outer DSL block.
    void
    Updates the consumer build file, keeping a byte-for-byte backup before writing.

    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, getLoggingManager, 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 java.lang.Object

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

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • UpdateApiOnlySubscriberDslTask

      @Inject public UpdateApiOnlySubscriberDslTask()
      Creates a new task instance. Instantiated by Gradle infrastructure.
  • Method Details

    • getBuildFile

      @Internal public abstract org.gradle.api.file.RegularFileProperty getBuildFile()
      The consumer project's build.gradle.
      Returns:
      the build file this task rewrites
    • getGenerateDsl

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getGenerateDsl()
      Whether to generate a missing outer DSL block.
      Returns:
      whether an absent apiOnlySubscriber block is generated
    • applyGenerateDsl

      public void applyGenerateDsl(boolean value)
      Sets getGenerateDsl() for this run.
      Parameters:
      value - whether to generate the outer block when absent
    • getCleanupDsl

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getCleanupDsl()
      Whether to remove managed comments from the DSL block.
      Returns:
      whether comments are stripped from the managed block
    • applyCleanupDsl

      public void applyCleanupDsl(boolean value)
      Sets getCleanupDsl() for this run.
      Parameters:
      value - whether to remove comments from the managed block
    • updateDsl

      public void updateDsl()
      Updates the consumer build file, keeping a byte-for-byte backup before writing.