Skip to content

Commit 169025b

Browse files
committed
Update dependencies
1 parent 712ba2e commit 169025b

File tree

15 files changed

+277
-304
lines changed

15 files changed

+277
-304
lines changed

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ root = true
22

33
[*]
44
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
57
end_of_line = lf
68
insert_final_newline = true
79
trim_trailing_whitespace = true
810

9-
[*.{kt, kts, gradle}]
10-
indent_style = space
11-
indent_size = 4
12-
continuation_indent_size = 4
11+
[*.yaml]
12+
indent_size = 2

.github/workflows/ci.yaml

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,59 @@
1-
name: ci
1+
name: CI
22

3-
on: [ push, pull_request ]
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
push:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
411

512
jobs:
6-
check:
13+
build:
14+
name: Build
715
runs-on: ubuntu-latest
816

917
steps:
10-
- uses: actions/checkout@v2
11-
12-
- uses: actions/cache@v1
13-
with:
14-
path: ~/.gradle/wrapper
15-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }}
16-
restore-keys: |
17-
${{ runner.os }}-gradle-wrapper-
18+
- name: Checkout Project
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1820

19-
- uses: actions/cache@v1
21+
- name: Setup JDK
22+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2023
with:
21-
path: ~/.gradle/caches
22-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }} }}
23-
restore-keys: |
24-
${{ runner.os }}-gradle-caches-
24+
distribution: zulu
25+
java-version: 11
2526

26-
- uses: actions/setup-java@v1
27-
with:
28-
java-version: 1.8
27+
- name: Setup Gradle
28+
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
2929

30-
- run: ./gradlew check
30+
- name: Build with Gradle Wrapper
31+
run: ./gradlew build
3132

3233
publish:
33-
needs: check
34-
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && needs.check.result == 'success'
34+
name: Publish
3535
runs-on: ubuntu-latest
36+
if: github.ref == 'refs/heads/master' && github.repository == 'michaelbull/kotlin-coroutines-jdbc'
37+
needs: build
3638

3739
steps:
38-
- uses: actions/checkout@v2
40+
- name: Checkout Project
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3942

40-
- uses: actions/cache@v1
43+
- name: Setup JDK
44+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
4145
with:
42-
path: ~/.gradle/wrapper
43-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }}
44-
restore-keys: |
45-
${{ runner.os }}-gradle-wrapper-
46+
distribution: zulu
47+
java-version: 11
4648

47-
- uses: actions/cache@v1
48-
with:
49-
path: ~/.gradle/caches
50-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }} }}
51-
restore-keys: |
52-
${{ runner.os }}-gradle-caches-
53-
54-
- uses: actions/setup-java@v1
55-
with:
56-
java-version: 1.8
49+
- name: Setup Gradle
50+
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
5751

58-
- run: ./gradlew publish
52+
- name: Publish with Gradle Wrapper
53+
run: ./gradlew public
5954
env:
60-
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
61-
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
62-
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
63-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
64-
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
55+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
56+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
57+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
58+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
59+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ out/
2121

2222
# Gradle
2323
build/
24+
local.properties
2425

2526
# JVM error logs
2627
hs_err_pid*.log

build.gradle.kts

Lines changed: 75 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,105 @@
11
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2-
import org.jetbrains.dokka.gradle.DokkaTask
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4-
5-
val ossrhUsername: String? by project
6-
val ossrhPassword: String? by project
7-
8-
val signingKeyId: String? by project // must be the last 8 digits of the key
9-
val signingKey: String? by project
10-
val signingPassword: String? by project
11-
12-
description = "A library for interacting with blocking JDBC drivers using Kotlin Coroutines."
2+
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
3+
import com.vanniktech.maven.publish.JavadocJar
4+
import com.vanniktech.maven.publish.KotlinJvm
5+
import org.gradle.api.JavaVersion.VERSION_1_8
6+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
137

148
plugins {
15-
`maven-publish`
16-
signing
17-
kotlin("jvm") version "1.6.10"
18-
id("com.github.ben-manes.versions") version "0.39.0"
19-
id("org.jetbrains.dokka") version "1.6.0"
20-
}
21-
22-
repositories {
23-
mavenCentral()
24-
jcenter()
25-
}
26-
27-
dependencies {
28-
implementation(kotlin("stdlib"))
29-
implementation("com.michael-bull.kotlin-inline-logger:kotlin-inline-logger:1.0.4")
30-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
31-
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2")
32-
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
33-
testImplementation("io.mockk:mockk:1.12.1")
9+
alias(libs.plugins.kotlin.jvm)
10+
alias(libs.plugins.versions)
11+
alias(libs.plugins.maven.publish)
3412
}
3513

3614
tasks.withType<DependencyUpdatesTask> {
15+
gradleReleaseChannel = GradleReleaseChannel.CURRENT.id
16+
3717
rejectVersionIf {
38-
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr").any {
18+
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr", "dev").any {
3919
candidate.version.contains(it, ignoreCase = true)
4020
}
4121
}
4222
}
4323

44-
tasks.withType<KotlinCompile> {
45-
kotlinOptions {
46-
jvmTarget = "1.8"
47-
freeCompilerArgs = listOf("-Xuse-experimental=kotlin.contracts.ExperimentalContracts")
24+
tasks.withType<Jar> {
25+
from(rootDir.resolve("LICENSE")) {
26+
into("META-INF")
4827
}
4928
}
5029

51-
tasks.withType<Test> {
52-
useJUnitPlatform()
30+
java {
31+
sourceCompatibility = VERSION_1_8
32+
targetCompatibility = VERSION_1_8
5333
}
5434

55-
val dokkaJavadoc by tasks.existing(DokkaTask::class)
56-
57-
val javadocJar by tasks.registering(Jar::class) {
58-
group = LifecycleBasePlugin.BUILD_GROUP
59-
description = "Assembles a jar archive containing the Javadoc API documentation."
60-
archiveClassifier.set("javadoc")
61-
from(dokkaJavadoc)
35+
kotlin {
36+
compilerOptions {
37+
optIn.add("kotlin.contracts.ExperimentalContracts")
38+
optIn.add("kotlinx.coroutines.ExperimentalCoroutinesApi")
39+
jvmTarget.set(JVM_1_8)
40+
}
6241
}
6342

64-
val sourcesJar by tasks.registering(Jar::class) {
65-
group = LifecycleBasePlugin.BUILD_GROUP
66-
description = "Assembles a jar archive containing the main classes with sources."
67-
archiveClassifier.set("sources")
68-
from(sourceSets["main"].allSource)
43+
dependencies {
44+
implementation(libs.kotlin.inline.logger)
45+
implementation(libs.kotlin.coroutines.core)
46+
testImplementation(libs.kotlin.test)
47+
testImplementation(libs.kotlin.coroutines.test)
48+
testImplementation(libs.mockk)
6949
}
7050

71-
publishing {
72-
repositories {
73-
maven {
74-
if (project.version.toString().endsWith("SNAPSHOT")) {
75-
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
76-
} else {
77-
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
51+
mavenPublishing {
52+
publishToMavenCentral()
53+
signAllPublications()
54+
55+
configure(
56+
KotlinJvm(
57+
javadocJar = JavadocJar.Empty(),
58+
sourcesJar = true,
59+
)
60+
)
61+
62+
pom {
63+
name.set(project.name)
64+
description.set(project.description)
65+
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc")
66+
inceptionYear.set("2019")
67+
68+
licenses {
69+
license {
70+
name.set("ISC License")
71+
url.set("https://opensource.org/licenses/isc-license.txt")
7872
}
73+
}
7974

80-
credentials {
81-
username = ossrhUsername
82-
password = ossrhPassword
75+
developers {
76+
developer {
77+
name.set("Michael Bull")
78+
url.set("https://www.michael-bull.com")
8379
}
8480
}
85-
}
8681

87-
publications {
88-
register("mavenJava", MavenPublication::class) {
89-
from(components["java"])
90-
artifact(javadocJar.get())
91-
artifact(sourcesJar.get())
92-
93-
pom {
94-
name.set(project.name)
95-
description.set(project.description)
96-
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc")
97-
inceptionYear.set("2019")
98-
99-
licenses {
100-
license {
101-
name.set("ISC License")
102-
url.set("https://opensource.org/licenses/isc-license.txt")
103-
}
104-
}
105-
106-
developers {
107-
developer {
108-
name.set("Michael Bull")
109-
url.set("https://www.michael-bull.com")
110-
}
111-
}
112-
113-
contributors {
114-
contributor {
115-
name.set("huntj88")
116-
url.set("https://github.com/huntj88")
117-
}
118-
}
119-
120-
scm {
121-
connection.set("scm:git:https://github.com/michaelbull/kotlin-coroutines-jdbc")
122-
developerConnection.set("scm:git:[email protected]:michaelbull/kotlin-coroutines-jdbc.git")
123-
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc")
124-
}
125-
126-
issueManagement {
127-
system.set("GitHub")
128-
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc/issues")
129-
}
130-
131-
ciManagement {
132-
system.set("GitHub")
133-
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc/actions?query=workflow%3Aci")
134-
}
82+
contributors {
83+
contributor {
84+
name.set("huntj88")
85+
url.set("https://github.com/huntj88")
13586
}
13687
}
137-
}
138-
}
13988

140-
signing {
141-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
142-
sign(publishing.publications)
89+
scm {
90+
connection.set("scm:git:https://github.com/michaelbull/kotlin-coroutines-jdbc")
91+
developerConnection.set("scm:git:[email protected]:michaelbull/kotlin-coroutines-jdbc.git")
92+
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc")
93+
}
94+
95+
issueManagement {
96+
system.set("GitHub")
97+
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc/issues")
98+
}
99+
100+
ciManagement {
101+
system.set("GitHub")
102+
url.set("https://github.com/michaelbull/kotlin-coroutines-jdbc/actions")
103+
}
104+
}
143105
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kotlin.code.style=official
2-
31
group=com.michael-bull.kotlin-coroutines-jdbc
42
version=1.0.3-SNAPSHOT
3+
description=A library for interacting with blocking JDBC drivers using Kotlin Coroutines.
4+
kotlin.code.style=official

gradle/libs.versions.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[versions]
2+
kotlin = "2.2.20"
3+
kotlin-inline-logger = "1.0.6"
4+
kotlin-coroutines = "1.10.2"
5+
mockk = "1.14.5"
6+
maven-publish-plugin = "0.34.0"
7+
versions-plugin = "0.52.0"
8+
9+
[libraries]
10+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
11+
kotlin-inline-logger = { module = "com.michael-bull.kotlin-inline-logger:kotlin-inline-logger", version.ref = "kotlin-inline-logger" }
12+
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
13+
kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlin-coroutines" }
14+
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
15+
16+
[plugins]
17+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
18+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }
19+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish-plugin" }

settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pluginManagement {
2+
repositories {
3+
mavenCentral()
4+
gradlePluginPortal()
5+
}
6+
}
7+
8+
plugins {
9+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
10+
}
11+
12+
dependencyResolutionManagement {
13+
repositories {
14+
mavenCentral()
15+
}
16+
}
17+
18+
rootProject.name = "kotlin-coroutines-jdbc"

0 commit comments

Comments
 (0)