Kotlin Project Builder (KPB) is a powerful, multi-module toolkit designed to streamline the scaffolding, creation, and management of Kotlin projects. It empowers developers to generate structured projects, manage dependencies via Version Catalogs, and maintain configuration consistency with ease.
KPB offers both a robust CLI (Command Line Interface) for terminal users and an experimental GUI App (Compose Desktop).
- Structured Scaffolding: Initialize new Kotlin projects with best-practice directory structures.
- Dynamic Modules: Add, remove, and configure modules (e.g., Core, CLI, App, Utils) on the fly.
- Smart Templates: Apply built-in templates to jumpstart development:
- Compose Desktop: Ready-to-run desktop application setup.
- CLI Tools: Standard command-line tool structure.
- Libraries: Clean setup for Kotlin libraries.
- File Generation: Inject source code (
.kt) and resources directly into modules.
- Version Catalog Integration: First-class support for
libs.versions.toml. Manage versions, libraries, and plugins centrally. - Automated Updates: Add dependencies and plugins through the tool, automatically updating the version catalog.
- Inter-Module Linking: Easily define dependencies between your project's modules.
- Save/Load Configurations: Serialize your entire project state to JSON. Pause and resume your work anytime.
- Folder-Based Storage: Save project structures to specific folders, including all generated files and configurations.
- Comprehensive Logging: Detailed logs (Console & File) to track every action, ensuring transparency and easier debugging.
The project is organized into several key modules:
kpb-core: The brain of the operation. Contains the domain logic (Project, Module, GradleFile, VersionCatalog), persistence, and the DSL for project composition.kpb-cli: The primary interface. A fully functional interactive command-line tool.kpb-app: (Experimental) A Compose Desktop graphical interface. Currently in early development.kpb-utils: Shared utilities for logging, formatting, audio helpers, and environment management.
- JDK 21+
- Gradle (Wrapper included)
Clone the repository and build the project using Gradle:
./gradlew clean buildArtifacts will be generated in build/libs and within each module's build/libs directory.
The CLI is the primary way to use KPB currently. It provides an interactive menu system.
java -jar kpb-cli/build/libs/kpb-cli-1.0.1.jarOnce running, follow the on-screen prompts to:
- Create a new project.
- Add modules and dependencies.
- Generate the project files to disk.
Note: The GUI App is currently incomplete and intended for development/testing purposes only.
java -jar kpb-app/build/libs/kpb-app-v1.0.1.jarWe welcome contributions! Here are some common tasks:
- Build:
./gradlew build - Test:
./gradlew test - Generate Docs:
./gradlew dokkaHtml(Output:build/dokka/html/index.html)
Please ensure all public APIs are documented:
- concise summary.
@paramand@returndescriptions.@throwsfor expected exceptions.
Generated by Kotlin Project Builder Team