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 defines ProjectLayout, a common abstraction for
representing a project as a root directory together with conventional, root-relative locations such as source,
test, and documentation directories. Implementations encapsulate the rules used by different ecosystems to infer
those locations from directory conventions or build metadata.
Core concepts
- Project directory: the filesystem root against which all discovered relative locations are resolved.
- Root-relative path: layout accessors typically return path relative to the project directory rather than absolute filesystem locations.
- Modules: child projects that may be declared by build metadata or discovered from common multi-module conventions.
Package responsibilities
- Provide a uniform way to query source, test, and documentation folders across build systems.
- Expose module identifiers and module directories for repositories that contain nested projects.
- Offer specialized implementations for common build ecosystems while preserving a consistent programming model.
Implementations
MavenProjectLayoutreads Maven-oriented layout information from conventional structure andpom.xmlmetadata.GradleProjectLayoutrepresents Gradle-style project locations and module structure.JScriptProjectLayoutresolves JavaScript project folders and workspace modules frompackage.jsonconfiguration.PythonProjectLayoutidentifies Python project structure frompyproject.tomlconventions.DefaultProjectLayoutprovides a fallback implementation when no ecosystem-specific model applies.
Typical usage
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();
-
ClassesClassDescriptionMinimal fallback
ProjectLayoutimplementation.A Gradle-specificProjectLayoutimplementation.A project layout utility for JavaScript/TypeScript-based projects.A Maven-specificProjectLayoutimplementation.Utility for reading and processing Mavenpom.xmlfiles into Maven models.Base abstraction for describing a project's conventional on-disk layout.Project layout implementation for Python-based projects.