Compare commits

...

5 commits

14 changed files with 55 additions and 15 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ lib/bld/**
!lib/bld/bld-wrapper.properties
lib/compile/
lib/runtime/
lib/provided/
lib/standalone/
lib/test/

9
.idea/kotlinc.xml generated
View file

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="pluginClasspaths">
<array>
<option value="$KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar" />
</array>
</option>
</component>
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
</project>
</project>

View file

@ -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

View file

@ -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

View file

@ -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=

View file

@ -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)

View file

@ -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=

View file

@ -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();
}

View file

@ -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:

View file

@ -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:

View file

@ -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!

View file

@ -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: