From 9e243a469ae6544e8cf523ad09b959f541c3f565 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Wed, 11 Mar 2020 16:18:17 +0100 Subject: Upgrade to Kotlin 1.3.70 + other dependencies (Coroutinse, Serialization, Spring Boot) Major refactoring of build architecture. --- kvision-modules/kvision-event-flow/build.gradle | 5 --- .../kvision-event-flow/build.gradle.kts | 43 ++++++++++++++++++++++ .../kvision-event-flow/package.json.d/project.info | 3 -- .../kotlin/pl/treksoft/kvision/event/EventFlow.kt | 8 ++-- .../webpack.config.d/bootstrap.js | 3 ++ .../kvision-event-flow/webpack.config.d/file.js | 9 +++++ 6 files changed, 59 insertions(+), 12 deletions(-) delete mode 100644 kvision-modules/kvision-event-flow/build.gradle create mode 100644 kvision-modules/kvision-event-flow/build.gradle.kts delete mode 100644 kvision-modules/kvision-event-flow/package.json.d/project.info create mode 100644 kvision-modules/kvision-event-flow/webpack.config.d/bootstrap.js create mode 100644 kvision-modules/kvision-event-flow/webpack.config.d/file.js (limited to 'kvision-modules/kvision-event-flow') diff --git a/kvision-modules/kvision-event-flow/build.gradle b/kvision-modules/kvision-event-flow/build.gradle deleted file mode 100644 index 4aaef76d..00000000 --- a/kvision-modules/kvision-event-flow/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -apply from: "../shared.gradle" - -dependencies { - compile "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutinesVersion" -} diff --git a/kvision-modules/kvision-event-flow/build.gradle.kts b/kvision-modules/kvision-event-flow/build.gradle.kts new file mode 100644 index 00000000..f31fb11e --- /dev/null +++ b/kvision-modules/kvision-event-flow/build.gradle.kts @@ -0,0 +1,43 @@ +buildscript { + extra.set("production", (findProperty("prod") ?: findProperty("production") ?: "false") == "true") +} + +plugins { + kotlin("js") + id("maven-publish") +} + +repositories() + +// Versions +val coroutinesVersion: String by project + +kotlin { + kotlinJsTargets() +} + +dependencies { + implementation(kotlin("stdlib-js")) + api(rootProject) + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutinesVersion") + testImplementation(kotlin("test-js")) +} + +val sourcesJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(kotlin.sourceSets.main.get().kotlin) +} + +publishing { + publications { + create("kotlin") { + from(components["kotlin"]) + artifact(tasks["sourcesJar"]) + pom { + defaultPom() + } + } + } +} + +setupPublication() diff --git a/kvision-modules/kvision-event-flow/package.json.d/project.info b/kvision-modules/kvision-event-flow/package.json.d/project.info deleted file mode 100644 index f9d34fd1..00000000 --- a/kvision-modules/kvision-event-flow/package.json.d/project.info +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "KVision event flow module" -} diff --git a/kvision-modules/kvision-event-flow/src/main/kotlin/pl/treksoft/kvision/event/EventFlow.kt b/kvision-modules/kvision-event-flow/src/main/kotlin/pl/treksoft/kvision/event/EventFlow.kt index 3a93d2a5..f9556e62 100644 --- a/kvision-modules/kvision-event-flow/src/main/kotlin/pl/treksoft/kvision/event/EventFlow.kt +++ b/kvision-modules/kvision-event-flow/src/main/kotlin/pl/treksoft/kvision/event/EventFlow.kt @@ -29,7 +29,7 @@ import org.w3c.dom.events.Event import pl.treksoft.kvision.core.Widget import pl.treksoft.kvision.core.onEvent -@UseExperimental(ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) inline fun T.eventFlow(event: String): Flow> = callbackFlow { val id = onEvent { this.asDynamic()[event] = { e: Event -> @@ -41,7 +41,7 @@ inline fun T.eventFlow(event: String): Flow> } } -@UseExperimental(ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) inline val T.clickFlow: Flow get() = callbackFlow { val id = onEvent { @@ -54,7 +54,7 @@ inline val T.clickFlow: Flow } } -@UseExperimental(ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) inline val T.inputFlow: Flow get() = callbackFlow { val id = onEvent { @@ -67,7 +67,7 @@ inline val T.inputFlow: Flow } } -@UseExperimental(ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) inline val T.changeFlow: Flow get() = callbackFlow { val id = onEvent { diff --git a/kvision-modules/kvision-event-flow/webpack.config.d/bootstrap.js b/kvision-modules/kvision-event-flow/webpack.config.d/bootstrap.js new file mode 100644 index 00000000..35b28e6a --- /dev/null +++ b/kvision-modules/kvision-event-flow/webpack.config.d/bootstrap.js @@ -0,0 +1,3 @@ +config.module.rules.push({test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'}); +config.module.rules.push({test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream'}); +config.module.rules.push({test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'}); diff --git a/kvision-modules/kvision-event-flow/webpack.config.d/file.js b/kvision-modules/kvision-event-flow/webpack.config.d/file.js new file mode 100644 index 00000000..653ca21f --- /dev/null +++ b/kvision-modules/kvision-event-flow/webpack.config.d/file.js @@ -0,0 +1,9 @@ +config.module.rules.push( + { + test: /\.(jpe?g|png|gif|svg)$/i, + loader: 'file-loader', + options: { + esModule: false, + }, + } +); -- cgit