aboutsummaryrefslogtreecommitdiff
path: root/dokka-integration-tests/cli/build.gradle.kts
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-integration-tests/cli/build.gradle.kts
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-integration-tests/cli/build.gradle.kts')
-rw-r--r--dokka-integration-tests/cli/build.gradle.kts64
1 files changed, 64 insertions, 0 deletions
diff --git a/dokka-integration-tests/cli/build.gradle.kts b/dokka-integration-tests/cli/build.gradle.kts
new file mode 100644
index 00000000..34f1f797
--- /dev/null
+++ b/dokka-integration-tests/cli/build.gradle.kts
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ */
+
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+
+plugins {
+ id("dokkabuild.test-integration")
+ id("com.github.johnrengelman.shadow")
+}
+
+dependencies {
+ implementation(kotlin("test-junit5"))
+ implementation(libs.junit.jupiterApi)
+ implementation(projects.utilities)
+}
+
+/* Create a fat base plugin jar for cli tests */
+val basePluginShadow: Configuration by configurations.creating {
+ attributes {
+ attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime"))
+ }
+}
+
+val cliConfiguration: Configuration by configurations.creating {
+ attributes {
+ attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, Usage.JAVA_RUNTIME))
+ attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling::class.java, Bundling.SHADOWED))
+ }
+ // we should have single artifact here
+ isTransitive = false
+}
+
+dependencies {
+ cliConfiguration("org.jetbrains.dokka:runner-cli")
+
+ basePluginShadow("org.jetbrains.dokka:plugin-base")
+
+ // TODO [beresnev] analysis switcher
+ basePluginShadow("org.jetbrains.dokka:analysis-kotlin-descriptors") {
+ attributes {
+ attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling::class.java, Bundling.SHADOWED))
+ }
+ }
+}
+
+val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::class) {
+ configurations = listOf(basePluginShadow)
+ archiveFileName.set("fat-base-plugin-${project.version}.jar")
+ archiveClassifier.set("")
+
+ // service files are merged to make sure all Dokka plugins
+ // from the dependencies are loaded, and not just a single one.
+ mergeServiceFiles()
+}
+
+tasks.integrationTest {
+ dependsOn(cliConfiguration)
+ dependsOn(basePluginShadowJar)
+
+ inputs.dir(file("projects"))
+ environment("CLI_JAR_PATH", cliConfiguration.singleFile)
+ environment("BASE_PLUGIN_JAR_PATH", basePluginShadowJar.archiveFile.get())
+}