Class JzapTask
- 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>
Declares its inputs and outputs so Gradle can skip it when nothing has changed. That is up-to-date checking rather than build caching, and the two are worth keeping apart here, because this task is deliberately not cacheable for two reasons.
The reports embed phase timings, which differ between runs by design, so an output reused from another machine would present that machine's durations as this run's.
The reason that would actually bite is the second. A diff-scoped run takes its scope from the
git repository, and the repository's state is not a declared input -- only the ref names are.
Two runs with identical classes and an identical from can therefore need different
scopes: commit the change that HEAD..-Local- was selecting, and the correct answer
becomes "nothing in scope" while every declared input is unchanged. That already makes
up-to-date checking optimistic for the diff task, and sharing outputs between machines would
spread it further. Closing it means declaring the resolved commits as an input through a
ValueSource, so that resolving them does not itself break the configuration cache.
-
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 TypeMethodDescriptionvoidanalyse()abstract org.gradle.api.file.ConfigurableFileCollectionEvery class and classpath entry the aggregate covers, so up-to-date checks still work.abstract org.gradle.api.file.DirectoryPropertyThe incremental cache directory, if caching is on.abstract org.gradle.api.file.ConfigurableFileCollectionThe engine to run.abstract org.gradle.api.provider.ListProperty<String>protected abstract org.gradle.process.ExecOperationsabstract org.gradle.api.provider.Property<Boolean>abstract org.gradle.api.provider.Property<String>getFrom()abstract org.gradle.api.provider.ListProperty<String>abstract org.gradle.api.provider.Property<String>abstract org.gradle.api.provider.ListProperty<String>abstract org.gradle.api.provider.ListProperty<String>Pre-rendered module fragments for an aggregate run, one per project.abstract org.gradle.api.provider.Property<String>abstract org.gradle.api.file.ConfigurableFileCollectionCompiled classes to mutate.abstract org.gradle.api.provider.Property<Boolean>abstract org.gradle.api.provider.ListProperty<String>protected abstract org.gradle.api.model.ObjectFactoryabstract org.gradle.api.file.DirectoryPropertyabstract org.gradle.api.provider.ListProperty<String>abstract org.gradle.api.provider.Property<String>getScope()abstract org.gradle.api.file.ConfigurableFileCollectionSource directories, used to map lines to files and to render reports.abstract org.gradle.api.file.ConfigurableFileCollectionEverything needed to run the tests, including the test and main output.abstract org.gradle.api.file.ConfigurableFileCollectionCompiled test classes, scanned for test discovery.abstract org.gradle.api.provider.Property<Integer>abstract org.gradle.api.provider.Property<Double>abstract org.gradle.api.provider.Property<String>getTo()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
-
JzapTask
public JzapTask()
-
-
Method Details
-
getEngineClasspath
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getEngineClasspath()The engine to run. Kept off the buildscript classpath on purpose.A single tracked input, so changing the engine re-runs the analysis and the task stays configuration-cache compatible. An unresolvable engine therefore fails during input snapshotting, with Gradle's own message rather than one of ours.
That is a deliberate choice, recorded here because it is not the obvious one and three attempts at beating it all failed: wrapping the resolution in the action does not help because
@Classpathinputs are snapshotted first; an@Internalfile collection still gains an implicit task dependency that Gradle resolves before executing; and a non-filePropertyfed by a provider is finalised, and therefore queried, before the action too. Each workaround would have traded configuration-cache compatibility for a better sentence. Gradle's message already names the configuration and the missing coordinate, which is the message Gradle users are trained to read; the escape hatch is documented onJzapExtension.getEngineClasspath()instead. -
getMutableCodePaths
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getMutableCodePaths()Compiled classes to mutate. -
getTestClassPaths
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getTestClassPaths()Compiled test classes, scanned for test discovery. -
getTestClasspath
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getTestClasspath()Everything needed to run the tests, including the test and main output. -
getSourceRoots
@InputFiles @PathSensitive(RELATIVE) public abstract org.gradle.api.file.ConfigurableFileCollection getSourceRoots()Source directories, used to map lines to files and to render reports. -
getModuleId
-
getJavaExecutable
-
getThreads
-
getReporters
-
getFrom
-
getTo
-
getScope
-
getIncludeClasses
-
getExcludeClasses
-
getMutators
-
getMutateLoopCounters
-
getThreshold
-
getFailOnSurvivors
-
getJvmArgs
-
getModuleFragments
Pre-rendered module fragments for an aggregate run, one per project.Rendered when the build is configured and carried as strings, because a task cannot hold a variable number of file collections and reaching across to another project at execution time is what breaks the configuration cache.
-
getAggregateInputs
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getAggregateInputs()Every class and classpath entry the aggregate covers, so up-to-date checks still work. -
getReportDir
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getReportDir() -
getCacheDir
@Internal public abstract org.gradle.api.file.DirectoryProperty getCacheDir()The incremental cache directory, if caching is on.Deliberately not declared as an output: it is read-write state that survives a clean of the report directory, and declaring it as an output would let Gradle delete it as stale.
-
getExecOperations
@Inject protected abstract org.gradle.process.ExecOperations getExecOperations() -
getObjects
@Inject protected abstract org.gradle.api.model.ObjectFactory getObjects() -
analyse
public void analyse()
-