Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
41 changes: 18 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -27,7 +28,6 @@ java {
@OptIn(ExperimentalKotlinGradlePluginApi::class) // for compilerOptions
kotlin {
jvm {
withJava()
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
Expand Down Expand Up @@ -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.
Expand All @@ -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 {
Expand All @@ -98,10 +97,6 @@ kotlin {
}

val jvmTest by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-test-junit")
}

languageSettings {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
Expand All @@ -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"))
Expand All @@ -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")
}
}
}
Expand All @@ -146,6 +140,7 @@ kotlin {

tasks.withType<Test> {
maxHeapSize = "2G"
useJUnitPlatform()
}

dokka {
Expand All @@ -171,7 +166,7 @@ tasks {
mavenPublishing {
configure(KotlinMultiplatform(
javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"),
sourcesJar = true,
sourcesJar = SourcesJar.Sources(),
))

publishToMavenCentral()
Expand Down
7 changes: 1 addition & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
kotlin.native.ignoreDisabledTargets=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, help: String = "", flexCols: Int? = null
Expand Down