Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 5c87327

Browse files
committed
add js sample
1 parent e6faf0b commit 5c87327

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
id("org.jetbrains.kotlin.js")
3+
}
4+
5+
group = "com.bennyhuo.kotlin.hello"
6+
version = "1.0-SNAPSHOT"
7+
8+
dependencies {
9+
implementation(kotlin("stdlib-js"))
10+
}
11+
12+
kotlin {
13+
js(IR) {
14+
nodejs {
15+
}
16+
binaries.executable()
17+
}
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.bennyhuo.kotlin.js
2+
3+
/**
4+
* Created by benny at 2021/6/26 8:36.
5+
*/
6+
fun main() {
7+
console.log("Hello Js")
8+
9+
val duration = Duration(10)
10+
println(duration)
11+
}
12+
13+
inline class Span(val value: Long)
14+
value class Duration(val value: Long)

code/Kotlin-Sample/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ rootProject.name = "Kotlin-Sample"
22

33
include(":opt-in-sample",":deprecated-sample")
44
include(":kotlin-android-sample")
5+
include("kotlin-js-sample")

0 commit comments

Comments
 (0)