Skip to content

Commit

Permalink
Make integration tests runnable from IDEA
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Oct 27, 2023
1 parent b393a12 commit b3913d0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ plugins {
kotlin("jvm")
}

val rootProjectsWithoutDependencyOnDokkaCore = listOf("dokka-integration-tests")

kotlin {
explicitApi()
compilerOptions {
allWarningsAsErrors.set(true)
languageVersion.set(dokkaBuild.kotlinLanguageLevel)
apiVersion.set(dokkaBuild.kotlinLanguageLevel)
optIn.addAll(
"kotlin.RequiresOptIn",
"org.jetbrains.dokka.InternalDokkaApi"
)

// These projects know nothing about the `@InternalDokkaApi` annotation, so the Kotlin compiler
// will complain about an unresolved opt-in requirement marker and fail the build if it's not excluded.
if (rootProject.name !in rootProjectsWithoutDependencyOnDokkaCore) {
optIn.addAll(
"kotlin.RequiresOptIn",
"org.jetbrains.dokka.InternalDokkaApi"
)
}

freeCompilerArgs.addAll(
// need 1.4 support, otherwise there might be problems
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ registerParentTaskOfIncludedBuilds("publishPlugins", groupName = "publication")
it.name in listOf("gradle-plugin-classic")
}

tasks.register("integrationTest") {
group = "verification"
description = "Runs integration tests of this project. Might take a while and require additional setup."
dependsOn(gradle.includedBuilds.single { it.name == "dokka-integration-tests" }.task(":integrationTest"))
}

fun addDependencyOnSameTaskOfIncludedBuilds(existingTaskName: String, filter: (IncludedBuild) -> Boolean = { true }) {
tasks.named(existingTaskName) {
dependsOn(includedBuildTasks(existingTaskName, filter))
Expand Down
1 change: 1 addition & 0 deletions dokka-integration-tests/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {

dependencies {
implementation(kotlin("test-junit5"))
implementation(libs.junit.jupiterApi)
implementation(projects.utilities)
}

Expand Down
1 change: 1 addition & 0 deletions dokka-integration-tests/maven/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies {
implementation(projects.utilities)

implementation(kotlin("test-junit5"))
implementation(libs.junit.jupiterApi)
}

val dokkaSubprojects = gradle.includedBuild("dokka-subprojects")
Expand Down

0 comments on commit b3913d0

Please sign in to comment.