-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to have separate modules for transport and pubsub (#3)
- Loading branch information
Showing
50 changed files
with
469 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
// kotlin | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}") | ||
|
||
// detekt / ktlint | ||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${libs.plugins.detekt.get().version}") | ||
implementation("org.jmailen.gradle:kotlinter-gradle:${libs.plugins.ktlint.get().version}") | ||
|
||
// publishing | ||
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${libs.plugins.dokka.get().version}") | ||
implementation("com.vanniktech:gradle-maven-publish-plugin:${libs.plugins.maven.central.publish.get().version}") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import org.gradle.plugin.use.PluginDependenciesSpec | ||
|
||
val PluginDependenciesSpec.`pg-kueue-base` get() = id("pg-kueue-base") | ||
val PluginDependenciesSpec.`pg-kueue-publish` get() = id("pg-kueue-publish") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import org.jmailen.gradle.kotlinter.tasks.FormatTask | ||
import org.jmailen.gradle.kotlinter.tasks.LintTask | ||
|
||
plugins { | ||
kotlin("jvm") | ||
id("io.gitlab.arturbosch.detekt") | ||
id("org.jmailen.kotlinter") | ||
} | ||
|
||
dependencies { | ||
addPlatform(project, platform("org.jetbrains.kotlin:kotlin-bom:${getKotlinPluginVersion()}")) | ||
} | ||
|
||
tasks.withType<Detekt> { | ||
buildUponDefaultConfig = true | ||
config.from(files("${rootDir.absolutePath}/detekt.yaml")) | ||
basePath = rootDir.absolutePath | ||
|
||
tasks.getByName("check").dependsOn(this) | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
sourceCompatibility = "21" | ||
targetCompatibility = "21" | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
testLogging { | ||
exceptionFormat = TestExceptionFormat.FULL | ||
events = mutableSetOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED) | ||
showStandardStreams = true | ||
showExceptions = true | ||
} | ||
} | ||
|
||
tasks.withType<LintTask> { | ||
source("build.gradle.kts", "settings.gradle.kts") | ||
exclude { | ||
it.file.path.startsWith("$buildDir") && !it.file.path.endsWith("gradle.kts") | ||
} | ||
dependsOn("formatKotlin") | ||
} | ||
|
||
tasks.withType<FormatTask> { | ||
source("build.gradle.kts", "settings.gradle.kts") | ||
exclude { | ||
it.file.path.startsWith("$buildDir") && !it.file.path.endsWith("gradle.kts") | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
compilerOptions { | ||
freeCompilerArgs.addAll("-Xjsr305=strict", "-Xcontext-receivers") | ||
allWarningsAsErrors = true | ||
jvmTarget.set(JvmTarget.JVM_21) | ||
} | ||
} | ||
|
||
private fun DependencyHandler.addPlatform(project: Project, platform: Dependency) { | ||
val availableConfigurations = project.configurations.map { it.name }.toSet() | ||
availableConfigurations.intersect( | ||
setOf("api", "implementation", "testImplementation") | ||
).forEach { configuration -> | ||
add(configuration, platform) | ||
} | ||
} | ||
|
||
private fun <D : Dependency> DependencyHandler.addPlatform(project: Project, platform: Provider<D>) = addPlatform(project, platform.get()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
|
||
plugins { | ||
id("org.jetbrains.dokka") | ||
id("com.vanniktech.maven.publish") | ||
} | ||
|
||
mavenPublishing { | ||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) | ||
|
||
signAllPublications() | ||
|
||
pom { | ||
name = "pg-kueue" | ||
description = "Kotlin Coroutines PostgresSQL-based message queue using LISTEN/NOTIFYt" | ||
url = "https://github.com/vooft/pg-kueue" | ||
licenses { | ||
license { | ||
name = "The Apache License, Version 2.0" | ||
url = "https://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
} | ||
scm { | ||
connection = "https://github.com/vooft/pg-kueue" | ||
url = "https://github.com/vooft/pg-kueue" | ||
} | ||
developers { | ||
developer { | ||
name = "pg-kueue team" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.