diff --git a/.gitattributes b/.gitattributes index e566c14..1e7e8cf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,3 +16,6 @@ text eol=lf # (binary is a macro for -text -diff) *.jar binary *.war binary + +# https://github.com/github/linguist/blob/v7.24.1/docs/overrides.md +site/** linguist-documentation diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml new file mode 100644 index 0000000..728ee95 --- /dev/null +++ b/.github/workflows/deploy-site.yml @@ -0,0 +1,51 @@ +name: Deploy Site + +on: + workflow_dispatch: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + + +concurrency: + group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v3 + + - name: Setup JDK + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: | + :docs:dokkatooGenerate + + - uses: actions/upload-pages-artifact@v1 + with: + path: ./docs/build/dokka/html + + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/build.gradle.kts b/build.gradle.kts index e1de2c7..a6460d5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,12 @@ import buildsrc.ext.excludeGeneratedGradleDsl +import buildsrc.ext.initIdeProjectLogo plugins { buildsrc.convention.`kotlin-jvm` - buildsrc.convention.`maven-publish` me.qoomon.`git-versioning` - `project-report` // `build-dashboard` // incompatible with Gradle CC - idea } @@ -19,7 +17,6 @@ gitVersioning.apply { branch(".+") { version = "\${ref}-SNAPSHOT" } tag("v(?.*)") { version = "\${ref.version}" } } - // optional fallback configuration in case of no matching ref configuration rev { version = "\${commit}" } } @@ -39,13 +36,6 @@ kotkaPublishing { mavenPomDescription.set("Using Kotka means a more pleasant experience while using Kafka Streams") } - -tasks.wrapper { - gradleVersion = "7.6" - distributionType = Wrapper.DistributionType.ALL -} - - idea { module { isDownloadSources = true @@ -56,3 +46,5 @@ idea { ) } } + +initIdeProjectLogo("site/src/jsMain/resources/ks-logo.svg") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ea3a14d..b2f7e37 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -2,7 +2,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { `kotlin-dsl` - kotlin("jvm") version embeddedKotlinVersion } dependencies { @@ -10,7 +9,12 @@ dependencies { implementation(libs.gradlePlugin.kotlinxSerialization) implementation(libs.gradlePlugin.gitVersioning) - // implementation(libs.gradlePlugin.dokka) // incompatible with Gradle CC + + implementation(libs.kotlin.dokkaCore) + implementation(libs.gradlePlugin.dokkatoo) + + // https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) } val gradleJvmTarget = "11" diff --git a/buildSrc/repositories.settings.gradle.kts b/buildSrc/repositories.settings.gradle.kts index 2591a58..c0d385d 100644 --- a/buildSrc/repositories.settings.gradle.kts +++ b/buildSrc/repositories.settings.gradle.kts @@ -1,23 +1,66 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + @Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature dependencyResolutionManagement { repositories { mavenCentral() gradlePluginPortal() - jitpack() - } + jetBrainsCompose() + jetBrainsKotlinxHtml() - pluginManagement { - repositories { - gradlePluginPortal() - mavenCentral() - jitpack() + // Declare the Node.js & Yarn download repositories + exclusiveContent { + forRepository { + ivy("https://nodejs.org/dist/") { + name = "Node Distributions at $url" + patternLayout { artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]") } + metadataSources { artifact() } + content { includeModule("org.nodejs", "node") } + } + } + filter { includeGroup("org.nodejs") } } - } + exclusiveContent { + forRepository { + ivy("https://github.com/yarnpkg/yarn/releases/download") { + name = "Yarn Distributions at $url" + patternLayout { artifact("v[revision]/[artifact](-v[revision]).[ext]") } + metadataSources { artifact() } + content { includeModule("com.yarnpkg", "yarn") } + } + } + filter { includeGroup("com.yarnpkg") } + } + } } fun RepositoryHandler.jitpack() { maven("https://jitpack.io") } + +fun RepositoryHandler.jetBrainsCompose() { + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") { + mavenContent { + includeGroupByRegex("""androidx\..+""") + includeGroupByRegex("""org\.jetbrains\..+""") + includeGroup("web") + includeGroup("com.theapache64.composebird") + } + } +} + +fun RepositoryHandler.jetBrainsKotlinxHtml() { + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + mavenContent { + includeGroup("org.jetbrains.kotlinx") + } + } +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts index d0b2b29..f747e4a 100644 --- a/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts +++ b/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts @@ -23,18 +23,18 @@ tasks.withType().configureEach { testLogging { // don't log console output - it's too noisy - showCauses = false - showExceptions = false - showStackTraces = false - showStandardStreams = false + showCauses = true + showExceptions = true + showStackTraces = true + showStandardStreams = true events( // only log test outcomes TestLogEvent.PASSED, TestLogEvent.FAILED, TestLogEvent.SKIPPED, - // TestLogEvent.STARTED, - // TestLogEvent.STANDARD_ERROR, - // TestLogEvent.STANDARD_OUT, + TestLogEvent.STARTED, + TestLogEvent.STANDARD_ERROR, + TestLogEvent.STANDARD_OUT, ) } } diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/dokkatoo.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/dokkatoo.gradle.kts new file mode 100644 index 0000000..b582f6a --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/dokkatoo.gradle.kts @@ -0,0 +1,54 @@ +package buildsrc.convention + +import buildsrc.ext.libs + +plugins { + id("buildsrc.convention.base") + id("dev.adamko.dokkatoo-html") +} + +val kafkaJavadocUrl = libs.versions.kafka.map { v -> + val (major, minor) = v.split(".") + "https://kafka.apache.org/${major}${minor}/javadoc/" +} + +dokkatoo { + dokkatooSourceSets.configureEach { + externalDocumentationLinks.create("kafka-streams") { + enabled.set(true) + url(kafkaJavadocUrl) + } + } +} + +tasks.dokkatooGeneratePublicationHtml { + doLast { + outputDirectory.get().asFile.walk() + .filter { it.isFile && it.extension == "html" } + .forEach { file -> + file.writeText( + file.readText() + .replace( + """""", + """""", + ) + .replace( + """ +