diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 54d38d2..86ebe4c 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,13 +1,18 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml
index a2969be..2fb5ff0 100644
--- a/.idea/libraries/bld.xml
+++ b/.idea/libraries/bld.xml
@@ -2,12 +2,12 @@
-
+
-
+
diff --git a/examples/bld/.idea/runConfigurations/Run Tests.xml b/examples/bld/.idea/runConfigurations/Run Tests.xml
deleted file mode 100644
index 2b503e5..0000000
--- a/examples/bld/.idea/runConfigurations/Run Tests.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/lib/bld/bld-wrapper.jar b/examples/bld/lib/bld/bld-wrapper.jar
index 6012eef..a56ed93 100644
Binary files a/examples/bld/lib/bld/bld-wrapper.jar and b/examples/bld/lib/bld/bld-wrapper.jar differ
diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties
index 8c08ccc..d3f0a91 100644
--- a/examples/bld/lib/bld/bld-wrapper.properties
+++ b/examples/bld/lib/bld/bld-wrapper.properties
@@ -1,7 +1,8 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
-bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.8
-bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
+bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT
+bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT
+bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=1.9.1
diff --git a/examples/bld/src/bld/java/com/example/ExampleBuild.java b/examples/bld/src/bld/java/com/example/ExampleBuild.java
index ff74303..9e11c5b 100644
--- a/examples/bld/src/bld/java/com/example/ExampleBuild.java
+++ b/examples/bld/src/bld/java/com/example/ExampleBuild.java
@@ -25,7 +25,7 @@ public class ExampleBuild extends BaseProject {
scope(compile)
.include(dependency("net.thauvin.erik:akismet-kotlin:1.1.0-SNAPSHOT"))
- .include(dependency("jakarta.servlet:jakarta.servlet-api:6.0.0"));
+ .include(dependency("jakarta.servlet:jakarta.servlet-api:6.1.0"));
}
public static void main(String[] args) {
diff --git a/examples/gradle/.idea/gradle.xml b/examples/gradle/.idea/gradle.xml
index 7d3b3e8..ce1c62c 100644
--- a/examples/gradle/.idea/gradle.xml
+++ b/examples/gradle/.idea/gradle.xml
@@ -5,7 +5,6 @@
-
diff --git a/examples/gradle/build.gradle.kts b/examples/gradle/build.gradle.kts
index 924f9ac..b31c97b 100644
--- a/examples/gradle/build.gradle.kts
+++ b/examples/gradle/build.gradle.kts
@@ -12,7 +12,7 @@ repositories {
}
dependencies {
- implementation("jakarta.servlet:jakarta.servlet-api:6.0.0")
+ implementation("jakarta.servlet:jakarta.servlet-api:6.1.0")
implementation("net.thauvin.erik:akismet-kotlin:1.1.0-SNAPSHOT")
}
diff --git a/examples/gradle/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/gradle/wrapper/gradle-wrapper.jar
index e644113..2c35211 100644
Binary files a/examples/gradle/gradle/wrapper/gradle-wrapper.jar and b/examples/gradle/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/gradle/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/gradle/wrapper/gradle-wrapper.properties
index b82aa23..09523c0 100644
--- a/examples/gradle/gradle/wrapper/gradle-wrapper.properties
+++ b/examples/gradle/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/examples/gradle/gradlew b/examples/gradle/gradlew
index 1aa94a4..f5feea6 100755
--- a/examples/gradle/gradlew
+++ b/examples/gradle/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
+' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
diff --git a/examples/gradle/gradlew.bat b/examples/gradle/gradlew.bat
index 25da30d..9d21a21 100644
--- a/examples/gradle/gradlew.bat
+++ b/examples/gradle/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
index d3c99e9..df1100d 100644
Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
index a1e2c45..3bc38e2 100644
--- a/lib/bld/bld-wrapper.properties
+++ b/lib/bld/bld-wrapper.properties
@@ -1,10 +1,11 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
-bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
-bld.extensions-kotlin=com.uwyn.rife2:bld-kotlin:0.9.8
-bld.extensions-detekt=com.uwyn.rife2:bld-detekt:0.9.4
-bld.extensions=com.uwyn.rife2:bld-generated-version:0.9.6
-bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
+bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4
+#bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT
+bld.extension-gv=com.uwyn.rife2:bld-generated-version:0.9.8-SNAPSHOT
+bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6
+bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT
+bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
-bld.version=1.9.1
+bld.version=2.0.0-SNAPSHOT
diff --git a/src/bld/java/net/thauvin/erik/AkismetBuild.java b/src/bld/java/net/thauvin/erik/AkismetBuild.java
index db01101..8037618 100644
--- a/src/bld/java/net/thauvin/erik/AkismetBuild.java
+++ b/src/bld/java/net/thauvin/erik/AkismetBuild.java
@@ -33,11 +33,11 @@ package net.thauvin.erik;
import rife.bld.BuildCommand;
import rife.bld.Project;
-import rife.bld.extension.*;
-import rife.bld.extension.dokka.DokkaOperation;
-import rife.bld.extension.dokka.LoggingLevel;
-import rife.bld.extension.dokka.OutputFormat;
-import rife.bld.extension.dokka.SourceSet;
+import rife.bld.extension.CompileKotlinOperation;
+import rife.bld.extension.DetektOperation;
+import rife.bld.extension.GeneratedVersionOperation;
+import rife.bld.extension.JacocoReportOperation;
+import rife.bld.extension.kotlin.CompilerPlugin;
import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder;
import rife.bld.publish.PublishDeveloper;
@@ -48,6 +48,9 @@ import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File;
import java.io.IOException;
import java.util.List;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.*;
@@ -62,25 +65,27 @@ public class AkismetBuild extends Project {
version = version(1, 1, 0, "SNAPSHOT");
javaRelease = 11;
+
downloadSources = true;
autoDownloadPurge = true;
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("org.jetbrains.kotlin", "kotlin-stdlib-jdk7", kotlin))
+ .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin))
.include(dependency("com.squareup.okhttp3", "okhttp", okHttp))
.include(dependency("com.squareup.okhttp3", "logging-interceptor", okHttp))
- .include(dependency("org.jetbrains.kotlinx", "kotlinx-serialization-json-jvm", version(1, 6, 3)));
+ .include(dependency("org.jetbrains.kotlinx", "kotlinx-serialization-json", version(1, 7, 1)));
scope(provided)
- .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 0, 0)))
- .include(dependency("org.jetbrains.kotlin", "kotlin-serialization-compiler-plugin", kotlin));
+ .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 1, 0)));
scope(test)
.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)))
+ .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3)))
+ .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3)))
.include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1)));
publishOperation()
@@ -119,26 +124,27 @@ public class AkismetBuild extends Project {
public static void main(String[] args) {
// Enable detailed logging for the Kotlin extension
- // var level = Level.ALL;
- // var logger = Logger.getLogger("rife.bld.extension");
- // var consoleHandler = new ConsoleHandler();
+ var level = Level.ALL;
+ var logger = Logger.getLogger("rife.bld.extension");
+ var consoleHandler = new ConsoleHandler();
- // consoleHandler.setLevel(level);
- // logger.addHandler(consoleHandler);
- // logger.setLevel(level);
- // logger.setUseParentHandlers(false);
+ consoleHandler.setLevel(level);
+ logger.addHandler(consoleHandler);
+ logger.setLevel(level);
+ logger.setUseParentHandlers(false);
new AkismetBuild().start(args);
}
@BuildCommand(summary = "Compiles the Kotlin project")
@Override
- public void compile() throws IOException {
+ public void compile() throws Exception {
genver();
- new CompileKotlinOperation()
+ var op = new CompileKotlinOperation()
.fromProject(this)
- .plugins(libProvidedDirectory(), CompileKotlinPlugin.KOTLIN_SERIALIZATION)
- .execute();
+ .plugins(CompilerPlugin.KOTLIN_SERIALIZATION);
+ op.compileOptions().verbose(true);
+ op.execute();
}
@BuildCommand(summary = "Checks source with Detekt")
@@ -158,63 +164,69 @@ public class AkismetBuild extends Project {
.execute();
}
- @BuildCommand(summary = "Generates documentation in HTML format")
- public void docs() throws ExitStatusException, IOException, InterruptedException {
- new DokkaOperation()
- .fromProject(this)
- .loggingLevel(LoggingLevel.INFO)
- .moduleName("Akismet Kotlin")
- .moduleVersion(version.toString())
- .outputDir("docs")
- .outputFormat(OutputFormat.HTML)
- .sourceSet(
- new SourceSet()
- .src(srcMainKotlin.getAbsolutePath())
- .classpath(compileClasspathJars())
- .classpath(providedClasspathJars())
- .srcLink(srcMainKotlin.getAbsolutePath(), "https://github.com/ethauvin/" + name
- + "/tree/master/src/main/kotlin/", "#L")
- .includes("config/dokka/packages.md")
- .jdkVersion(javaRelease)
- .externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
- "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
-
- )
- .execute();
- }
+// @BuildCommand(summary = "Generates documentation in HTML format")
+// public void docs() throws ExitStatusException, IOException, InterruptedException {
+// new DokkaOperation()
+// .fromProject(this)
+// .loggingLevel(LoggingLevel.INFO)
+// .moduleName("Akismet Kotlin")
+// .moduleVersion(version.toString())
+// .outputDir("docs")
+// .outputFormat(OutputFormat.HTML)
+// .sourceSet(
+// new SourceSet()
+// .src(srcMainKotlin)
+// .classpath(compileClasspathJars())
+// .classpath(providedClasspathJars())
+// .srcLink(srcMainKotlin, "https://github.com/ethauvin/" + name
+// + "/tree/master/src/main/kotlin/", "#L")
+// .includes("config/dokka/packages.md")
+// .jdkVersion(javaRelease)
+// .externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
+// "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
+//
+// )
+// .execute();
+// }
@BuildCommand(summary = "Generates version class")
- public void genver() {
+ public void genver() throws Exception {
new GeneratedVersionOperation()
.fromProject(this)
.projectName("Akismet Kotlin")
.packageName(pkg + ".akismet")
- .classTemplate(new File(workDirectory(), "version.txt"))
+ .classTemplate("version.txt")
.directory(srcMainKotlin)
.extension(".kt")
.execute();
}
@BuildCommand(summary = "Generates JaCoCo Reports")
- public void jacoco() throws IOException {
+ public void jacoco() throws Exception {
new JacocoReportOperation()
.fromProject(this)
.sourceFiles(srcMainKotlin)
.execute();
}
- @Override
- public void javadoc() throws ExitStatusException, IOException, InterruptedException {
- new DokkaOperation()
- .fromProject(this)
- .loggingLevel(LoggingLevel.INFO)
- .moduleName("Bitly Shorten")
- .moduleVersion(version.toString())
- .outputDir(new File(buildDirectory(), "javadoc"))
- .outputFormat(OutputFormat.JAVADOC)
- .globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
- "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
- .execute();
+// @Override
+// public void javadoc() throws ExitStatusException, IOException, InterruptedException {
+// new DokkaOperation()
+// .fromProject(this)
+// .loggingLevel(LoggingLevel.INFO)
+// .moduleName("Bitly Shorten")
+// .moduleVersion(version.toString())
+// .outputDir(new File(buildDirectory(), "javadoc"))
+// .outputFormat(OutputFormat.JAVADOC)
+// .globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
+// "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
+// .execute();
+// }
+
+ @BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
+ public void pomRoot() throws FileUtilsErrorException {
+ PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
+ new File(workDirectory, "pom.xml"));
}
@Override
@@ -222,10 +234,4 @@ public class AkismetBuild extends Project {
super.publish();
pomRoot();
}
-
- @BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
- public void pomRoot() throws FileUtilsErrorException {
- PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
- new File(workDirectory, "pom.xml"));
- }
}
diff --git a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt
index 6e2f93d..1824f45 100644
--- a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt
+++ b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt
@@ -61,7 +61,7 @@ open class Akismet(apiKey: String) {
*/
@JvmStatic
fun jsonComment(json: String): AkismetComment {
- return Json.decodeFromString(AkismetComment.serializer(), json)
+ return Json.decodeFromString(json)
}
/**
diff --git a/src/main/kotlin/net/thauvin/erik/akismet/CommentConfig.kt b/src/main/kotlin/net/thauvin/erik/akismet/CommentConfig.kt
index ff04fb9..53b9295 100644
--- a/src/main/kotlin/net/thauvin/erik/akismet/CommentConfig.kt
+++ b/src/main/kotlin/net/thauvin/erik/akismet/CommentConfig.kt
@@ -31,8 +31,6 @@
package net.thauvin.erik.akismet
-import net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE
-
/**
* Provides a comment configuration.
*/
@@ -169,7 +167,7 @@ class CommentConfig private constructor(builder: Builder) {
/**
* Set the user role of the user who submitted the comment. This is an optional parameter.
*
- * If you set it to [ADMIN_ROLE], Akismet will always return `false`.
+ * If you set it to [AkismetComment.ADMIN_ROLE], Akismet will always return `false`.
*/
fun userRole(userRole: String): Builder = apply { this.userRole = userRole }