diff --git a/README.md b/README.md index b719919..34683f6 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,43 @@ -# YAML to Kotlin Gradle Plugin +# YAML to Kotlin Gradle Plugin [![GitHub license](https://img.shields.io/github/license/noodlemind/yaml-to-kotlin)](https://github.com/noodlemind/yaml-to-kotlin/blob/main/LICENSE.md) [![Build Status](https://img.shields.io/github/workflow/status/noodlemind/yaml-to-kotlin/Build)](https://github.com/noodlemind/yaml-to-kotlin/actions) [![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Fio%2Fgithub%2Fnoodlemind%2Fyaml-to-kotlin%2Fmaven-metadata.xml&label=Plugin%20Portal)](https://plugins.gradle.org/plugin/io.github.noodlemind.yaml-to-kotlin) -This Gradle plugin generates Kotlin data classes from YAML schema definitions. +Tired of writing Kotlin data classes by hand? Let YAML do the heavy lifting! This Gradle plugin automatically generates type-safe Kotlin data classes, complete with validation, from your YAML schema definitions. -## Table of Contents -- [Installation](#installation) -- [Usage](#usage) -- [YAML Schema Standards](#yaml-schema-standards) -- [Configuration Options](#configuration-options) -- [Examples](#examples) -- [Contributing](#contributing) -- [License](#license) +## Why YAML to Kotlin? + +* Readability: YAML's clean syntax makes it easy to define complex data structures. +* Type Safety: Generated Kotlin data classes provide compile-time checks for data integrity. +* Less Boilerplate: Say goodbye to tedious, manual data class creation. +* Maintainability: Keep your data models in sync with your YAML schemas effortlessly. + +## Key Features + +* Effortless Data Modeling: Craft your data models in human-readable YAML. +* Automatic Code Generation: Generate Kotlin data classes with a single Gradle task. +* Basic Validation: Start with built-in validation rules, or add your own. +* Customization: Configure output directories, package names, and more. +* Future-Proof: Stay tuned for upcoming features like advanced validation and Kotlinx.serialization support! -## Installation -Add the following to your `build.gradle.kts` file: +## Installation ```kotlin -kotlin plugins { id("io.github.noodlemind.yaml-to-kotlin") version "1.0.0" } +plugins { + id("io.github.noodlemind.yaml-to-kotlin") version "1.0.0" +} + ``` + ## Usage 1. Place your YAML schema files in the `src/main/resources/schemas` directory. 2. Configure the plugin in your `build.gradle.kts`: - ```kotlin - kotlin yamlToKotlin { inputDir.set(file("src/main/resources/schemas")) outputDir.set(file("build/generated/source/yaml-to-kotlin")) packageName = "com.example.generated" } - ``` + kotlin yamlToKotlin { inputDir.set(file("src/main/resources/schemas")) outputDir.set(file("build/generated/source/yaml-to-kotlin")) packageName = "com.example.generated" } + ``` 3. Run the Gradle task: - ```commandline - ./gradlew generateKotlinFromYaml - ``` + ```commandline + ./gradlew generateKotlinFromYaml + ``` ## YAML Schema Standards @@ -52,7 +60,7 @@ Your YAML schemas should follow these standards: | `validations` | `name` | string | Name of the custom validation | Yes | | `validations` | `params` | array of strings | Parameters for the custom validation | No | -For more detailed examples, see the [Examples](#examples) section. + ## Configuration Options @@ -109,7 +117,6 @@ validations: - min - max - name: emailFormat - ``` #### Department Data Class @@ -141,13 +148,17 @@ entities: validations: - name: uniqueDepartmentName - ``` + ## Contributing We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details. ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +This project is licensed under   + the MIT License - see the [LICENSE](LICENSE.md) file for   + details. + +Let's write cleaner, safer, and more maintainable Kotlin code together!