Package com.arc_e_tect.gradle.shadow
Class UpdateShadowApiDetectorDslTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.arc_e_tect.gradle.shadow.UpdateShadowApiDetectorDslTask
- 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 UpdateShadowApiDetectorDslTask
extends org.gradle.api.DefaultTask
Adds any
shadowApiDetector DSL properties missing from this project's build file, set
to their default values - see com.arc_e_tect.gradle.dslupdater.DslUpdater and
ShadowApiDetectorDslSchema. Setting an added property explicitly afterwards is a no-op,
so running this task after upgrading the plugin is always safe.
Groovy DSL (build.gradle) only - see dsl-updater-core's own documentation for
why.
-
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 TypeMethodDescriptionvoidapplyCleanupDsl(boolean value) SetsgetCleanupDsl()for this run only.voidapplyGenerateDsl(boolean value) SetsgetGenerateDsl()for this run only.abstract org.gradle.api.file.RegularFilePropertyThe build file to update - the project's ownbuild.gradle.abstract org.gradle.api.provider.Property<Boolean> Strips every comment line from inside the managed block - both pre-existing ones and any doc comment this run would otherwise add - leaving only properties.abstract org.gradle.api.provider.Property<Boolean> When theshadowApiDetectorblock is entirely absent, synthesize a full new one from the schema and append it to the end of the build file; whenfalse(the default), a missing block is left alone.voidReads the build file, adds any missing DSL properties, and writes it back if anything changed - after first copying the original, untouched file alongside it asbuild.gradle.bak, so there's always a plain-file fallback even for a project not using version control (or one that just hasn't committed the file yet).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 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
-
UpdateShadowApiDetectorDslTask
@Inject public UpdateShadowApiDetectorDslTask()Creates a new task instance. Instantiated by Gradle infrastructure.
-
-
Method Details
-
getBuildFile
@Internal public abstract org.gradle.api.file.RegularFileProperty getBuildFile()The build file to update - the project's ownbuild.gradle.- Returns:
- read-only file property for the build file
-
getGenerateDsl
When theshadowApiDetectorblock is entirely absent, synthesize a full new one from the schema and append it to the end of the build file; whenfalse(the default), a missing block is left alone.- Returns:
- mutable property for the generate-DSL flag
-
applyGenerateDsl
public void applyGenerateDsl(boolean value) SetsgetGenerateDsl()for this run only.- Parameters:
value- the value to setgetGenerateDsl()to
-
getCleanupDsl
Strips every comment line from inside the managed block - both pre-existing ones and any doc comment this run would otherwise add - leaving only properties.- Returns:
- mutable property for the cleanup-DSL flag
-
applyCleanupDsl
public void applyCleanupDsl(boolean value) SetsgetCleanupDsl()for this run only.- Parameters:
value- the value to setgetCleanupDsl()to
-
updateDsl
public void updateDsl()Reads the build file, adds any missing DSL properties, and writes it back if anything changed - after first copying the original, untouched file alongside it asbuild.gradle.bak, so there's always a plain-file fallback even for a project not using version control (or one that just hasn't committed the file yet).
-