build

fun build(projectDir: Path, parseConfig: ParseConfig = toolConfig.parse, includeExtensionsCli: List<String> = emptyList(), excludeExtensionsCli: List<String> = emptyList(), ctx: ExecutionContext = InMemoryExecutionContext {}): List<SourceFile>(source)

Parse all source files in projectDir into OpenRewrite SourceFile trees.

Runs the 3-stage classpath resolution pipeline, then dispatches each collected file to the appropriate language parser based on its extension.

Return

The list of all parsed org.openrewrite.SourceFiles, one per source file found.

Parameters

projectDir

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

parseConfig

Extension inclusion/exclusion and glob-exclusion settings from the tool config file. CLI flags (includeExtensionsCli, excludeExtensionsCli) take precedence when non-empty.

includeExtensionsCli

File extensions to include, as specified via CLI or the library io.github.skhokhlov.rewriterunner.RewriteRunner.Builder. Overrides parseConfig when non-empty.

excludeExtensionsCli

File extensions to skip. Overrides parseConfig when non-empty.

ctx

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