Upgraded to Kotlin 1.7.20

This commit is contained in:
Erik C. Thauvin 2022-09-30 22:45:46 -07:00
parent 56fa17703c
commit 1e2f2ccee9
16 changed files with 55 additions and 34 deletions

View file

@ -30,19 +30,19 @@ defaults_gradle: &defaults_gradle
path: build/reports/
jobs:
build_gradle_jdk17:
build_gradle_jdk18:
<<: *defaults
docker:
- image: cimg/openjdk:17.0
- image: cimg/openjdk:18.0
<<: *defaults_gradle
build_gradle_jdk8:
build_gradle_jdk11:
<<: *defaults
docker:
- image: cimg/openjdk:8.0
- image: cimg/openjdk:11.0
<<: *defaults_gradle
@ -50,5 +50,5 @@ workflows:
version: 2
gradle:
jobs:
- build_gradle_jdk8
- build_gradle_jdk17
- build_gradle_jdk11
- build_gradle_jdk18

View file

@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
java-version: [ 1.8, 11, 17 ]
java-version: [ 11, 18 ]
steps:
- uses: actions/checkout@v2

View file

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

View file

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Default" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View file

@ -36,5 +36,10 @@
<option name="name" value="maven" />
<option name="url" value="https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$PROJECT_DIR$/../../maven/repository/" />
</remote-repository>
</component>
</project>

7
.idea/kotlinc.xml generated
View file

@ -5,7 +5,10 @@
<option name="sourceMapPrefix" />
</component>
<component name="KotlinCommonCompilerArguments">
<option name="apiVersion" value="1.6" />
<option name="languageVersion" value="1.6" />
<option name="apiVersion" value="1.7" />
<option name="languageVersion" value="1.7" />
</component>
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.7.10" />
</component>
</project>

View file

@ -2,7 +2,7 @@
[![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) [![Release](https://img.shields.io/github/release/ethauvin/pinboard-poster.svg)](https://github.com/ethauvin/pinboard-poster/releases/latest) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/pinboard-poster.svg?label=maven%20central)](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22pinboard-poster%22)
[![Known Vulnerabilities](https://snyk.io/test/github/ethauvin/pinboard-poster/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/ethauvin/pinboard-poster?targetFile=pom.xml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_pinboard-poster&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster) [![GitHub CI](https://github.com/ethauvin/pinboard-poster/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/pinboard-poster/actions/workflows/gradle.yml) [![CircleCI](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_pinboard-poster&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster) [![GitHub CI](https://github.com/ethauvin/pinboard-poster/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/pinboard-poster/actions/workflows/gradle.yml) [![CircleCI](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
A small Kotlin/Java/Android library for posting to [Pinboard](https://pinboard.in).
@ -37,6 +37,10 @@ Your API authentication token is available on the [Pinboard settings page](https
To install and run from Gradle, add the following to the build.gradle file:
```gradle
repositories {
mavenCentral()
}
dependencies {
compile 'net.thauvin.erik:pinboard-poster:1.0.4'
}

View file

@ -1,4 +1,4 @@
image: openjdk:8
image: maven:3-openjdk-18
pipelines:
default:

View file

@ -5,14 +5,14 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("com.github.ben-manes.versions") version "0.42.0"
id("io.gitlab.arturbosch.detekt") version "1.20.0"
id("io.gitlab.arturbosch.detekt") version "1.21.0"
id("java")
id("maven-publish")
id("org.jetbrains.dokka") version "1.6.21"
id("org.jetbrains.kotlinx.kover") version "0.5.0"
id("org.sonarqube") version "3.3"
id("org.jetbrains.dokka") version "1.7.10"
id("org.jetbrains.kotlinx.kover") version "0.6.0"
id("org.sonarqube") version "3.4.0.2513"
id("signing")
kotlin("jvm") version "1.6.21"
kotlin("jvm") version "1.7.20"
}
group = "net.thauvin.erik"
@ -27,7 +27,7 @@ var isRelease = "release" in gradle.startParameter.taskNames
val publicationName = "mavenJava"
object Versions {
const val OKHTTP = "4.9.3"
const val OKHTTP = "4.10.0"
}
fun isNonStable(version: String): Boolean {
@ -48,12 +48,12 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}")
implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}")
testImplementation("org.testng:testng:7.5")
testImplementation("org.testng:testng:7.6.1")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
@ -68,7 +68,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")
property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/xml/report.xml")
}
}
@ -117,6 +117,7 @@ tasks {
val copyToDeploy by registering(Copy::class) {
from(configurations.runtimeClasspath) {
exclude("annotations-*.jar")
exclude("kotlin-*.jar")
}
from(jar)
into(deployDir)
@ -125,7 +126,7 @@ tasks {
register("deploy") {
description = "Copies all needed files to the $deployDir directory."
group = PublishingPlugin.PUBLISH_TASK_GROUP
dependsOn(build, jar)
dependsOn(clean, wrapper, build, jar)
outputs.dir(deployDir)
inputs.files(copyToDeploy)
mustRunAfter(clean)

4
deploy.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
./gradlew deploy
[ $? -eq 0 ] && scp deploy/*.jar nix3.thauvin.us:/opt/lib/jtalk-ee/pinboard-poster

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -11,8 +11,8 @@ defaultTasks 'run'
mainClassName = 'net.thauvin.erik.pinboard.samples.JavaExample'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("application")
id("com.github.ben-manes.versions") version "0.42.0"
kotlin("jvm") version "1.6.21"
kotlin("jvm") version "1.7.20"
}
// ./gradlew run
@ -20,8 +20,8 @@ dependencies {
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
application {

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -81,7 +81,6 @@ open class PinboardPoster() {
* @param properties The properties.
* @param key The property key.
*/
@Suppress("unused")
@JvmOverloads
constructor(properties: Properties, key: String = Constants.ENV_API_TOKEN) : this() {
apiToken = properties.getProperty(key, apiToken)
@ -121,7 +120,6 @@ open class PinboardPoster() {
var apiEndPoint: String = Constants.API_ENDPOINT
/** The logger instance. **/
@Suppress("MemberVisibilityCanBePrivate")
val logger: Logger by lazy { Logger.getLogger(PinboardPoster::class.java.simpleName) }
private val client by lazy {