Class ProjectGenerator
java.lang.Object
com.pragma.archetype.application.generator.ProjectGenerator
Application service responsible for generating project structure.
Orchestrates template processing and file generation.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectGenerator(TemplateRepository templateRepository, FileSystemPort fileSystemPort) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependencyToModule(Path projectPath, String modulePath, String dependencyPath) Updates a module's build.gradle.kts to add a dependency.voidaddModuleToSettings(Path projectPath, String modulePath) Updates settings.gradle.kts to include a new module.generateProject(Path projectPath, ProjectConfig config) Generates the complete project structure based on configuration.
-
Constructor Details
-
ProjectGenerator
-
-
Method Details
-
generateProject
Generates the complete project structure based on configuration.- Parameters:
projectPath- the root directory where the project will be generatedconfig- the project configuration- Returns:
- list of generated files
-
addModuleToSettings
Updates settings.gradle.kts to include a new module. Reads the file, adds the include statement if not present, and writes back.- Parameters:
projectPath- the project root pathmodulePath- the module path (e.g., "infrastructure:entry-points:rest-api")
-
addDependencyToModule
Updates a module's build.gradle.kts to add a dependency. Reads the file, adds the dependency if not present, and writes back.- Parameters:
projectPath- the project root pathmodulePath- the module path (e.g., "application/app-service")dependencyPath- the dependency module path (e.g., ":infrastructure:entry-points:rest-api")
-