Class AbstractDetectResolution

java.lang.Object
build.spin.module.java.AbstractDetectResolution
All Implemented Interfaces:
build.spin.Task<build.spin.module.modulesystem.CompilationResolution>
Direct Known Subclasses:
Java25CompilerPlugin.DetectCompilationResolution, Java8CompilerPlugin.DetectCompilationResolution

public abstract class AbstractDetectResolution extends Object implements build.spin.Task<build.spin.module.modulesystem.CompilationResolution>
An abstract Task that resolves the source-graph dependency closure for a JavaPlugin Project, partitioning all candidates into a CompilationResolution (module-path vs classpath).

The algorithm has three steps:

  1. Walk the workspace-sibling transitive closure starting from the injected the injected JDKModuleDescriptor's requiresClauses().
  2. Resolve each external require transitively via Aether (Artifact.Resolver.resolveTransitive(Artifact)), so artifact-graph cycles are handled by the resolver rather than a hand-rolled BFS.
  3. Classify all candidates via ModuleGraphClassifier.classify(List, Set, Consumer) with the three-tier split-package policy (required-module preference → proper-over-automatic → demote-all).

Concrete subclasses are empty inner classes of the enclosing plugin, which is what causes the DI framework to bind JDKModuleDescriptor to the correct plugin-scoped descriptor (main vs test).

  • Nested Class Summary

    Nested classes/interfaces inherited from interface build.spin.Task

    build.spin.Task.Pattern
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Stream<build.spin.module.modulesystem.Artifact>
    Subclasses may override this to supply additional infrastructure Artifacts that are always resolved transitively and included as classification candidates, regardless of whether the project explicitly declares them as dependencies.
    protected Stream<Path>
    Subclasses may override this to inject additional candidate paths (e.g. the main compiled classes directory for a JUnit test plugin running in the same project).
    build.spin.module.modulesystem.CompilationResolution
    Resolves the compilation dependency closure and classifies all candidates.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface build.spin.Task

    dependencies, execute
  • Constructor Details

    • AbstractDetectResolution

      public AbstractDetectResolution()
  • Method Details

    • additionalSiblingCandidates

      protected Stream<Path> additionalSiblingCandidates()
      Subclasses may override this to inject additional candidate paths (e.g. the main compiled classes directory for a JUnit test plugin running in the same project). These paths are prepended to the sibling candidates before classification.
      Returns:
      a Stream of additional candidate Paths
    • additionalArtifacts

      protected Stream<build.spin.module.modulesystem.Artifact> additionalArtifacts()
      Subclasses may override this to supply additional infrastructure Artifacts that are always resolved transitively and included as classification candidates, regardless of whether the project explicitly declares them as dependencies.

      This is the right place for build-tool runner JARs (e.g. the JUnit Platform ConsoleLauncher) that spin provides itself rather than expecting the project to declare.

      Returns:
      a Stream of additional Artifacts to resolve
    • create

      public build.spin.module.modulesystem.CompilationResolution create()
      Resolves the compilation dependency closure and classifies all candidates.
      Returns:
      the CompilationResolution