aboutsummaryrefslogtreecommitdiff
path: root/dokka-subprojects/analysis-kotlin-descriptors
diff options
context:
space:
mode:
Diffstat (limited to 'dokka-subprojects/analysis-kotlin-descriptors')
-rw-r--r--dokka-subprojects/analysis-kotlin-descriptors/README.md21
-rw-r--r--dokka-subprojects/analysis-kotlin-descriptors/api/analysis-kotlin-descriptors.api0
-rw-r--r--dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts29
3 files changed, 50 insertions, 0 deletions
diff --git a/dokka-subprojects/analysis-kotlin-descriptors/README.md b/dokka-subprojects/analysis-kotlin-descriptors/README.md
new file mode 100644
index 00000000..128c38f7
--- /dev/null
+++ b/dokka-subprojects/analysis-kotlin-descriptors/README.md
@@ -0,0 +1,21 @@
+# Analysis: Kotlin descriptors
+
+An internal descriptor-based implementation for [analysis-kotlin-api](../analysis-kotlin-api). This implementation is
+also known as K1 or "the old compiler".
+
+Contains no stable public API and **must not** be used by anyone directly, only via [analysis-kotlin-api](../analysis-kotlin-api).
+
+Can be added as a runtime dependency by the runner.
+
+## Shadowing
+
+The `.jar` produced by this project shadows all dependencies. There are several reasons for it:
+
+1. Some of the artifacts Dokka depends on, like `com.jetbrains.intellij.java:java-psi`, are not
+ published to Maven Central, so the users would need to add custom repositories to their build scripts.
+2. There are many intertwining transitive dependencies of different versions, as well as direct copy-paste,
+ that can lead to runtime errors due to classpath conflicts, so it's best to let Gradle take care of
+ dependency resolution, and then pack everything into a single jar in a single place that can be tuned.
+3. The `compiler` and `ide` subprojects are internal details that are likely to change, so packing everything into
+ a single jar provides some stability for the CLI users, while not exposing too many internals. Publishing
+ the compiler, ide and other subprojects separately would also make it difficult to refactor the project structure.
diff --git a/dokka-subprojects/analysis-kotlin-descriptors/api/analysis-kotlin-descriptors.api b/dokka-subprojects/analysis-kotlin-descriptors/api/analysis-kotlin-descriptors.api
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dokka-subprojects/analysis-kotlin-descriptors/api/analysis-kotlin-descriptors.api
diff --git a/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts b/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts
new file mode 100644
index 00000000..8d076bf5
--- /dev/null
+++ b/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts
@@ -0,0 +1,29 @@
+/*
+ * 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-shadow")
+}
+
+overridePublicationArtifactId("analysis-kotlin-descriptors")
+
+dependencies {
+ // to override some interfaces (JvmAnnotationEnumFieldValue, JvmAnnotationConstantValue) from compiler since thet are empty there
+ // should be `api` since we already have it in :analysis-java-psi
+ api(libs.intellij.java.psi.api) {
+ isTransitive = false
+ }
+ implementation(projects.dokkaSubprojects.analysisKotlinApi)
+ implementation(projects.dokkaSubprojects.analysisKotlinDescriptorsCompiler)
+ implementation(projects.dokkaSubprojects.analysisKotlinDescriptorsIde)
+}
+
+tasks.shadowJar {
+ // service files are merged to make sure all Dokka plugins
+ // from the dependencies are loaded, and not just a single one.
+ mergeServiceFiles()
+}