File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,10 @@ allprojects {
1212 }
1313}
1414
15+ dependencies {
16+ // adding these dependencies here just to have it locally available after gradle project import
17+ // can be useful when running performance tests for .main.kts scripts
18+ implementation(" org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.0" )
19+ implementation(" eu.jrie.jetbrains:kotlin-shell-core:0.2.1" )
20+ }
21+
Original file line number Diff line number Diff line change 11#! / usr/ bin/ env kotlin
22
3+ /* *
4+ * A command-line utility script that provides directory listing and word counting functionality.
5+ *
6+ * Usage:
7+ * - Without arguments: Lists files in the current directory (equivalent to `ls -l`)
8+ * - With file argument: Performs word count analysis (similar to `wc` command)
9+ * Shows both custom implementation and system `wc` command results
10+ *
11+ * Example usage:
12+ * ```
13+ * ./kotlin-shell.main.kts # Lists directory contents
14+ * ./kotlin-shell.main.kts file.txt # Counts lines, words, and characters in file.txt
15+ * ```
16+ *
17+ * Dependencies:
18+ * - kotlin-shell-core:0.2.1
19+ *
20+ * @param args - command line arguments. If provided, the first argument should be a file path
21+ */
22+
23+
324@file:DependsOn(" eu.jrie.jetbrains:kotlin-shell-core:0.2.1" )
425@file:CompilerOptions(" -Xopt-in=kotlin.RequiresOptIn" )
526@file:OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi ::class )
Original file line number Diff line number Diff line change 11#! / usr/ bin/ env kotlin
22
3+ /* *
4+ * A demonstration script showing HTML generation using kotlinx.html DSL.
5+ * This script creates and prints a simple HTML document with a "Hello, World!" heading.
6+ *
7+ * Usage:
8+ * - Run the script to generate HTML output
9+ * - No command line arguments needed
10+ *
11+ * Dependencies:
12+ * - kotlinx-html-jvm:0.8.0
13+ */
14+
315@file:DependsOn(" org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.0" )
416
517import kotlinx.html.*
@@ -12,4 +24,3 @@ print(createHTML().html {
1224 h1 { + " Hello, $addressee !" }
1325 }
1426})
15-
You can’t perform that action at this time.
0 commit comments