An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

[![JetBrains incubator project](https://jb.gg/badges/incubator-flat-square.svg)](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.