Class IndexJavaReferencesTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.chonghan.javareferenceindex.gradle.IndexJavaReferencesTask
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 IndexJavaReferencesTask extends org.gradle.api.DefaultTask
Gradle task that indexes Java source references for each configured source set.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Serializable description of a compile classpath entry.
    static final record 
    Serializable description of a Java source root.
    static final record 
    Serializable description of one Java source set to index.

    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 the Java reference indexing task.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the compile classpath files used while resolving references.
    Returns classpath target identifiers used as task inputs.
    abstract org.gradle.api.file.DirectoryProperty
    Returns the directory where reference CSV files are written.
    Returns the expected CSV output files for the configured source sets.
    Returns the Gradle project path that owns this task.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Returns Java source files and source directories used by the task.
    Returns stable source set configuration inputs for Gradle cache keys.
    Returns the source sets that will be indexed.
    void
    Builds Java reference indexes and writes them as CSV files.
    void
    setProjectPath(String projectPath)
    Sets the Gradle project path that owns this task.
    void
    Sets the source sets that will be indexed.

    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 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

    • IndexJavaReferencesTask

      public IndexJavaReferencesTask()
      Creates the Java reference indexing task.
  • Method Details

    • getProjectPath

      @Input public String getProjectPath()
      Returns the Gradle project path that owns this task.
      Returns:
      the owning Gradle project path
    • setProjectPath

      public void setProjectPath(String projectPath)
      Sets the Gradle project path that owns this task.
      Parameters:
      projectPath - the owning Gradle project path
    • getSourceSets

      @Internal public List<IndexJavaReferencesTask.SourceSetSpec> getSourceSets()
      Returns the source sets that will be indexed.
      Returns:
      source set specifications for this task
    • setSourceSets

      public void setSourceSets(List<IndexJavaReferencesTask.SourceSetSpec> sourceSets)
      Sets the source sets that will be indexed.
      Parameters:
      sourceSets - source set specifications for this task
    • getSourceSetConfiguration

      @Input public List<String> getSourceSetConfiguration()
      Returns stable source set configuration inputs for Gradle cache keys.
      Returns:
      normalized source set configuration values
    • getClasspathTargets

      @Input public List<String> getClasspathTargets()
      Returns classpath target identifiers used as task inputs.
      Returns:
      sorted target identifiers for classpath entries
    • getSourceInputFiles

      @InputFiles @PathSensitive(RELATIVE) public abstract org.gradle.api.file.ConfigurableFileCollection getSourceInputFiles()
      Returns Java source files and source directories used by the task.
      Returns:
      the source input file collection
    • getClasspathInputFiles

      @Classpath public List<File> getClasspathInputFiles()
      Returns the compile classpath files used while resolving references.
      Returns:
      classpath files for all configured source sets
    • getOutputDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()
      Returns the directory where reference CSV files are written.
      Returns:
      the output directory property
    • getOutputFiles

      @OutputFiles public List<File> getOutputFiles()
      Returns the expected CSV output files for the configured source sets.
      Returns:
      output CSV files for this task
    • javaReferenceIndex

      public void javaReferenceIndex()
      Builds Java reference indexes and writes them as CSV files.