aboutsummaryrefslogtreecommitdiff
path: root/dokka-subprojects/analysis-kotlin-descriptors
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-11-10 11:46:54 +0100
committerGitHub <noreply@github.com>2023-11-10 11:46:54 +0100
commit8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch)
tree1b915207b2b9f61951ddbf0ff2e687efd053d555 /dokka-subprojects/analysis-kotlin-descriptors
parenta44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff)
downloaddokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing * Update Gradle to 8.4 * Refactor and simplify convention plugins and build scripts Fixes #3132 --------- Co-authored-by: Adam <897017+aSemy@users.noreply.github.com> Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
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()
+}