Class DefaultProjectLayout
java.lang.Object
org.machanism.machai.project.layout.ProjectLayout
org.machanism.machai.project.layout.DefaultProjectLayout
Minimal fallback
ProjectLayout implementation.
This layout performs a lightweight filesystem inspection and treats each
immediate subdirectory of the configured project root as a potential module
(excluding entries listed in ProjectLayout.getExcludeDirs()). It does
not try to infer language-specific source, test or documentation roots; those
accessors return empty collections.
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionCached module directory names discovered beneath the project root.Fields inherited from class org.machanism.machai.project.layout.ProjectLayout
NO_MODULES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of documentation roots for this layout.Returns a list of module directory names present in the configured project directory.Returns a list of source roots for this layout.getTests()Returns a list of test source roots for this layout.projectDir(File projectDir) Sets the project root and returns this layout for fluent configuration.Methods inherited from class org.machanism.machai.project.layout.ProjectLayout
getExcludeDirs, getParentId, getProjectDir, getProjectId, getProjectLayoutType, getProjectName, getRelativePath, getRelativePath, getRelativePath, getTempDir, isExcludedPath, listDirectories, listFiles, setExcludeDirs
-
Field Details
-
modules
Cached module directory names discovered beneath the project root.
-
-
Constructor Details
-
DefaultProjectLayout
public DefaultProjectLayout()Creates a default project layout instance.
-
-
Method Details
-
getModules
Returns a list of module directory names present in the configured project directory.The default implementation treats each immediate subdirectory as a module.
DefaultProjectLayout layout = new DefaultProjectLayout(); java.util.List<String> modules = layout.projectDir(new java.io.File("C:\\repo")).getModules();- Overrides:
getModulesin classProjectLayout- Returns:
- module directory names, or
nullwhen no eligible subdirectories are present
-
getSources
Returns a list of source roots for this layout.- Specified by:
getSourcesin classProjectLayout- Returns:
- empty list; not inferred by the default layout
-
getDocuments
Returns a list of documentation roots for this layout.- Specified by:
getDocumentsin classProjectLayout- Returns:
- empty list; not inferred by the default layout
-
getTests
Returns a list of test source roots for this layout.- Specified by:
getTestsin classProjectLayout- Returns:
- empty list; not inferred by the default layout
-
projectDir
Sets the project root and returns this layout for fluent configuration.- Overrides:
projectDirin classProjectLayout- Parameters:
projectDir- project root directory- Returns:
- this layout instance
-