forked from Kotlin/kotlin-script-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial set of the description files
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |