Skip to content

Commit af4c02c

Browse files
committed
Improve documentation
Closes #1 Signed-off-by: Dmitry Sulman <[email protected]>
1 parent 2d93f42 commit af4c02c

File tree

9 files changed

+64
-21
lines changed

9 files changed

+64
-21
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
kotlin("jvm")
33
alias(libs.plugins.dokka)
4-
alias(libs.plugins.dokka.javadoc)
54
alias(libs.plugins.jreleaser)
65
}
76

buildSrc/build.gradle.kts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ repositories {
88
}
99

1010
kotlin {
11-
jvmToolchain(17)
11+
jvmToolchain(libs.versions.java.get().toInt())
1212
}
1313

1414
dependencies {
15+
// To make libs accessible from conventions.gradle.kts
16+
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
17+
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
18+
19+
// Override the old Jackson version that comes with dokka
20+
// to fix READ_DATE_TIMESTAMPS_AS_NANOSECONDS on Jreleaser tasks
21+
// https://github.com/dependency-check/DependencyCheck/issues/6192
1522
implementation(platform(libs.jackson.bom))
1623

17-
implementation(libs.dokka.gradlePlugin)
18-
implementation(libs.dokka.javadocPlugin)
19-
implementation(libs.kotlin.gradlePlugin)
20-
implementation(libs.ktlintPlugin)
24+
implementation(libs.dokka.javadoc.plugin)
25+
implementation(libs.dokka.plugin)
26+
implementation(libs.kotlin.plugin)
27+
implementation(libs.ktlint.plugin)
2128
}

buildSrc/src/main/kotlin/conventions.gradle.kts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.gradle.accessors.dm.LibrariesForLibs
12
import org.jlleitschuh.gradle.ktlint.KtlintExtension
23

34
plugins {
@@ -9,6 +10,9 @@ plugins {
910
`maven-publish`
1011
}
1112

13+
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
14+
val libs = the<LibrariesForLibs>()
15+
1216
repositories {
1317
mavenCentral()
1418
maven {
@@ -20,7 +24,7 @@ repositories {
2024
}
2125

2226
kotlin {
23-
jvmToolchain(17)
27+
jvmToolchain(libs.versions.java.get().toInt())
2428
}
2529

2630
java {
@@ -50,6 +54,31 @@ val dokkaJavadocJar by tasks.registering(Jar::class) {
5054
archiveClassifier.set("javadoc")
5155
}
5256

57+
dokka {
58+
dokkaSourceSets.configureEach {
59+
includes.from("./src/main/resources/dokka/Module.md")
60+
sourceLink {
61+
localDirectory.set(file("src/main/kotlin"))
62+
remoteUrl("https://github.com/dmitrysulman/logback-access-reactor-netty/tree/main/${project.name}/src/main/kotlin")
63+
remoteLineSuffix.set("#L")
64+
}
65+
externalDocumentationLinks {
66+
register("reactor-netty-docs") {
67+
url("https://javadoc.io/doc/io.projectreactor.netty/reactor-netty-http/${libs.versions.reactorNetty.get()}/")
68+
packageListUrl("https://javadoc.io/doc/io.projectreactor.netty/reactor-netty-http/${libs.versions.reactorNetty.get()}/package-list")
69+
}
70+
register("logback-access-docs") {
71+
url("https://javadoc.io/doc/ch.qos.logback.access/logback-access-common/${libs.versions.logbackAccess.get()}/")
72+
packageListUrl("https://javadoc.io/doc/ch.qos.logback.access/logback-access-common/${libs.versions.logbackAccess.get()}/element-list")
73+
}
74+
register("logback-core-docs") {
75+
url("https://javadoc.io/doc/ch.qos.logback/logback-core/${libs.versions.logbackClassic.get()}/")
76+
packageListUrl("https://javadoc.io/doc/ch.qos.logback/logback-core/${libs.versions.logbackClassic.get()}/element-list")
77+
}
78+
}
79+
}
80+
}
81+
5382
publishing {
5483
publications {
5584
create<MavenPublication>("maven") {
@@ -100,7 +129,7 @@ tasks.jacocoTestReport {
100129
}
101130

102131
configure<KtlintExtension> {
103-
version = "1.5.0"
132+
version = libs.versions.ktlint
104133
additionalEditorconfig.set(
105134
mapOf(
106135
"ktlint_standard_backing-property-naming" to "disabled"

gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[versions]
22
dokka = "2.0.0"
33
jackson = "2.19.0"
4+
java = "17"
45
jreleaser = "1.18.0"
56
junit = "5.12.2"
67
kotest = "5.9.1"
78
kotlin = "2.1.21"
89
kotlinxCoroutines = "1.10.2"
10+
ktlint = "1.5.0"
911
ktlintPlugin = "12.2.0"
1012
logbackAccess = "2.0.6"
1113
logbackClassic = "1.5.18"
@@ -14,24 +16,22 @@ reactorNetty = "1.2.6"
1416
slf4j = "2.0.17"
1517

1618
[libraries]
17-
dokka-gradlePlugin = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka" }
18-
dokka-javadocPlugin = { group = "org.jetbrains.dokka-javadoc", name = "org.jetbrains.dokka-javadoc.gradle.plugin", version.ref = "dokka" }
19-
jackson-bom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "jackson" } # Override the old jackson version that comes with dokka
19+
dokka-plugin = { group = "org.jetbrains.dokka", name = "org.jetbrains.dokka.gradle.plugin", version.ref = "dokka" }
20+
dokka-javadoc-plugin = { group = "org.jetbrains.dokka-javadoc", name = "org.jetbrains.dokka-javadoc.gradle.plugin", version.ref = "dokka" }
21+
jackson-bom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "jackson" }
2022
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
2123
junit-platformLauncher = { group = "org.junit.platform", name = "junit-platform-launcher" }
2224
kotest-assertions-core-jvm = { group = "io.kotest", name = "kotest-assertions-core-jvm", version.ref = "kotest" }
23-
kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
25+
kotlin-plugin = { group = "org.jetbrains.kotlin.jvm", name = "org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" }
2426
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }
2527
kotlinx-coroutines-reactor = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-reactor", version.ref = "kotlinxCoroutines" }
26-
ktlintPlugin = { group = "org.jlleitschuh.gradle.ktlint", name = "org.jlleitschuh.gradle.ktlint.gradle.plugin", version.ref = "ktlintPlugin" }
28+
ktlint-plugin = { group = "org.jlleitschuh.gradle.ktlint", name = "org.jlleitschuh.gradle.ktlint.gradle.plugin", version.ref = "ktlintPlugin" }
2729
logback-access-common = { group = "ch.qos.logback.access", name = "logback-access-common", version.ref = "logbackAccess" }
2830
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logbackClassic" }
29-
logback-core = { group = "ch.qos.logback", name = "logback-core", version.ref = "logbackClassic" }
3031
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
3132
reactorNetty-http = { group = "io.projectreactor.netty", name = "reactor-netty-http", version.ref = "reactorNetty" }
3233
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
3334

3435
[plugins]
3536
dokka = { id = "org.jetbrains.dokka" }
36-
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc" }
3737
jreleaser = { id = "org.jreleaser", version.ref = "jreleaser" }

logback-access-reactor-netty/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies {
1414
testImplementation(libs.kotlinx.coroutines.core)
1515
testImplementation(libs.kotlinx.coroutines.reactor)
1616
testImplementation(libs.logback.classic)
17-
testImplementation(libs.logback.core)
1817
testImplementation(libs.mockk)
1918

2019
testRuntimeOnly(libs.junit.platformLauncher)

logback-access-reactor-netty/src/main/kotlin/io/github/dmitrysulman/logback/access/reactor/netty/AccessEvent.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ import java.util.Enumeration
1818
* This class implements the Logback Access [IAccessEvent] interface to provide detailed information about access logs,
1919
* including request and response data, headers, cookies, and contextual information.
2020
*
21-
* @constructor Initializes an [AccessEvent] instance with the given [AccessLogArgProvider] and [AccessContext].
22-
* The [AccessLogArgProvider] supplies information about the HTTP request and response to populate the event's details.
23-
* The [AccessContext] facilitates access logging within the specified context.
24-
*
2521
* This class includes various lazy-loaded properties to efficiently retrieve detailed information about
2622
* the request and response only when needed. It supports deferred processing of logging data through
2723
* the `prepareForDeferredProcessing` method, ensuring all necessary attributes are initialized.
2824
*
25+
* @constructor Initializes an [AccessEvent] instance with the given [AccessLogArgProvider] and [AccessContext].
26+
*
27+
* The [AccessLogArgProvider] supplies information about the HTTP request and response to populate the event's details.
28+
* The [AccessContext] facilitates access logging within the specified context.
29+
*
2930
* @author Dmitry Sulman
3031
* @see IAccessEvent
3132
* @see AccessLog

logback-access-reactor-netty/src/main/kotlin/io/github/dmitrysulman/logback/access/reactor/netty/AccessLog.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import reactor.netty.http.server.logging.AccessLog as ReactorAccessLog
1717
* access-related information.
1818
*
1919
* @constructor Initializes an [AccessLog] instance with the given [AccessContext] and [AccessLogArgProvider].
20+
*
2021
* The [AccessContext] facilitates access logging within the specified context.
2122
* The [AccessLogArgProvider] supplies information about the HTTP request and response to populate the event's details.
2223
*

logback-access-reactor-netty/src/main/kotlin/io/github/dmitrysulman/logback/access/reactor/netty/ReactorNettyAccessLogFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class ReactorNettyAccessLogFactory : AccessLogFactory {
111111
* Primary constructor for the [ReactorNettyAccessLogFactory] class.
112112
*
113113
* Initializes the access log factory with the configuration file, a new [JoranConfigurator] instance,
114-
* and debug mode set to `false`.The configuration file is taken from the `logback.access.reactor.netty.config`
114+
* and debug mode set to `false`. The configuration file is taken from the `logback.access.reactor.netty.config`
115115
* system property or from the `logback-access.xml` file if the property is not set. If no default configuration
116116
* file is found, initialization will skip configuration steps.
117117
*/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Module logback-access-reactor-netty
2+
3+
A Java/Kotlin library that integrates Logback Access with Reactor Netty HTTP server, providing comprehensive access logging capabilities.
4+
5+
# Package io.github.dmitrysulman.logback.access.reactor.netty
6+
7+
This package contains core classes of the library.

0 commit comments

Comments
 (0)