https://github.com/kotlin/kotlin-script-examples
Examples of Kotlin Scripts and usages of the Kotlin Scripting API
https://github.com/kotlin/kotlin-script-examples
kotlin kotlin-script
Last synced: 12 months ago
JSON representation
Examples of Kotlin Scripts and usages of the Kotlin Scripting API
- Host: GitHub
- URL: https://github.com/kotlin/kotlin-script-examples
- Owner: Kotlin
- License: apache-2.0
- Created: 2020-02-07T14:17:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-13T20:07:58.000Z (about 1 year ago)
- Last Synced: 2025-06-08T15:05:06.749Z (about 1 year ago)
- Topics: kotlin, kotlin-script
- Language: Kotlin
- Homepage:
- Size: 209 KB
- Stars: 328
- Watchers: 29
- Forks: 47
- Open Issues: 11
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
# Kotlin scripting examples
This repository contains example projects and individual scripts, as well as links to the external examples
demonstrating Kotlin Scripting functionality and API usage.
If you know good examples of the Kotlin scripting API usage, not mentioned here, please submit an issue or a pull
request with the link and short description.
## Examples in this repository
The complete project could be compiled with Gradle, as well as imported e.g. in IntelliJ IDEA.
The individual example projects are mostly independent and could be copied and reused independently, but build files
should be adapted accordingly, mostly to supply required Kotlin version properties and setup inter-project dependencies
when needed
### Script definitions with scripting hosts
- [Simple script definition](jvm/basic/jvm-simple-script/SimpleScript.md)
- [Script with dynamic dependencies from Maven](jvm/basic/jvm-maven-deps/MavenDeps.md)
- [Scripting Host with Kotlin Compiler Embeddable](jvm/basic/jvm-embeddable-host/EmbeddableCompiler.md)
- [Simplified main-kts-like script implementation](jvm/simple-main-kts/SimpleMainKts.md)
- [`main-kts` scripts examples](jvm/main-kts/MainKts.md)
- [using scripting via JSR 223 interface](jvm/jsr223/jsr223.md)
## External examples
- [kotlin-asyncapi: Maven plugin and Spring Boot executable JAR scripting hosts](https://github.com/OpenFolder/kotlin-asyncapi)
## License
The Apache 2 license (given in full in [LICENSE.txt](LICENSE.txt) applies to all code in this repository which
is copyright by JetBrains.