Skip to content

Learning how to create a simple (native) executable script using Kotlin

License

Notifications You must be signed in to change notification settings

Bhinneka/kotlin-script-example

Repository files navigation

Kotlin Script Example

Learning how to create a simple (native) executable script using Kotlin

Prequisites

  • Please install a standalone Kotlin compiler. If you are using *Nix, you can use brew with the following command in your console;

    brew install kotlin
  • Check if Kotlin compiler already installed with typing kotlinc in your console

How to test a Script ?

  • Kotlin script has two different executables, you can use Kotlin compiler or Native compiler based on your needs 😄

  • If you are using Kotlin compiler, please create a Kotlin file with extension .kts and compile it in your console using the following command;

    kotlinc -script your_file.kts
    
  • If you are using Native compiler, please build the project using gradle wrapper command like this;

    ./gradlew clean build
    
  • Then run the .kexe extension from your console using the following command;

    Debug
    ./gradlew runDebugExecutableMacos
    
    Release
    ./gradlew runReleaseExecutableMacos
    
  • For other operating system, please change the suffix instead 😄

About

Learning how to create a simple (native) executable script using Kotlin

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages