Compare commits

..

4 commits

Author SHA1 Message Date
00641bab1a
1.1.0-SNAPSHOT 2024-09-19 18:31:55 -07:00
da280da5ac
Updated dependencies
Bumped Mockito to version 5.13.0
Bumpled JUnit to version 5.11.0
2024-09-19 18:29:21 -07:00
871174e64a
Bump Kotlin to version 2.0.20 2024-09-19 18:19:07 -07:00
fdd10f1399
Bumped bld to version 2.1.0 2024-09-19 18:16:58 -07:00
23 changed files with 74 additions and 73 deletions

View file

@ -21,7 +21,7 @@ commands:
- sdkman/setup-sdkman - sdkman/setup-sdkman
- sdkman/sdkman-install: - sdkman/sdkman-install:
candidate: kotlin candidate: kotlin
version: 2.0.0 version: 2.0.20
- run: - run:
name: Download dependencies name: Download dependencies
command: ./bld download command: ./bld download

View file

@ -2,19 +2,21 @@ name: bld-ci
on: [push, pull_request, workflow_dispatch] on: [push, pull_request, workflow_dispatch]
env:
AKISMET_API_KEY: ${{ secrets.AKISMET_API_KEY }}
AKISMET_BLOG: ${{ secrets.AKISMET_BLOG }}
COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.0.0"
KOTLIN_HOME: /usr/share/kotlinc
jobs: jobs:
build-bld-project: build-bld-project:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.0.0"
KOTLIN_HOME: /usr/share/kotlinc
strategy: strategy:
matrix: matrix:
java-version: [17, 21, 22] java-version: [17, 21, 22]
kotlin-version: [1.9.24, 2.0.0] kotlin-version: [1.9.24, 2.0.20]
steps: steps:
- name: Checkout source repository - name: Checkout source repository
@ -35,12 +37,10 @@ jobs:
run: ./bld compile run: ./bld compile
- name: Run tests - name: Run tests
env:
AKISMET_BLOG: ${{ secrets.AKISMET_BLOG }}
AKISMET_API_KEY: ${{ secrets.AKISMET_API_KEY }}
run: ./bld jacoco run: ./bld jacoco
- name: Remove pom.xml - name: Remove pom.xml
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
run: rm -rf pom.xml run: rm -rf pom.xml
- name: SonarCloud Scan - name: SonarCloud Scan

6
.idea/bld.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -2,12 +2,12 @@
<library name="bld"> <library name="bld">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,9 +9,9 @@
<root url="file://$PROJECT_DIR$/lib/compile" /> <root url="file://$PROJECT_DIR$/lib/compile" />
<root url="file://$PROJECT_DIR$/lib/provided" /> <root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -8,7 +8,7 @@
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" /> <root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -11,9 +11,9 @@
<root url="file://$PROJECT_DIR$/lib/test" /> <root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/lib/provided" /> <root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -1,6 +1,6 @@
[![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) [![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.20-7f52ff)](https://kotlinlang.org/)
[![bld](https://img.shields.io/badge/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![bld](https://img.shields.io/badge/2.1.0-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) [![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/) [![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/)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/akismet-kotlin.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/akismet-kotlin) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/akismet-kotlin.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/akismet-kotlin)

View file

@ -5,7 +5,6 @@
<ID>CyclomaticComplexMethod:Akismet.kt$Akismet$private fun buildFormBody(comment: AkismetComment): FormBody</ID> <ID>CyclomaticComplexMethod:Akismet.kt$Akismet$private fun buildFormBody(comment: AkismetComment): FormBody</ID>
<ID>CyclomaticComplexMethod:AkismetComment.kt$AkismetComment$@Suppress("DuplicatedCode") override fun equals(other: Any?): Boolean</ID> <ID>CyclomaticComplexMethod:AkismetComment.kt$AkismetComment$@Suppress("DuplicatedCode") override fun equals(other: Any?): Boolean</ID>
<ID>LongParameterList:AkismetServlet.kt$AkismetServlet$( id: String, name: String?, email: String?, date: String?, comment: String?, json: String, isSpam: Boolean )</ID> <ID>LongParameterList:AkismetServlet.kt$AkismetServlet$( id: String, name: String?, email: String?, date: String?, comment: String?, json: String, isSpam: Boolean )</ID>
<ID>LongParameterList:CommentConfig.kt$CommentConfig$( var userIp: String, var userAgent: String, var referrer: String = "", var permalink: String = "", var type: CommentType = CommentType.NONE, var author: String = "", var authorEmail: String = "", var authorUrl: String = "", var content: String = "", var dateGmt: String = "", var postModifiedGmt: String = "", var blogLang: String = "", var blogCharset: String = "", var userRole: String = "", var isTest: Boolean = false, var recheckReason: String = "", var serverEnv: Map&lt;String, String&gt; = emptyMap() )</ID>
<ID>MagicNumber:Akismet.kt$Akismet$12</ID> <ID>MagicNumber:Akismet.kt$Akismet$12</ID>
<ID>MagicNumber:Akismet.kt$Akismet$8</ID> <ID>MagicNumber:Akismet.kt$Akismet$8</ID>
<ID>NestedBlockDepth:Akismet.kt$Akismet$@JvmOverloads fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean</ID> <ID>NestedBlockDepth:Akismet.kt$Akismet$@JvmOverloads fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean</ID>

View file

@ -2,12 +2,12 @@
<library name="bld"> <library name="bld">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.9.1.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.9.1-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -7,7 +7,7 @@
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" /> <root url="file://$PROJECT_DIR$/lib/compile" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -8,7 +8,7 @@
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" /> <root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -8,7 +8,7 @@
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" /> <root url="file://$PROJECT_DIR$/lib/test" />
</SOURCES> </SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -9,7 +9,7 @@
], ],
"java.configuration.updateBuildConfiguration": "automatic", "java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [ "java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-1.9.1.jar", "${HOME}/.bld/dist/bld-2.1.0.jar",
"lib/**/*.jar" "lib/**/*.jar"
] ]
} }

Binary file not shown.

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=1.9.1 bld.version=2.1.0

View file

@ -1,7 +1,7 @@
plugins { plugins {
id("application") id("application")
id("com.github.ben-manes.versions") version "0.51.0" id("com.github.ben-manes.versions") version "0.51.0"
kotlin("jvm") version "2.0.0" kotlin("jvm") version "2.0.20"
} }
defaultTasks(ApplicationPlugin.TASK_RUN_NAME) defaultTasks(ApplicationPlugin.TASK_RUN_NAME)

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

Binary file not shown.

View file

@ -1,11 +1,11 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4 bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.7
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.1
bld.extension-gv=com.uwyn.rife2:bld-generated-version:0.9.8-SNAPSHOT bld.extension-gv=com.uwyn.rife2:bld-generated-version:0.9.9
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6 bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=2.0.0-SNAPSHOT bld.version=2.1.0

View file

@ -71,21 +71,21 @@ public class AkismetBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
var okHttp = version(4, 12, 0); var okHttp = version(4, 12, 0);
final var kotlin = version(2, 0, 0); final var kotlin = version(2, 0, 20);
scope(compile) scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk7", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk7", kotlin))
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin))
.include(dependency("com.squareup.okhttp3", "okhttp", okHttp)) .include(dependency("com.squareup.okhttp3", "okhttp", okHttp))
.include(dependency("com.squareup.okhttp3", "logging-interceptor", okHttp)) .include(dependency("com.squareup.okhttp3", "logging-interceptor", okHttp))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-serialization-json", version(1, 7, 1))); .include(dependency("org.jetbrains.kotlinx", "kotlinx-serialization-json", version(1, 7, 3)));
scope(provided) scope(provided)
.include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 1, 0))); .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 1, 0)));
scope(test) scope(test)
.include(dependency("org.mockito", "mockito-core", version(5, 12, 0))) .include(dependency("org.mockito", "mockito-core", version(5, 13, 0)))
.include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)))
.include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1))); .include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1)));
publishOperation() publishOperation()
@ -93,29 +93,25 @@ public class AkismetBuild extends Project {
.withCredentials(property("sonatype.user"), property("sonatype.password")) .withCredentials(property("sonatype.user"), property("sonatype.password"))
: repository(SONATYPE_RELEASES_LEGACY.location()) : repository(SONATYPE_RELEASES_LEGACY.location())
.withCredentials(property("sonatype.user"), property("sonatype.password"))) .withCredentials(property("sonatype.user"), property("sonatype.password")))
.repository(repository("github"))
.info() .info()
.groupId(pkg) .groupId(pkg)
.artifactId(name) .artifactId(name)
.description("A client library for accessing the Automattic Kismet (Akismet) spam comments filtering service.") .description("A client library for accessing the Automattic Kismet (Akismet) spam comments filtering service.")
.url("https://github.com/ethauvin/" + name) .url("https://github.com/ethauvin/" + name)
.developer( .developer(new PublishDeveloper()
new PublishDeveloper() .id("ethauvin")
.id("ethauvin") .name("Erik C. Thauvin")
.name("Erik C. Thauvin") .email("erik@thauvin.net")
.email("erik@thauvin.net") .url("https://erik.thauvin.net/")
.url("https://erik.thauvin.net/")
) )
.license( .license(new PublishLicense()
.name("BSD 3-Clause")
new PublishLicense() .url("https://opensource.org/licenses/BSD-3-Clause"))
.name("BSD 3-Clause") .scm(new PublishScm()
.url("https://opensource.org/licenses/BSD-3-Clause")) .connection("scm:git:https://github.com/ethauvin/" + name + ".git")
.scm( .developerConnection("scm:git:git@github.com:ethauvin/" + name + ".git")
.url("https://github.com/ethauvin/" + name))
new PublishScm()
.connection("scm:git:https://github.com/ethauvin/" + name + ".git")
.developerConnection("scm:git:git@github.com:ethauvin/" + name + ".git")
.url("https://github.com/ethauvin/" + name))
.signKey(property("sign.key")) .signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase")); .signPassphrase(property("sign.passphrase"));

View file

@ -1,14 +1,14 @@
/* /**
* This file is automatically generated. * This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED! * Do not modify! -- ALL CHANGES WILL BE ERASED!
*/ */
package net.thauvin.erik.akismet package net.thauvin.erik.akismet
/** /**
* Provides semantic version information. * Provides semantic version information.
*/ */
internal object GeneratedVersion { internal object GeneratedVersion {
const val PROJECT = "Akismet Kotlin" const val PROJECT = "Akismet Kotlin"
const val VERSION = "1.1.0-SNAPSHOT" const val VERSION = "1.1.0-SNAPSHOT"
} }