Class DefaultProjectLayout

java.lang.Object
org.machanism.machai.project.layout.ProjectLayout
org.machanism.machai.project.layout.DefaultProjectLayout

public class DefaultProjectLayout extends ProjectLayout
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 null.

Since:
0.0.2
Author:
Viktor Tovstyi
See Also:
  • Constructor Details

    • DefaultProjectLayout

      public DefaultProjectLayout()
  • Method Details

    • getModules

      public List<String> 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:
      getModules in class ProjectLayout
      Returns:
      a list of module directory names (never null)
    • getSources

      public List<String> getSources()
      Returns a list of source roots for this layout.
      Specified by:
      getSources in class ProjectLayout
      Returns:
      empty list; not inferred by the default layout
    • getDocuments

      public List<String> getDocuments()
      Returns a list of documentation roots for this layout.
      Specified by:
      getDocuments in class ProjectLayout
      Returns:
      empty list; not inferred by the default layout
    • getTests

      public List<String> getTests()
      Returns a list of test source roots for this layout.
      Specified by:
      getTests in class ProjectLayout
      Returns:
      empty list; not inferred by the default layout
    • projectDir

      public DefaultProjectLayout projectDir(File projectDir)
      Description copied from class: ProjectLayout
      Sets the project root directory used by this layout.
      Overrides:
      projectDir in class ProjectLayout
      Parameters:
      projectDir - the project root directory
      Returns:
      this instance for chaining