LstBuilder
Orchestrates the 4-stage LST building pipeline and multi-language file parsing.
Classpath resolution (4 stages) — runs once per build invocation and the result is shared by all JVM language parsers (Java, Kotlin, Groovy):
Stage 1 — ProjectBuildStage Run the project's own build tool (Maven/Gradle) to extract the compile classpath.
Stage 2 — DependencyResolutionStage Run
mvn dependency:tree/gradle dependenciessubprocesses and resolve via Maven Resolver.Stage 3 — BuildFileParseStage Parse build files statically and resolve via Maven Resolver POM traversal.
Stage 4 — LocalRepositoryStage Scan
~/.m2/~/.gradle/cachesfor already-cached JARs matching declared deps.
Gradle DSL classpath — an additional classpath resolved from the Gradle installation (via GRADLE_HOME, the project's Gradle wrapper, or ~/.gradle/wrapper/dists/) is added on top of the regular classpath exclusively for Gradle script files:
.gradle— Groovy DSL build scripts*.gradle.kts— Kotlin DSL build scripts (e.g.build.gradle.kts,settings.gradle.kts)
Plain .kt sources and non-Gradle .kts scripts receive only the regular project classpath.
Java/Kotlin version detection — each .java, .kt, and .kts source file receives a org.openrewrite.java.marker.JavaVersion marker whose sourceCompatibility/targetCompatibility values reflect the nearest build descriptor found by walking up from the file's own directory toward build's projectDir. See io.github.skhokhlov.rewriterunner.lst.utils.VersionDetector for the full algorithm.
Maven POM parsing — pom.xml files are routed to org.openrewrite.maven.MavenParser, producing Xml.Document nodes annotated with org.openrewrite.maven.tree.MavenResolutionResult and related Maven markers. All other *.xml files use org.openrewrite.xml.XmlParser.
Constructors
Functions
Parse all source files in projectDir into OpenRewrite SourceFile trees.