Package org.machanism.machai.project
Class ProjectLayoutManager
java.lang.Object
org.machanism.machai.project.ProjectLayoutManager
Detects and configures the
ProjectLayout appropriate for a project
directory.
The detector checks project descriptors in a deterministic order: Maven,
Gradle, JavaScript or TypeScript, and Python. A directory without a supported
descriptor receives a DefaultProjectLayout. The returned layout is
configured with the supplied directory before it is returned.
Usage
File directory = new File("path/to/project");
ProjectLayout layout = ProjectLayoutManager.detectProjectLayout(directory);
Callers can use the returned layout directly or pass it to a
ProjectProcessor implementation for traversal.
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrevents instantiation of this utility class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProjectLayoutdetectProjectLayout(File projectDir) Detects the project layout from descriptors in the specified directory and assigns that directory to the resulting layout.
-
Constructor Details
-
ProjectLayoutManager
private ProjectLayoutManager()Prevents instantiation of this utility class.
-
-
Method Details
-
detectProjectLayout
Detects the project layout from descriptors in the specified directory and assigns that directory to the resulting layout.- Parameters:
projectDir- the project directory to analyze- Returns:
- a configured layout matching Maven, Gradle, JavaScript/TypeScript, Python, or the generic filesystem fallback
- Throws:
FileNotFoundException- ifprojectDirdoes not existNullPointerException- ifprojectDirisnull
-