Class AnalyzerTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.codelaser.maddi.gradleplugin.task.AnalyzerTask
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>

@CacheableTask public abstract class AnalyzerTask extends org.gradle.api.DefaultTask
Runs the maddi analyzer over the project's sources. It deserializes the Configuration computed by the plugin (source sets, classpath, analysis steps, results directory), serialized to getConfigurationJson(), and hands it to the openjdk-parser-based RunAnalyzer, which parses, runs the prep- and modification-analysis, and writes the results to getAnalysisResultsDir() (default <build>/e2immu).

The analysis runs in a forked worker JVM (see AnalyzerWorkAction): the openjdk front-end reaches into jdk.compiler's com.sun.tools.javac.* internals, which need --add-exports. Injecting them into a forked worker keeps the consuming build's Gradle daemon unaffected.

The task holds no Project reference at execution time and uses lazy managed properties, so it is configuration-cache compatible and declares its inputs/outputs for up-to-date checking and build caching.

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

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.DirectoryProperty
    Where the analyzer writes its results (matches analysisResultsDir in the configuration).
    abstract org.gradle.api.file.ConfigurableFileCollection
    The source directories and classpath the analysis reads, for up-to-date checking.
    abstract org.gradle.api.provider.Property<String>
    The serialized run-config Configuration.
    abstract org.gradle.workers.WorkerExecutor
     
    abstract org.gradle.api.file.DirectoryProperty
    Working directory of the forked analyzer; the analyzer resolves relative source-set paths against it.
    void
    run()
     

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

    • AnalyzerTask

      public AnalyzerTask()
  • Method Details

    • getConfigurationJson

      @Input public abstract org.gradle.api.provider.Property<String> getConfigurationJson()
      The serialized run-config Configuration.
    • getAnalyzedInputs

      @InputFiles @PathSensitive(RELATIVE) public abstract org.gradle.api.file.ConfigurableFileCollection getAnalyzedInputs()
      The source directories and classpath the analysis reads, for up-to-date checking.
    • getAnalysisResultsDir

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getAnalysisResultsDir()
      Where the analyzer writes its results (matches analysisResultsDir in the configuration).
    • getWorkingDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getWorkingDirectory()
      Working directory of the forked analyzer; the analyzer resolves relative source-set paths against it.
    • getWorkerExecutor

      @Inject public abstract org.gradle.workers.WorkerExecutor getWorkerExecutor()
    • run

      public void run()