Updated dependencies and copyright.

This commit is contained in:
Erik C. Thauvin 2022-01-03 12:49:29 -08:00
parent f9594e9dc3
commit 89c0acdf42
12 changed files with 55 additions and 50 deletions

15
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,15 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value />
</option>
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

View file

@ -1,5 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" />
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View file

@ -36,5 +36,10 @@
<option name="name" value="maven" />
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" />
</remote-repository>
</component>
</project>

View file

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

View file

@ -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<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}
@ -221,7 +207,7 @@ tasks {
}
"sonarqube" {
dependsOn(jacocoTestReport)
dependsOn(koverReport)
}
}

View file

@ -6,9 +6,8 @@
<ID>ComplexMethod:AkismetComment.kt$AkismetComment$ @Suppress("DuplicatedCode") override fun equals(other: Any?): Boolean</ID>
<ID>MagicNumber:Akismet.kt$Akismet$12</ID>
<ID>MagicNumber:Akismet.kt$Akismet.&lt;no name provided>$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>
<ID>NestedBlockDepth:AkismetTest.kt$fun getKey(key: String): String</ID>
<ID>ReturnCount:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl?, formBody: FormBody, trueOnError: Boolean = false): Boolean</ID>
<ID>SwallowedException:Akismet.kt$Akismet$catch (e: IOException) { errorMessage = "An IO error occurred while communicating with the Akismet service." }</ID>
<ID>ReturnCount:Akismet.kt$Akismet$ @JvmOverloads fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean</ID>
</CurrentIssues>
</SmellBaseline>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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