Migrate to com.vanniktech.maven.publish publish plugin, update gradle, publish to maven central.
This commit is contained in:
@@ -10,51 +10,60 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
version = "1.2.5-SNAPSHOT"
|
version = "1.2.5"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
tasks.withType<Test>(Test::class.java) {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
js {
|
js {
|
||||||
browser {
|
browser {
|
||||||
testTask {
|
testTask {
|
||||||
useKarma {
|
useKarma {
|
||||||
useChromiumHeadless()
|
useChromeHeadless()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/* wasmJs {
|
||||||
wasmJs {
|
//moduleName = project.name
|
||||||
//moduleName = project.name
|
browser()
|
||||||
browser()
|
|
||||||
|
|
||||||
mavenPublication {
|
mavenPublication {
|
||||||
groupId = group as String
|
groupId = group as String
|
||||||
pom { name = "${project.name}-wasm-js" }
|
pom { name = "${project.name}-wasm-js" }
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||||
applyDefaultHierarchyTemplate {
|
applyDefaultHierarchyTemplate {
|
||||||
common {
|
common {
|
||||||
group("jsCommon") {
|
group("jsCommon") {
|
||||||
withJs()
|
withJs()
|
||||||
// TODO: switch to `withWasmJs()` after upgrade to Kotlin 2.0
|
// TODO: switch to `withWasmJs()` after upgrade to Kotlin 2.0
|
||||||
withWasm()
|
withWasm()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
*/
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
val commonMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("org.jetbrains.kotlinx:kotlinx-html:0.11.0")
|
api("org.jetbrains.kotlinx:kotlinx-html:0.12.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val commonTest by getting {
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("test"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val jsMain by getting
|
val jsMain by getting
|
||||||
@@ -128,8 +137,8 @@ publishing {
|
|||||||
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
|
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
|
||||||
|
|
||||||
credentials() {
|
credentials() {
|
||||||
val giteaUsername: kotlin.String? by project
|
val giteaUsername: String? by project
|
||||||
val giteaPassword: kotlin.String? by project
|
val giteaPassword: String? by project
|
||||||
|
|
||||||
username = giteaUsername
|
username = giteaUsername
|
||||||
password = giteaPassword
|
password = giteaPassword
|
||||||
@@ -175,3 +184,7 @@ tasks.withType<AbstractPublishToMaven> {
|
|||||||
signing {
|
signing {
|
||||||
sign(publishing.publications)
|
sign(publishing.publications)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<PublishToMavenRepository> {
|
||||||
|
dependsOn(tasks.withType<Sign>())
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ interface HtmlConsumer : TagConsumer<Element> {
|
|||||||
fun FlowOrMetaDataOrPhrasingContent.currentElement(): Element =
|
fun FlowOrMetaDataOrPhrasingContent.currentElement(): Element =
|
||||||
currentElement ?: error("No current element defined!")
|
currentElement ?: error("No current element defined!")
|
||||||
|
|
||||||
private fun Node.asElement() = this as? HTMLElement
|
private fun Node?.asElement() = this as? HTMLElement
|
||||||
|
|
||||||
class HtmlBuilder(
|
class HtmlBuilder(
|
||||||
private val komponent: Komponent?,
|
private val komponent: Komponent?,
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ abstract class Komponent {
|
|||||||
private var scheduledForUpdate = mutableSetOf<Komponent>()
|
private var scheduledForUpdate = mutableSetOf<Komponent>()
|
||||||
private var interceptor: (Komponent, () -> Unit) -> Unit = { _, block -> block() }
|
private var interceptor: (Komponent, () -> Unit) -> Unit = { _, block -> block() }
|
||||||
|
|
||||||
|
var logUpdateEvent = false
|
||||||
var logRenderEvent = false
|
var logRenderEvent = false
|
||||||
var logReplaceEvent = false
|
var logReplaceEvent = false
|
||||||
var enableAssertions = false
|
var enableAssertions = false
|
||||||
@@ -244,6 +245,9 @@ abstract class Komponent {
|
|||||||
val memoizeHash = next.generateMemoizeHash()
|
val memoizeHash = next.generateMemoizeHash()
|
||||||
|
|
||||||
if (next.memoizeChanged()) {
|
if (next.memoizeChanged()) {
|
||||||
|
if (logUpdateEvent) {
|
||||||
|
console.log("Rendering", next)
|
||||||
|
}
|
||||||
next.onBeforeUpdate()
|
next.onBeforeUpdate()
|
||||||
next.renderUpdate()
|
next.renderUpdate()
|
||||||
next.updateMemoizeHash()
|
next.updateMemoizeHash()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package nl.astraeus.komp
|
package nl.astraeus.komp
|
||||||
|
|
||||||
import kotlinx.browser.document
|
import kotlinx.browser.document
|
||||||
import kotlinx.html.DIV
|
|
||||||
import kotlinx.html.InputType
|
import kotlinx.html.InputType
|
||||||
import kotlinx.html.classes
|
import kotlinx.html.classes
|
||||||
import kotlinx.html.div
|
import kotlinx.html.div
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package nl.astraeus.komp
|
package nl.astraeus.komp
|
||||||
|
|
||||||
import org.w3c.dom.AddEventListenerOptions
|
|
||||||
import org.w3c.dom.events.Event
|
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
import org.w3c.dom.HTMLInputElement
|
import org.w3c.dom.HTMLInputElement
|
||||||
import org.w3c.dom.events.EventListener
|
import org.w3c.dom.events.Event
|
||||||
import org.w3c.dom.get
|
import org.w3c.dom.get
|
||||||
|
|
||||||
private fun Int.asSpaces(): String {
|
private fun Int.asSpaces(): String {
|
||||||
|
|||||||
Reference in New Issue
Block a user