diff --git a/README.md b/README.md index 25afc300..5055c3b4 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ See the [Javadoc](https://javadoc.io/doc/com.jeffpdavidson.kotwords/kotwords) fo Kotwords is a standard Gradle project that can be imported into IntelliJ. Common commands include: * Run all tests for all environments: `./gradlew check` -* Run a local instance of the web tools: `./gradlew jsRun` +* Run a local instance of the web tools: `./gradlew jsBrowserDevelopmentRun` * Publish to the local Maven repository for testing in another application: `./gradlew publishToMavenLocal` Bug reports and contributions welcome! diff --git a/build.gradle.kts b/build.gradle.kts index 07001c56..d3bc6941 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,15 +1,16 @@ import com.vanniktech.maven.publish.JavadocJar import com.vanniktech.maven.publish.KotlinMultiplatform +import com.vanniktech.maven.publish.SourcesJar import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack plugins { - id("com.vanniktech.maven.publish") version "0.35.0" - id("org.jetbrains.dokka") version "2.0.0" - kotlin("multiplatform") version "2.0.21" - kotlin("plugin.serialization") version "2.0.21" + id("com.vanniktech.maven.publish") version "0.36.0" + id("org.jetbrains.dokka") version "2.1.0" + kotlin("multiplatform") version "2.3.10" + kotlin("plugin.serialization") version "2.3.10" } group = "com.jeffpdavidson.kotwords" @@ -27,7 +28,6 @@ java { @OptIn(ExperimentalKotlinGradlePluginApi::class) // for compilerOptions kotlin { jvm { - withJava() compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) } @@ -63,13 +63,13 @@ kotlin { val commonMain by getting { dependencies { - implementation("com.squareup.okio:okio:3.9.1") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3") + implementation("com.squareup.okio:okio:3.16.4") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0") implementation("net.mamoe.yamlkt:yamlkt:0.13.0") - implementation("io.github.pdvrieze.xmlutil:serialization:0.90.3") - implementation("com.github.ajalt.colormath:colormath:3.6.0") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") + implementation("io.github.pdvrieze.xmlutil:serialization:0.91.3") + implementation("com.github.ajalt.colormath:colormath:3.6.1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") // TODO: Migrate to kotlinx-datetime when it can be done without breaking ksoup. // Ensure any size hit to the JS bundle is acceptable. @@ -79,10 +79,9 @@ kotlin { val commonTest by getting { dependencies { - implementation("org.jetbrains.kotlin:kotlin-test-annotations-common") - implementation("org.jetbrains.kotlin:kotlin-test-common") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0") - implementation("io.github.pdvrieze.xmlutil:testutil:0.90.3") + implementation("org.jetbrains.kotlin:kotlin-test") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2") + implementation("io.github.pdvrieze.xmlutil:testutil:0.91.3") } languageSettings { @@ -98,10 +97,6 @@ kotlin { } val jvmTest by getting { - dependencies { - implementation("org.jetbrains.kotlin:kotlin-test-junit") - } - languageSettings { optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") } @@ -118,7 +113,6 @@ kotlin { val jsTest by getting { dependencies { - implementation("org.jetbrains.kotlin:kotlin-test-js") // TODO: Find out how to use newer versions - 4.x seems to use ES6 modules which are not handled // smoothly. Note also that PdfJs.kt and ImageComparator.kt will need updates. implementation(npm("pdfjs-dist", "3.11.174")) @@ -132,9 +126,9 @@ kotlin { val nativeMain by getting { dependencies { implementation("com.soywiz:korlibs-io:6.0.0") - implementation("com.fleeksoft.ksoup:ksoup:0.1.9") + implementation("com.fleeksoft.ksoup:ksoup:0.2.6") implementation("net.thauvin.erik.urlencoder:urlencoder-lib:1.6.0") - implementation("com.github.ajalt.clikt:clikt:5.0.1") + implementation("com.github.ajalt.clikt:clikt:5.1.0") } } } @@ -146,6 +140,7 @@ kotlin { tasks.withType { maxHeapSize = "2G" + useJUnitPlatform() } dokka { @@ -171,7 +166,7 @@ tasks { mavenPublishing { configure(KotlinMultiplatform( javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"), - sourcesJar = true, + sourcesJar = SourcesJar.Sources(), )) publishToMavenCentral() diff --git a/gradle.properties b/gradle.properties index 5697421b..1fb9df17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,2 @@ org.gradle.jvmargs=-Xmx2g -kotlin.native.ignoreDisabledTargets=true -# TODO: Remove this once it's the default in Dokka 2.1. -org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled -org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true -# TODO: Figure out if/why this is needed on GitHub Actions builds. -kotlin.native.cacheKind.linuxX64=none \ No newline at end of file +kotlin.native.ignoreDisabledTargets=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b1..37f78a6a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/Pdf.kt b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/Pdf.kt index ba011eac..a1694d03 100644 --- a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/Pdf.kt +++ b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/Pdf.kt @@ -566,7 +566,7 @@ object Pdf { var currentFormat: Format? = null text.forEach { formattedChar -> if (currentFormat != null && currentFormat != formattedChar.format) { - fn(currentString.toString(), currentFormat!!) + fn(currentString.toString(), currentFormat) currentString.clear() } currentString.append(formattedChar.char) diff --git a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/PuzzleMe.kt b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/PuzzleMe.kt index d84ec2fc..dd276da1 100644 --- a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/PuzzleMe.kt +++ b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/PuzzleMe.kt @@ -133,10 +133,10 @@ class PuzzleMe(val json: String) : DelegatingPuzzleable() { } row.add( Puzzle.Cell( - solution = if (isPrefilled && box!! == "*") { + solution = if (isPrefilled && box == "*") { "" } else { - box!! + box }, cellType = if (isPrefilled) Puzzle.CellType.CLUE else Puzzle.CellType.REGULAR, backgroundShape = backgroundShape, diff --git a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/model/HelterSkelter.kt b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/model/HelterSkelter.kt index 6a7f66dd..650ba988 100644 --- a/src/commonMain/kotlin/com/jeffpdavidson/kotwords/model/HelterSkelter.kt +++ b/src/commonMain/kotlin/com/jeffpdavidson/kotwords/model/HelterSkelter.kt @@ -113,7 +113,7 @@ data class HelterSkelter( } } require(foundVector != null) { "Could not find answer $answer in grid" } - foundVectors.add(foundVector!!) + foundVectors.add(foundVector) } return foundVectors.toList() } diff --git a/src/jsMain/kotlin/com/jeffpdavidson/kotwords/web/html/FormFields.kt b/src/jsMain/kotlin/com/jeffpdavidson/kotwords/web/html/FormFields.kt index dddd50d6..51abb5a4 100644 --- a/src/jsMain/kotlin/com/jeffpdavidson/kotwords/web/html/FormFields.kt +++ b/src/jsMain/kotlin/com/jeffpdavidson/kotwords/web/html/FormFields.kt @@ -366,7 +366,6 @@ internal object FormFields { * @param options the options to show in the menu * @param help optional help text used to describe the field in more detail * @param flexCols optional number of columns this field should take up in the parent container. - * @param block optional block run in the scope of the [SELECT] tag for further customization. */ fun render( parent: FlowContent, label: String, options: List, help: String = "", flexCols: Int? = null