Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anatawa12/auto-tostring
A kotlin compiler plugin to generate toString like data class.
https://github.com/anatawa12/auto-tostring
compiler-plugin kotlin kotlin-compiler-plugin
Last synced: 13 days ago
JSON representation
A kotlin compiler plugin to generate toString like data class.
- Host: GitHub
- URL: https://github.com/anatawa12/auto-tostring
- Owner: anatawa12
- License: mit
- Created: 2021-03-31T05:13:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T02:29:41.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T18:57:53.053Z (2 months ago)
- Topics: compiler-plugin, kotlin, kotlin-compiler-plugin
- Language: Kotlin
- Homepage:
- Size: 136 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Auto ToString Kotlin Compiler Plugin
====[![a12 maintenance: Slowly](https://api.anatawa12.com/short/a12-slowly-svg)](https://api.anatawa12.com/short/a12-slowly-doc)
A kotlin compiler plugin to generate toString like data class.
## How to use
First, you need to apply this gradle plugin
```kotlin
plugins {
id("org.jetbrains.kotlin.jvm") version ""
id("com.anatawa12.auto-tostring") version ""
}
```To add compile-time library, add code below:
```groovy
autoToString {
// for compileOnly configuration
addLib()
// for CompileOnly configuration
addLib "sourceSet"
addLib sourceSet: "sourceSet"
// for your configuration
addLib configuration: "yourConfiguration"
}
```To generate toString function, add ``@AutoToString`` annotation to class.
## Extra features
For `kotlin.String` or string it typed fields, This plugin surrounded the value with `"`
like `SomeClass(value="string body")` and also surrounded with `'` for `kotlin.Char`s.You can customize wrapping with `@SurroundedWith(begin=, end=)`. see KDoc for more details.