KtsRunner alternatives and similar libraries
Based on the "Tools" category.
Alternatively, view KtsRunner alternatives based on common mentions on social networks and blogs.
-
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️ -
jtransc
Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library. -
CrunchyCalendar
A beautiful material calendar with endless scroll, range selection and a lot more! -
MpApt
(Deprecated) :wrench: Kotlin Native/JS/JVM Annotation Processor library for Kotlin compiler plugins -
BlurTutorial
Library for creating blur effects under Android UI elements -
Ostara
Ostara is a desktop application that provides various features to monitor and interact with Spring Boot Applications via Actuator. -
LiveStream-Kt (Android) 📱
LiveStream is a simple class which makes communication easy among different modules of your application. -
ktfmt-gradle
A Gradle plugin to apply ktfmt to your builds, and reformat you Kotlin source code like a glimpse 🧹🐘 -
Kotlin Telegram Bot
Telegram Bot API wrapper with handy Kotlin DSL. -
detekt-hint
Detection of design principle violations in Kotlin as a plugin to detekt. -
ARFaceDetection
AR-based library for Android which is capable of detecting faces and overlaying images above the user’s head -
Kotlin Bootstrap
This set of libraries is designed to help developers accomplish various tasks easier and faster -
ColdStorage
Lightweight data loading and caching library for android -
Credit Card Scanner
Android Credit Card Scanner using CameraX and ML Kit -
EasyDokkaPlugin
Gradle Script plugin to generate documentation by Dokka documentation engine in Javadoc or other formats for Java, Kotlin, Android and non-Android projects. It's very easy, you don't need to add to dependencies section additional classpath or think about compatibility issues, you don't need additional repositories also. -
GradleMavenPush
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories). -
KotlinW
A small wrapper for the Kotlin compiler that can be used to execute .kts scripts -
AndroidOtpView (With gradient color in lines)
Android Otp View with gradient in kotlin -
buildSrcVersions
Better Gradle dependencies management inside the IDE. Search for available updates.
Appwrite - The Open Source Firebase alternative introduces iOS support
Do you think we are missing an alternative of KtsRunner or a related project?
README
KtsRunner
KtsRunner is a light-weight tool that allows the execution of .kts
(Kotlin Script) files from ordinary Kotlin programs.
It's enabled by JSR 223 (Java Scripting Engines API).
Usage
Running a script from file system
A simple usage example for KtsRunner can be described as follows:
The declaration of a class is placed in a .kts
file, which is supposed to be loaded into a normal Kotlin program so that it
can be processed further.
Example class
data class ClassFromScript(val x: String)
.kts
fileimport de.swirtz.ktsrunner.objectloader.ClassFromScript
ClassFromScript("I was created in kts")
3. Code to load the object
```kotlin
val scriptReader = Files.newBufferedReader(Paths.get("path/classDeclaration.kts"))
val loadedObj: ClassFromScript = KtsObjectLoader().load<ClassFromScript>(scriptReader)
println(loadedObj.x)
// >> I was created in kts
As shown, the KtsObjectLoader
can be used for executing a .kts
script and getting its result. The example shows a script that creates an instance of the ClassFromScript
type that is loaded via KtsObjectLoader
and then processed in the regular program.
Executing scripts directly
The KtsObjectLoader
also allows the evaluation of simple String
based scripts:
val scriptContent = "5 + 10"
val fromScript: Int = KtsObjectLoader().load<Int>(scriptContent))
println(fromScript)
// >> 15
Application Area
You might want to use KtsRunner when some part of your application's source has to be outsourced from the regular code. As an example, you can think of an application that provides a test suite runtime. The actual test cases are provided by a QA team which writes their test scripts using a domain specific language that is provided by the main application. Since you don't want QA to add source files (defining new test cases) to your application all the time, the test case creation is made via independent .kts
(Kotlin Scripting) files in which the DSL is being utilized. The test suite main application can use the presented KtsRunner library for loading the test cases provided in .kts
files and process them further afterward.
Controlling the ClassLoader
When instantiating an KtsObjectLoader
, you can provide an explicit classloader as shown in this test case:
@Test
fun `when passing a custom classloader, it should be used when loading the script`() {
val myCl = object : ClassLoader() {
override fun loadClass(name: String?): Class<*> {
throw IllegalStateException()
}
}
assertExceptionThrownBy<IllegalStateException> {
KtsObjectLoader(myCl).load("anything")
}
}
Getting Started
In your Gradle build, simply include the following repository and dependency:
maven {
setUrl("https://dl.bintray.com/s1m0nw1/KtsRunner")
}
dependencies {
//...
implementation("de.swirtz:ktsRunner:0.0.x")
}