Skip to content

Commit 6e2085d

Browse files
committed
Quafka service pack 1
1 parent 9104cbe commit 6e2085d

File tree

168 files changed

+14263
-3012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+14263
-3012
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ max_line_length = 140
1717
[{*.kt,*.kts}]
1818
#indent_style = space
1919
max_line_length = 140
20-
#indent_size = 2
20+
ktlint_standard_import-ordering = enabled
21+
ktlint_standard_no-unused-imports = enabled
22+
ij_java_delete_unused_module_imports = true
23+
ktlint_code_style = intellij_idea
2124
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
2225
#ij_continuation_indent_size = 2
2326
ij_kotlin_allow_trailing_comma = false
2427
ij_kotlin_allow_trailing_comma_on_call_site = false
2528
ij_kotlin_name_count_to_use_star_import = 2
2629
ij_kotlin_name_count_to_use_star_import_for_members = 2
2730

31+
2832
[{**/test/**.kt,**/test-e2e/**.kt,**/test-int/**.kt}]
2933
max_line_length = 240
3034
ktlint_standard_no-consecutive-comments = disabled
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Dokka GitHub Pages deployment",
3+
"description": "A workflow template to deploy the API documentation to GitHub Pages with Dokka. Please update the branches, runners, and the JDK versions and distributions according to your specific needs.",
4+
"categories": [
5+
"Dokka",
6+
"Kotlin",
7+
"Kotlin Multiplatform",
8+
"Gradle"
9+
]
10+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy the API documentation to GitHub Pages with Dokka
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: macos-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
34+
- name: Set up JDK 17
35+
uses: actions/setup-java@v5
36+
with:
37+
java-version: "17"
38+
distribution: "temurin"
39+
40+
- name: Setup Gradle
41+
uses: gradle/actions/setup-gradle@v4
42+
43+
- name: Build the distribution with Gradle Wrapper
44+
run: ./gradlew :dokkaGeneratePublicationHtml
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: _dokka/
50+
51+
# Deployment job
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ kotlin-ide/
8585
build
8686
.kotlin
8787
lib/**/reports
88-
88+
_dokka
8989
# Temp

README.md

Lines changed: 287 additions & 124 deletions
Large diffs are not rendered by default.

build.gradle.kts

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import org.gradle.kotlin.dsl.libs
1+
import com.vanniktech.maven.publish.JavadocJar
2+
import com.vanniktech.maven.publish.KotlinJvm
23
import org.gradle.plugins.ide.idea.model.IdeaModel
34
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
45

@@ -8,6 +9,8 @@ plugins {
89
alias(libs.plugins.testLogger)
910
alias(libs.plugins.kover)
1011
alias(libs.plugins.maven.publish)
12+
alias(libs.plugins.dokka)
13+
alias(libs.plugins.javadoc)
1114
idea
1215
java
1316
}
@@ -26,10 +29,11 @@ kover {
2629
}
2730
}
2831

29-
val koverProjects = subprojects.of("lib")
32+
val publishedProjects = subprojects.of("lib")
3033
dependencies {
31-
koverProjects.forEach {
34+
publishedProjects.forEach {
3235
kover(it)
36+
dokka(it)
3337
}
3438
}
3539

@@ -116,17 +120,33 @@ subprojects.of("lib", "examples") {
116120
}
117121
}
118122

119-
val publishedProjects = listOf(
120-
"quafka",
121-
"quafka-extensions"
122-
)
123-
124-
subprojects.of("lib", filter = { p -> publishedProjects.contains(p.name) }) {
123+
publishedProjects.forEvery {
125124
val p = this
126-
println("publishing $name")
125+
127126
apply {
128127
plugin("java")
129128
plugin(rootProject.libs.plugins.maven.publish.pluginId)
129+
plugin(rootProject.libs.plugins.dokka.pluginId)
130+
plugin(rootProject.libs.plugins.javadoc.pluginId)
131+
}
132+
133+
dokka {
134+
dokkaPublications.html {
135+
suppressInheritedMembers.set(true)
136+
failOnWarning.set(false)
137+
}
138+
dokkaSourceSets.main {
139+
skipDeprecated = false
140+
sourceLink {
141+
localDirectory = project.projectDir
142+
remoteUrl("https://github.com/Trendyol/quafka/tree/master/lib/${p.name}/src")
143+
remoteLineSuffix.set("#L")
144+
}
145+
samples.from("examples")
146+
}
147+
pluginsConfiguration.html {
148+
footerMessage.set("(c) Trendyol")
149+
}
130150
}
131151

132152
configure<JavaPluginExtension> {
@@ -147,6 +167,12 @@ subprojects.of("lib", filter = { p -> publishedProjects.contains(p.name) }) {
147167
}
148168

149169
mavenPublishing {
170+
configure(
171+
KotlinJvm(
172+
javadocJar = JavadocJar.Dokka("dokkaHtmlJar"),
173+
sourcesJar = true
174+
)
175+
)
150176
publishToMavenCentral()
151177
coordinates(groupId = rootProject.group.toString(), artifactId = project.name, version = rootProject.version.toString())
152178

@@ -177,3 +203,24 @@ subprojects.of("lib", filter = { p -> publishedProjects.contains(p.name) }) {
177203
}
178204
}
179205
}
206+
207+
dokka {
208+
dokkaPublications.html {
209+
outputDirectory.set(rootDir.resolve("_dokka"))
210+
211+
pluginsConfiguration.html {
212+
customAssets.from("docs/assets/logo.jpeg")
213+
footerMessage.set("(c) Trendyol")
214+
}
215+
includes.from(
216+
project.layout.projectDirectory.file("README.md"),
217+
project.layout.projectDirectory.dir("docs/fundamentals.md")
218+
)
219+
}
220+
}
221+
222+
val dokkaHtmlJar by tasks.registering(Jar::class) {
223+
description = "A HTML Documentation JAR containing Dokka HTML"
224+
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
225+
archiveClassifier.set("html-doc")
226+
}

buildSrc/src/main/kotlin/Helpers.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ fun Collection<Project>.of(
3030
action: Action<Project>
3131
): Unit = this.filter { parentProjects.contains(it.parent?.name) && filter(it) }.forEach { action(it) }
3232

33+
fun Collection<Project>.forEvery(
34+
action: Action<Project>
35+
): Unit = this.forEach { action(it) }
36+
3337
val runningOnCI: Boolean
3438
get() = System.getenv("CI") != null ||
3539
System.getenv("GITHUB_ACTIONS") != null ||

0 commit comments

Comments
 (0)