AalekhExtractTask

@CacheableTask
abstract class AalekhExtractTask : DefaultTask(source)

Extracts the module dependency graph and writes it as JSON.

Why a dedicated task instead of projectsEvaluated?

Writing files at configuration time (inside projectsEvaluated) makes Gradle treat every build as having changed inputs, breaking the configuration cache. This task moves all I/O into a proper task action, so Gradle can:

  • Fingerprint the inputs (project structure, dependency data)

  • Skip the task on subsequent runs if nothing changed (UP-TO-DATE)

  • Store/restore the output correctly across CC entries

Configuration Cache safety

All inputs are plain @Input Strings/Maps/Booleans - no live Project, Configuration, or Dependency objects are captured. The plugin serializes everything to primitive types in provider lambdas at configuration time, then passes only those primitives to this task.

Filtering

includeTestDependencies and includeCompileOnlyDependencies mirror the flags on com.aalekh.aalekh.gradle.AalekhExtension. They are task inputs (not just extension properties) so Gradle can correctly invalidate the UP-TO-DATE cache when a user toggles them.

Caching

CacheableTask: output is fully determined by inputs. Caching avoids re-extracting the graph on CI when nothing has changed.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open var actions: List<Action<in Task?>?>?
Link copied to clipboard
open val ant: AntBuilder?
Link copied to clipboard
@get:Internal
open val asDynamicObject: DynamicObject
Link copied to clipboard
@get:InputFiles
@get:PathSensitive(value = PathSensitivity.RELATIVE)
abstract val buildFiles: ConfigurableFileCollection

The subproject build files themselves, scanned to locate the line each project dependency is declared on (DependencyEdge.declarationLine).

Link copied to clipboard
@get:Input
abstract val buildInventoryJson: Property<String>

The configuration-time half of the build inventory, as JSON.

Link copied to clipboard
open val dependsOn: Set<Any?>?
Link copied to clipboard
open var description: @Nullable String?
Link copied to clipboard
open val destroyables: TaskDestroyables?
Link copied to clipboard
open var didWork: Boolean
Link copied to clipboard
open var enabled: Boolean
Link copied to clipboard
open val extensions: ExtensionContainer?
Link copied to clipboard
open val finalizedBy: TaskDependency?
Link copied to clipboard
@get:Input
abstract val gradleVersion: Property<String>

Gradle version - written into graph metadata.

Link copied to clipboard
open var group: @Nullable String?
Link copied to clipboard
open val identityPath: Path?
Link copied to clipboard
Link copied to clipboard
@get:Input
abstract val includeCompileOnlyDependencies: Property<Boolean>

Whether to include compileOnly configurations in the extracted graph.

Link copied to clipboard
@get:Input
abstract val includeExternalDependencies: Property<Boolean>

Whether to capture external (third-party) dependencies in the extracted graph.

Link copied to clipboard
@get:Input
abstract val includeTestDependencies: Property<Boolean>

Whether to include test configurations (testImplementation, androidTestImplementation, etc.) in the extracted graph.

Link copied to clipboard
open val inputs: TaskInputsInternal?
Link copied to clipboard
@get:Internal
open var isEnabled: Boolean
Link copied to clipboard
Link copied to clipboard
@get:Internal
open val lifecycleDependencies: TaskDependencyInternal?
Link copied to clipboard
open val localState: TaskLocalState?
Link copied to clipboard
open val logger: Logger?
Link copied to clipboard
open val logging: LoggingManager?
Link copied to clipboard
open val mustRunAfter: TaskDependency?
Link copied to clipboard
open val name: String?
Link copied to clipboard
open val onlyIf: Spec<in TaskInternal?>?
Link copied to clipboard
@get:OutputFile
abstract val outputFile: RegularFileProperty
Link copied to clipboard
open val outputs: TaskOutputsInternal?
Link copied to clipboard
open val path: String?
Link copied to clipboard
open val project: Project?
Link copied to clipboard
@get:InputFiles
@get:PathSensitive(value = PathSensitivity.RELATIVE)
abstract val projectMetadataFiles: ConfigurableFileCollection

Optional project-level files that describe the build rather than the code: CODEOWNERS and .aalekh/modules.json.

Link copied to clipboard
@get:Input
abstract val projectName: Property<String>

Root project name - written into graph metadata.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val requiredServices: TaskRequiredServices?
Link copied to clipboard
@get:Input
abstract val rootProjectDir: Property<String>

Root project directory path. Used to resolve conventional build file paths for violation messages. Stored as a plain string rather than a Directory property so it doesn't skew UP-TO-DATE checks on the output file.

Link copied to clipboard
open val sharedResources: List<ResourceLock?>?
Link copied to clipboard
open val shouldRunAfter: TaskDependency?
Link copied to clipboard
open val standardOutputCapture: StandardOutputCapture?
Link copied to clipboard
open val state: TaskStateInternal?
Link copied to clipboard
@get:Input
abstract val subprojectBuildFilePaths: MapProperty<String, String>

Repo-relative build file path per subproject, forward-slash separated.

Link copied to clipboard
@get:Input
abstract val subprojectData: MapProperty<String, List<String>>

Inter-module dependency data captured at configuration time.

Link copied to clipboard
@get:Input
abstract val subprojectExternalData: MapProperty<String, List<String>>

External (third-party) dependency data captured at configuration time.

Link copied to clipboard
@get:Input
abstract val subprojectPlugins: MapProperty<String, List<String>>

Applied plugin class names per subproject - used for module type detection.

Link copied to clipboard
@get:Input
abstract val subprojectSourceSets: MapProperty<String, List<String>>

Kotlin Multiplatform source-set names per subproject, empty for non-KMP modules.

Link copied to clipboard
open val taskActions: List<InputChangesAwareTaskAction?>?
Link copied to clipboard
open val taskDependencies: TaskDependencyInternal?
Link copied to clipboard
open val taskIdentity: TaskIdentity<*>?
Link copied to clipboard
open val temporaryDir: File?
Link copied to clipboard
open val temporaryDirFactory: Factory<File?>?
Link copied to clipboard
open val timeout: Property<Duration?>?

Functions

Link copied to clipboard
open fun acceptServiceReferences(serviceReferences: Set<ServiceReferenceSpec?>?)
Link copied to clipboard
open fun appendParallelSafeAction(action: Action<in Task?>?)
Link copied to clipboard
open operator fun compareTo(otherTask: Task?): Int
Link copied to clipboard
open fun configure(closure: Closure<*>?): Task?
Link copied to clipboard
open fun dependsOn(vararg paths: Any?): Task?
Link copied to clipboard
open fun doFirst(action: Closure<*>?): Task?
open fun doFirst(action: Action<in Task?>?): Task?
open fun doFirst(actionName: String?, action: Action<in Task?>?): Task?
Link copied to clipboard
open fun doLast(action: Closure<*>?): Task?
open fun doLast(action: Action<in Task?>?): Task?
open fun doLast(actionName: String?, action: Action<in Task?>?): Task?
Link copied to clipboard
open fun doNotTrackState(reasonNotToTrackState: String?)
Link copied to clipboard
open fun doNotTrackStateIf(reason: String?, spec: Spec<in TaskInternal?>?)
Link copied to clipboard
fun extract()
Link copied to clipboard
open fun finalizedBy(vararg paths: Any?): Task?
Link copied to clipboard
open fun hasProperty(propertyName: String?): Boolean
Link copied to clipboard
Link copied to clipboard
open fun mustRunAfter(vararg paths: Any?): Task?
Link copied to clipboard
open fun onlyIf(onlyIfClosure: Closure<*>?)
open fun onlyIf(spec: Spec<in Task?>?)
open fun onlyIf(onlyIfReason: String?, spec: Spec<in Task?>?)
Link copied to clipboard
open fun prependParallelSafeAction(action: Action<in Task?>?)
Link copied to clipboard
open fun property(propertyName: String?): Any?
Link copied to clipboard
open fun restoreOnlyIf(onlyIf: Spec<in TaskInternal?>?)
Link copied to clipboard
open fun restoreTaskActions(taskActions: List<InputChangesAwareTaskAction?>?)
Link copied to clipboard
open fun setDependsOn(dependsOn: Iterable<*>?)
Link copied to clipboard
open fun setFinalizedBy(finalizedByTasks: Iterable<*>?)
Link copied to clipboard
open fun setMustRunAfter(mustRunAfterTasks: Iterable<*>?)
Link copied to clipboard
open fun setOnlyIf(onlyIfClosure: Closure<*>?)
open fun setOnlyIf(spec: Spec<in Task?>?)
open fun setOnlyIf(onlyIfReason: String?, spec: Spec<in Task?>?)
Link copied to clipboard
open fun setProperty(name: String?, value: Any?)
Link copied to clipboard
open fun setShouldRunAfter(shouldRunAfterTasks: Iterable<*>?)
Link copied to clipboard
open fun shouldRunAfter(vararg paths: Any?): TaskDependency?
Link copied to clipboard
open fun usesService(service: Provider<out BuildService<*>?>?)