https://github.com/fbsamples/kotlin_ast_tools
Utilities and examples used in Meta to simplify migration from Java to Kotlin and maintenance of Kotlin code.
https://github.com/fbsamples/kotlin_ast_tools
Last synced: 11 months ago
JSON representation
Utilities and examples used in Meta to simplify migration from Java to Kotlin and maintenance of Kotlin code.
- Host: GitHub
- URL: https://github.com/fbsamples/kotlin_ast_tools
- Owner: fbsamples
- License: apache-2.0
- Created: 2022-05-11T17:15:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T18:54:58.000Z (11 months ago)
- Last Synced: 2025-03-28T09:06:12.535Z (11 months ago)
- Language: Kotlin
- Homepage:
- Size: 305 KB
- Stars: 182
- Watchers: 7
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Kotlin AST Tools by Meta
These are various examples, tools and utilities extracted from Meta's Java to Kotlin migration effort. Some of these may be directly used, and some are supplied as examples and inspirations to encourage more automated editing of Kotlin code.
We are releasing this to provide examples of AST manipulation in Kotlin using Kotlin APIs in hope that this will encourage more people to use them.
Currently, there are three packages here:
1. `com.facebook.asttools` containing some utilities we use to simplify work with the Kotlin compiler API
2. `com.facebook.matching` containing a helper class to allow simple and readable refactors to a Kotlin file
3. `com.facebook.kotlin.postconversion` containing a few examples of common cleanups of newly converted Kotlin files, and a simple command line tool to run them.
## Running the tool
The example tool can be built and run with gradle:
```shell
./gradlew run
```
## License
Apache License 2.0