Package org.machanism.machai.project.layout


package org.machanism.machai.project.layout
APIs for detecting, describing, and working with a repository's on-disk project layout.

This package centers on ProjectLayout, an abstraction that models a project as a root directory plus conventional, root-relative locations such as source, test, resource, and documentation roots. Implementations determine these locations either from build-tool conventions or by inspecting build metadata such as Maven pom.xml, Gradle build files, JavaScript package.json, or Python pyproject.toml.

Core concepts

  • Project directory: the filesystem root from which all returned paths are interpreted.
  • Root-relative locations: most accessor methods return relative paths that should be resolved against the configured project directory before direct filesystem use.
  • Modules: child projects discovered from build metadata or directory conventions for multi-module repositories.

Package responsibilities

  • Provide a common interface for querying standard project folders independent of build system.
  • Support discovery of module identifiers and module directories for multi-project builds.
  • Offer specialized implementations for common ecosystems while preserving a shared access pattern.

Implementations

Example


 java.io.File projectDir = new java.io.File("repo");

 ProjectLayout layout = new MavenProjectLayout().projectDir(projectDir);
 java.util.List<String> modules = layout.getModules();
 java.util.Collection<String> sources = layout.getSources();
 java.util.Collection<String> tests = layout.getTests();
 java.util.Collection<String> documents = layout.getDocuments();