aboutsummaryrefslogtreecommitdiff
path: root/dokka-subprojects/plugin-base/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'dokka-subprojects/plugin-base/build.gradle.kts')
-rw-r--r--dokka-subprojects/plugin-base/build.gradle.kts80
1 files changed, 80 insertions, 0 deletions
diff --git a/dokka-subprojects/plugin-base/build.gradle.kts b/dokka-subprojects/plugin-base/build.gradle.kts
new file mode 100644
index 00000000..40f33890
--- /dev/null
+++ b/dokka-subprojects/plugin-base/build.gradle.kts
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ */
+
+import dokkabuild.overridePublicationArtifactId
+
+plugins {
+ id("dokkabuild.kotlin-jvm")
+ id("dokkabuild.publish-jvm")
+ id("dokkabuild.setup-html-frontend-files")
+ id("dokkabuild.test-k2")
+}
+
+overridePublicationArtifactId("dokka-base")
+
+dependencies {
+ compileOnly(projects.dokkaSubprojects.dokkaCore)
+ compileOnly(projects.dokkaSubprojects.analysisKotlinApi)
+
+ implementation(projects.dokkaSubprojects.analysisMarkdownJb)
+
+ // Other
+ implementation(kotlin("reflect"))
+ implementation(libs.kotlinx.coroutines.core)
+ implementation(libs.jsoup)
+ implementation(libs.freemarker)
+ implementation(libs.kotlinx.html)
+ implementation(libs.jackson.kotlin)
+ constraints {
+ implementation(libs.jackson.databind) {
+ because("CVE-2022-42003")
+ }
+ }
+
+ // Test only
+ testImplementation(kotlin("test"))
+ testImplementation(libs.junit.jupiterParams)
+
+ symbolsTestConfiguration(project(path = ":dokka-subprojects:analysis-kotlin-symbols", configuration = "shadow"))
+ descriptorsTestConfiguration(project(path = ":dokka-subprojects:analysis-kotlin-descriptors", configuration = "shadow"))
+ testImplementation(projects.dokkaSubprojects.pluginBaseTestUtils) {
+ exclude(module = "analysis-kotlin-descriptors")
+ }
+ testImplementation(projects.dokkaSubprojects.coreContentMatcherTestUtils)
+ testImplementation(projects.dokkaSubprojects.coreTestApi)
+
+ dokkaHtmlFrontendFiles(projects.dokkaSubprojects.pluginBaseFrontend) {
+ because("fetch frontend files from subproject :plugin-base-frontend")
+ }
+}
+
+// access the frontend files via the dependency on :plugins:base:frontend
+val dokkaHtmlFrontendFiles: Provider<FileCollection> =
+ configurations.dokkaHtmlFrontendFiles.map { frontendFiles ->
+ frontendFiles.incoming.artifacts.artifactFiles
+ }
+
+val preparedokkaHtmlFrontendFiles by tasks.registering(Sync::class) {
+ description = "copy Dokka Base frontend files into the resources directory"
+
+ from(dokkaHtmlFrontendFiles) {
+ include("*.js")
+ into("dokka/scripts")
+ }
+
+ from(dokkaHtmlFrontendFiles) {
+ include("*.css")
+ into("dokka/styles")
+ }
+
+ into(layout.buildDirectory.dir("generated/src/main/resources"))
+}
+
+sourceSets.main {
+ resources.srcDir(preparedokkaHtmlFrontendFiles.map { it.destinationDir })
+}
+
+tasks.test {
+ maxHeapSize = "4G"
+}