Package org.machanism.machai.project.layout
The central contract, ProjectLayout, exposes source, test, and
documentation locations together with available module and project-identity metadata. Configure an implementation
with its project root using ProjectLayout.projectDir(java.io.File) before
calling accessors that inspect project files. Location strings are generally relative to that root; resolve them
against the configured directory before filesystem access. The locations describe conventions and, except where
noted for exported Access source, do not guarantee that the paths exist.
Layout selection
The descriptor checks provide a way to choose a specialized implementation:
MavenProjectLayout.isMavenProject(java.io.File) checks for
pom.xml; GradleProjectLayout.isGradleProject(java.io.File) checks
for build.gradle; and
JScriptProjectLayout.isPackageJsonPresent(java.io.File) checks for
package.json. PythonProjectLayout.isPythonProject(java.io.File)
additionally validates that pyproject.toml describes a named, non-private project.
MSAccessProjectLayout.isAccessProject(java.io.File) recognizes an
msaccess-vcs-addin export by the presence of vcs-options.json in the root or an immediate child directory.
Use DefaultProjectLayout as a generic fallback when no specialized
layout applies; it does not infer source, test, documentation, or module locations.
Supported layouts
MavenProjectLayoutreads the Maven model. For projects withpackaging=pom, it exposes declared modules; it also reports configured or conventional source and test roots, resources, the conventionalsrc/sitedocumentation location, and available project and parent identifiers.GradleProjectLayoutuses the Gradle Tooling API for the project model and direct child names. It reports conventionalsrc/main,src/test, andsrc/sitelocations and does not inspect custom source sets.JScriptProjectLayoutreads array-formworkspacesglobs frompackage.json; matching directories are reported only when they contain their ownpackage.json. It does not infer source, test, or documentation locations.PythonProjectLayoutrecognizes a named, non-privatepyproject.tomlproject but does not currently infer module, source, test, or documentation locations.MSAccessProjectLayoutreports the detected msaccess-vcs-addin export directory as a source location; it does not define test or documentation locations.DefaultProjectLayoutsupplies empty source, test, and documentation collections without interpreting project metadata.
ProjectLayout also provides shared path conversion, directory scanning,
exclusion-pattern, project identity, and temporary-directory operations. Maven model parsing and serialization are
provided by PomReader.
Usage
java.io.File projectDir = new java.io.File("repo");
ProjectLayout layout = new MavenProjectLayout().projectDir(projectDir);
java.util.Collection<String> sources = layout.getSources();
java.util.Collection<String> tests = layout.getTests();
Some metadata accessors read descriptors when invoked and may report invalid or unreadable input according to the
implementation. A null module list may indicate that modules are not declared; callers should handle it
rather than assuming every layout returns an empty list.
-
ClassesClassDescriptionMinimal fallback
ProjectLayoutimplementation.A Gradle-specificProjectLayoutimplementation.Describes a JavaScript or TypeScript project that usespackage.json.A Maven-specificProjectLayoutimplementation.Detects MS Access projects managed with the msaccess-vcs-addin (Version Control System add-in for Microsoft Access).Utility for reading and processing Mavenpom.xmlfiles into Maven models.Base abstraction for describing a project's conventional on-disk layout.Detects public Python projects described bypyproject.toml.