Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Switch to js plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Nov 16, 2020
1 parent 9181933 commit 7ef3040
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
23 changes: 9 additions & 14 deletions projector-launcher/electronapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin

plugins {
kotlin("multiplatform")
kotlin("js")
}

val electronVersion: String by project
Expand All @@ -25,22 +25,17 @@ kotlin {
}
}
}
}

sourceSets {
val jsMain by getting {
kotlin.srcDir("src/main")
dependencies {
implementation(npm("electron", electronVersion))
implementation(npm("open", openVersion))
implementation("org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutinesVersion")
implementation("org.jetbrains:kotlin-extensions:$kotlinExtensionsVersion")
}
}
}
dependencies {
implementation(npm("electron", electronVersion))
implementation(npm("open", openVersion))
implementation("org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutinesVersion")
implementation("org.jetbrains:kotlin-extensions:$kotlinExtensionsVersion")
}

tasks.named("jsNodeTest") {
tasks.named("nodeTest") {
enabled = false
}

Expand Down
2 changes: 1 addition & 1 deletion projector-launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "npm run build && npm run run",
"build": "./gradlew build",
"run": "electron build/js/packages/projector-launcher-electronapp",
"gradle-node": "./gradlew -p electronapp jsNodeRun",
"gradle-node": "./gradlew -p electronapp nodeRun",
"packager": "electron-packager --executable-name=projector --out=./out --overwrite --icon=./electronapp/src/main/resources/assets/img/electron-icon.ico --all ./build/js/packages/projector-launcher-electronapp projector"
},
"keywords": [
Expand Down
10 changes: 1 addition & 9 deletions projector-launcher/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "kotlin2js") {
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
}
}
}

val kotlinVersion: String by settings

plugins {
kotlin("multiplatform") version kotlinVersion apply false
kotlin("js") version kotlinVersion apply false
}
}

Expand Down

0 comments on commit 7ef3040

Please sign in to comment.