diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..3ad4dc5
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
index d91f848..79ee123 100644
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 5d3d4fc..4290988 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -36,5 +36,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
index ac611db..f2b9abe 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2019-2021, Erik C. Thauvin (erik@thauvin.net)
+Copyright (c) 2019-2022, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/build.gradle.kts b/build.gradle.kts
index 993dd00..cff78fc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,21 +1,23 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
+import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
- id("com.github.ben-manes.versions") version "0.39.0"
- id("io.gitlab.arturbosch.detekt") version "1.18.1"
- id("jacoco")
+ id("com.github.ben-manes.versions") version "0.40.0"
+ id("io.gitlab.arturbosch.detekt") version "1.19.0"
+ id("java-library")
id("java")
id("maven-publish")
id("net.thauvin.erik.gradle.semver") version "1.0.4"
- id("org.jetbrains.dokka") version "1.5.30"
+ id("org.jetbrains.dokka") version "1.6.10"
+ id("org.jetbrains.kotlinx.kover") version "0.4.4"
id("org.sonarqube") version "3.3"
id("signing")
- kotlin("jvm") version "1.5.31"
- kotlin("kapt") version "1.5.31"
- kotlin("plugin.serialization") version "1.5.31"
+ kotlin("jvm") version "1.6.10"
+ kotlin("kapt") version "1.6.10"
+ kotlin("plugin.serialization") version "1.6.10"
}
group = "net.thauvin.erik"
@@ -31,7 +33,14 @@ var semverProcessor = "net.thauvin.erik:semver:1.2.0"
val publicationName = "mavenJava"
object Versions {
- const val OKHTTP = "4.9.1"
+ const val OKHTTP = "4.9.3"
+}
+
+fun isNonStable(version: String): Boolean {
+ val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
+ val regex = "^[0-9,.v-]+(-r)?$".toRegex()
+ val isStable = stableKeyword || regex.matches(version)
+ return isStable.not()
}
repositories {
@@ -50,9 +59,9 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}")
implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}")
- implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")
+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
- testImplementation("org.mockito:mockito-core:3.12.4")
+ testImplementation("org.mockito:mockito-core:4.2.0")
testImplementation("org.testng:testng:7.4.0")
}
@@ -67,24 +76,6 @@ detekt {
baseline = project.rootDir.resolve("config/detekt/baseline.xml")
}
-kotlin {
- // Add kapt.use.worker.api=false to gradle.properties (JDK 16+)
- // See: https://youtrack.jetbrains.com/issue/KT-45545
- kotlinDaemonJvmArgs = listOf(
- "-Dfile.encoding=UTF-8",
- "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
- "--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
- )
-}
-
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -97,6 +88,7 @@ sonarqube {
property("sonar.organization", "ethauvin-github")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.sourceEncoding", "UTF-8")
+ property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/report.xml")
}
}
@@ -126,15 +118,9 @@ tasks {
destination = file("$projectDir/pom.xml")
}
- jacoco {
- toolVersion = "0.8.7"
- }
-
- jacocoTestReport {
- dependsOn(test)
- reports {
- xml.required.set(true)
- html.required.set(true)
+ withType {
+ rejectVersionIf {
+ isNonStable(candidate.version)
}
}
@@ -221,7 +207,7 @@ tasks {
}
"sonarqube" {
- dependsOn(jacocoTestReport)
+ dependsOn(koverReport)
}
}
diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml
index dbe249e..ef2ce8d 100644
--- a/config/detekt/baseline.xml
+++ b/config/detekt/baseline.xml
@@ -6,9 +6,8 @@
ComplexMethod:AkismetComment.kt$AkismetComment$ @Suppress("DuplicatedCode") override fun equals(other: Any?): Boolean
MagicNumber:Akismet.kt$Akismet$12
MagicNumber:Akismet.kt$Akismet.<no name provided>$8
- NestedBlockDepth:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl?, formBody: FormBody, trueOnError: Boolean = false): Boolean
+ NestedBlockDepth:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean
NestedBlockDepth:AkismetTest.kt$fun getKey(key: String): String
- ReturnCount:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl?, formBody: FormBody, trueOnError: Boolean = false): Boolean
- SwallowedException:Akismet.kt$Akismet$catch (e: IOException) { errorMessage = "An IO error occurred while communicating with the Akismet service." }
+ ReturnCount:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean
diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts
index fc1964e..23f775e 100644
--- a/examples/build.gradle.kts
+++ b/examples/build.gradle.kts
@@ -2,8 +2,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("application")
- id("com.github.ben-manes.versions") version "0.39.0"
- kotlin("jvm") version "1.5.31"
+ id("com.github.ben-manes.versions") version "0.40.0"
+ kotlin("jvm") version "1.6.10"
}
// ./gradlew run runJava
diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/wrapper/gradle-wrapper.properties
index ffed3a2..2e6e589 100644
--- a/examples/gradle/wrapper/gradle-wrapper.properties
+++ b/examples/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ffed3a2..2e6e589 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt
index becf783..2c2c90d 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 (c) 2019-2021, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2019-2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt b/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt
index 963e324..7f53ebe 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 (c) 2019-2021, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2019-2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt b/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt
index e743302..c6f34c0 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 (c) 2019-2021, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2019-2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without