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 ClassesModifier and TypeClassDescriptionstatic final recordSerializable description of a compile classpath entry.static final recordSerializable description of a Java source root.static final recordSerializable 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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the compile classpath files used while resolving references.Returns classpath target identifiers used as task inputs.abstract org.gradle.api.file.DirectoryPropertyReturns 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.ConfigurableFileCollectionReturns 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.voidBuilds Java reference indexes and writes them as CSV files.voidsetProjectPath(String projectPath) Sets the Gradle project path that owns this task.voidsetSourceSets(List<IndexJavaReferencesTask.SourceSetSpec> sourceSets) 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, 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
-
IndexJavaReferencesTask
public IndexJavaReferencesTask()Creates the Java reference indexing task.
-
-
Method Details
-
getProjectPath
Returns the Gradle project path that owns this task.- Returns:
- the owning Gradle project path
-
setProjectPath
Sets the Gradle project path that owns this task.- Parameters:
projectPath- the owning Gradle project path
-
getSourceSets
Returns the source sets that will be indexed.- Returns:
- source set specifications for this task
-
setSourceSets
Sets the source sets that will be indexed.- Parameters:
sourceSets- source set specifications for this task
-
getSourceSetConfiguration
Returns stable source set configuration inputs for Gradle cache keys.- Returns:
- normalized source set configuration values
-
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
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
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.
-