build

fun build(projectDir: Path, excludePaths: List<String> = toolConfig.parse.excludePaths, plainTextMasks: List<String> = emptyList(), restrictToExtensions: Set<String> = emptySet(), ctx: ExecutionContext = InMemoryExecutionContext {}): LstBuildResult(source)

Parse all source files in projectDir into OpenRewrite SourceFile trees.

Runs the 4-stage classpath resolution pipeline (skipped entirely when no JVM source files survive excludePaths), then dispatches each collected file to the appropriate language parser based on its extension.

Return

An LstBuildResult containing the parsed source files and execution diagnostics.

Parameters

projectDir

Root of the project to parse. Must be an existing directory.

excludePaths

Glob patterns (relative to projectDir) of files to skip. Same semantics as the upstream OpenRewrite Gradle/Maven plugin exclusions. Resolved by io.github.skhokhlov.rewriterunner.RewriteRunner from CLI override over io.github.skhokhlov.rewriterunner.config.ParseConfig.excludePaths before reaching here.

plainTextMasks

Glob patterns (relative to projectDir) of otherwise-unhandled files to parse with PlainTextParser. Non-empty values replace the upstream defaults.

restrictToExtensions

When non-empty, only parse files whose extension is in this set. Use for specialized non-JVM parsers (Docker/HCL/Proto) when Stage 0 succeeded.

ctx

OpenRewrite execution context. Defaults to an org.openrewrite.InMemoryExecutionContext that logs parse warnings without aborting.