Skip to content

Commit

Permalink
cli integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Oct 23, 2023
1 parent b5d971c commit bf27c4f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
35 changes: 23 additions & 12 deletions dokka-integration-tests/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("org.jetbrains.conventions.dokka-integration-test")
id("com.github.johnrengelman.shadow")
alias(libs.plugins.shadow)
}

val dokka_version: String by project
evaluationDependsOn(":runners:cli")
evaluationDependsOn(":plugins:base")

dependencies {
implementation(kotlin("test-junit5"))
implementation(projects.integrationTestUtilities)
Expand All @@ -25,16 +21,31 @@ val basePluginShadow: Configuration by configurations.creating {
}
}

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 {
basePluginShadow(projects.plugins.base)
cliConfiguration("org.jetbrains.dokka:cli")

basePluginShadow("org.jetbrains.dokka:plugin-base")

// TODO [beresnev] analysis switcher
basePluginShadow(project(path = ":subprojects:analysis-kotlin-descriptors", configuration = "shadow"))
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-$dokka_version.jar")
archiveFileName.set("fat-base-plugin-${project.version}.jar")
archiveClassifier.set("")

// service files are merged to make sure all Dokka plugins
Expand All @@ -43,10 +54,10 @@ val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::clas
}

tasks.integrationTest {
dependsOn(cliConfiguration)
dependsOn(basePluginShadowJar)

inputs.dir(file("projects"))
val cliJar = tasks.getByPath(":runners:cli:shadowJar") as ShadowJar
environment("CLI_JAR_PATH", cliJar.archiveFile.get())
environment("CLI_JAR_PATH", cliConfiguration.singleFile)
environment("BASE_PLUGIN_JAR_PATH", basePluginShadowJar.archiveFile.get())
dependsOn(cliJar)
dependsOn(basePluginShadowJar)
}
2 changes: 1 addition & 1 deletion dokka-integration-tests/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ includeBuild("../dokka-runners/maven-plugin")
includeBuild("../dokka-subprojects")

include(
// ":cli",
":cli",
":gradle",
":maven",
":integration-test-utilities",
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ kotest-assertionsJson = { module = "io.kotest:kotest-assertions-json" }

kotlinx-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-bcv" }
gradleNode = { id = "com.github.node-gradle.node", version.ref = "gradlePlugin-gradleNode" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "gradlePlugin-shadow" }

0 comments on commit bf27c4f

Please sign in to comment.