generated from Kotlin/multiplatform-library-template
-
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.
- Loading branch information
1 parent
97c9051
commit ea9ebe0
Showing
41 changed files
with
1,506 additions
and
78 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
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
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
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
6 changes: 3 additions & 3 deletions
6
kmp/src/jvmTest/kotlin/JVMPlatformTest.kt → kmp/src/jvmTest/kotlin/JvmPlatformTest.kt
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
12 changes: 12 additions & 0 deletions
12
kotlin-js-interop/js-to-kotlin/js-app/src/main/js/file-export.mjs
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,12 @@ | ||
function greet(name) { | ||
return "Hello, " + name + "!"; | ||
} | ||
|
||
function advocate(number) { | ||
return "Kotlin advocate nr: " + number; | ||
} | ||
|
||
exports = { | ||
greet, | ||
advocate | ||
} |
5 changes: 5 additions & 0 deletions
5
kotlin-js-interop/js-to-kotlin/js-app/src/main/js/func-export.mjs
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 @@ | ||
function defaultGreet(name) { | ||
return "Single default export: Hello, " + name + "!"; | ||
} | ||
|
||
export default defaultGreet; |
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,6 @@ | ||
import {advocate, greet} from "./file-export.mjs"; | ||
import defaultGreet from "./func-export.mjs"; | ||
|
||
console.log(greet("Kotlin")); | ||
console.log(advocate(1)); | ||
console.log(defaultGreet("Kotlin")); |
11 changes: 11 additions & 0 deletions
11
kotlin-js-interop/js-to-kotlin/js-app/src/main/package.json
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 @@ | ||
{ | ||
"name": "main", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
36 changes: 36 additions & 0 deletions
36
kotlin-js-interop/js-to-kotlin/kotlin-app/build.gradle.kts
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,36 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
applyDefaultHierarchyTemplate() | ||
js(compiler = IR) { | ||
// Explicitly instructs the Kotlin compiler to emit executable .js files, | ||
// required when using IR compiler | ||
binaries.executable() | ||
nodejs { | ||
|
||
} | ||
// useCommonJs() | ||
useEsModules() | ||
} | ||
|
||
sourceSets { | ||
jsMain { | ||
dependencies { | ||
implementation(kotlin("stdlib-js")) | ||
implementation(npm("randomstring", "1.3.0")) | ||
implementation(npm("is-sorted", "1.0.5")) | ||
} | ||
} | ||
jsTest { | ||
dependencies { | ||
implementation(kotlin("test-js")) | ||
} | ||
} | ||
} | ||
} |
Binary file added
BIN
+60.1 KB
kotlin-js-interop/js-to-kotlin/kotlin-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
kotlin-js-interop/js-to-kotlin/kotlin-app/gradle/wrapper/gradle-wrapper.properties
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,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.