Skip to content

Commit

Permalink
Add initial set of the description files
Browse files Browse the repository at this point in the history
  • Loading branch information
ligee committed Feb 14, 2020
1 parent 517f219 commit d20f4fa
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Kotlin scripting examples

This repository contains example projects and individual scripts, as well es 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 adopted 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)

## External examples

// TODO

## License
The Apache 2 license (given in full in [LICENSE.txt](license/LICENSE.txt) applies to all code in this repository which
is copyright by JetBrains.
7 changes: 7 additions & 0 deletions jvm/basic/jvm-embeddable-host/EmbeddableCompiler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# Kotlin Scripting Examples: Scripting Host with Kotlin Compiler Embeddable

This example demonstrates the that uses the same definition as in the
[Simple script definition example](../jvm-simple-script/SimpleScript.md) but uses the embeddable version of the
Kotlin compiler. The necessity of using embeddable compiler may arise when the dependencies that are packed into
the `kotlin-compiler` jar, could conflict with the dependencies used by the host.
11 changes: 11 additions & 0 deletions jvm/basic/jvm-maven-deps/MavenDeps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Kotlin Scripting Examples: Script with Dynamic dependencies from Maven

This example demonstrates the [script definition](script/) and appropriate [scripting host ](host/) that implements
support for dynamic dependencies from Maven repositories usage, so une can write a script:
```kotlin
@file:DependsOn("junit:junit:4.11")
org.junit.Assert.assertTrue(true)
```
meaning the specified dependency to the particular `junit` version will be downloaded (if not in the cache yet)
during the script compilation and used as a dependency for the rest of the script.
5 changes: 5 additions & 0 deletions jvm/basic/jvm-simple-script/SimpleScript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# Kotlin Scripting Examples: Simple Script Definition

This example demonstrates creation of the [simple script definition project](script/) and simple
[scripting host project](host/) that uses the definition.

0 comments on commit d20f4fa

Please sign in to comment.