diff --git a/.gitignore b/.gitignore index 1808834..c6b13e4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ lib/bld/** !lib/bld/bld-wrapper.properties lib/compile/ lib/runtime/ +lib/provided/ lib/standalone/ lib/test/ diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 0dd4b35..54d38d2 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,13 @@ + + + - \ No newline at end of file + diff --git a/LICENSE.txt b/LICENSE.txt index c27baae..09fec20 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2019-2023, Erik C. Thauvin (erik@thauvin.net) +Copyright (c) 2019-2024, Erik C. Thauvin (erik@thauvin.net) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index c19ce47..9e41b8e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause) -[![Kotlin](https://img.shields.io/badge/kotlin-1.9.24-7f52ff)](https://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin-2.0.0-7f52ff)](https://kotlinlang.org/) [![bld](https://img.shields.io/badge/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://img.shields.io/github/release/ethauvin/akismet-kotlin.svg)](https://github.com/ethauvin/akismet-kotlin/releases/latest) [![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/akismet-kotlin?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/akismet-kotlin/) @@ -100,7 +100,7 @@ AkismetComment(request = context.getRequest()) This will ensure that the user's IP, agent, referrer and various environment variables are automatically extracted from the request. -[View Full Example](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/src/main/kotlin/com/example/AkismetServlet.kt) +[View Full Example](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/gradle/src/main/kotlin/com/example/AkismetServlet.kt) ## JSON diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties index 113b890..b32aeb6 100644 --- a/examples/bld/lib/bld/bld-wrapper.properties +++ b/examples/bld/lib/bld/bld-wrapper.properties @@ -1,6 +1,6 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.4 +bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.7 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.sourceDirectories= diff --git a/examples/gradle/build.gradle.kts b/examples/gradle/build.gradle.kts index 253829e..b9c5436 100644 --- a/examples/gradle/build.gradle.kts +++ b/examples/gradle/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("application") id("com.github.ben-manes.versions") version "0.51.0" - kotlin("jvm") version "1.9.24" + kotlin("jvm") version "2.0.0" } defaultTasks(ApplicationPlugin.TASK_RUN_NAME) diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 1d72b47..1267563 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -3,7 +3,7 @@ bld.downloadExtensionSources=true bld.extensions-detekt=com.uwyn.rife2:bld-detekt:0.9.2 bld.extensions=com.uwyn.rife2:bld-generated-version:0.9.5 bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5 -bld.extensions-kotlin=com.uwyn.rife2:bld-kotlin:0.9.4 +bld.extensions-kotlin=com.uwyn.rife2:bld-kotlin:0.9.7 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.sourceDirectories= diff --git a/lib/provided/kotlin-serialization-compiler-plugin-1.9.24-sources.jar b/lib/provided/kotlin-serialization-compiler-plugin-1.9.24-sources.jar deleted file mode 100644 index 15ef69b..0000000 Binary files a/lib/provided/kotlin-serialization-compiler-plugin-1.9.24-sources.jar and /dev/null differ diff --git a/lib/provided/kotlin-serialization-compiler-plugin-1.9.24.jar b/lib/provided/kotlin-serialization-compiler-plugin-1.9.24.jar deleted file mode 100644 index a710db5..0000000 Binary files a/lib/provided/kotlin-serialization-compiler-plugin-1.9.24.jar and /dev/null differ diff --git a/src/bld/java/net/thauvin/erik/AkismetBuild.java b/src/bld/java/net/thauvin/erik/AkismetBuild.java index 82c312e..2f7d983 100644 --- a/src/bld/java/net/thauvin/erik/AkismetBuild.java +++ b/src/bld/java/net/thauvin/erik/AkismetBuild.java @@ -1,7 +1,7 @@ /* * AkismetBuild.java * - * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * Copyright 2019-2024 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -53,6 +53,7 @@ import static rife.bld.dependencies.Repository.*; import static rife.bld.dependencies.Scope.*; public class AkismetBuild extends Project { + private static final String DETEKT_BASELINE = "config/detekt/baseline.xml"; final File srcMainKotlin = new File(srcMainDirectory(), "kotlin"); public AkismetBuild() { @@ -66,7 +67,7 @@ public class AkismetBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); var okHttp = version(4, 12, 0); - final var kotlin = version(1, 9, 24); + final var kotlin = version(2, 0, 0); scope(compile) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("com.squareup.okhttp3", "okhttp", okHttp)) @@ -76,7 +77,7 @@ public class AkismetBuild extends Project { scope(provided) .include(dependency("org.jetbrains.kotlin", "kotlin-serialization-compiler-plugin", kotlin)); scope(test) - .include(dependency("org.mockito", "mockito-core", version(5, 11, 0))) + .include(dependency("org.mockito", "mockito-core", version(5, 12, 0))) .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin)) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2))) @@ -144,7 +145,7 @@ public class AkismetBuild extends Project { public void detekt() throws ExitStatusException, IOException, InterruptedException { new DetektOperation() .fromProject(this) - .baseline("config/detekt/baseline.xml") + .baseline(DETEKT_BASELINE) .execute(); } @@ -152,7 +153,7 @@ public class AkismetBuild extends Project { public void detektBaseline() throws ExitStatusException, IOException, InterruptedException { new DetektOperation() .fromProject(this) - .baseline("config/detekt/baseline.xml") + .baseline(DETEKT_BASELINE) .createBaseline(true) .execute(); } diff --git a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt index 8311f88..2c34032 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt @@ -1,7 +1,7 @@ /* * Akismet.kt * - * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * Copyright 2019-2024 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt b/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt index c7ae7af..dbfcc1c 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt @@ -1,7 +1,7 @@ /* * AkismetComment.kt * - * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * Copyright 2019-2024 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt b/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt index 8f63ec2..bc2ee49 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt @@ -1,3 +1,34 @@ +/* + * GeneratedVersion.kt + * + * Copyright 2019-2024 Erik C. Thauvin (erik@thauvin.net) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of this project nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /* * This file is automatically generated. * Do not modify! -- ALL CHANGES WILL BE ERASED! diff --git a/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt b/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt index 2d9cb80..31f3376 100644 --- a/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt +++ b/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt @@ -1,7 +1,7 @@ /* * AkismetTest.kt * - * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * Copyright 2019-2024 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: