aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: 689e9215a2314d0297ab9705bff34820fe2e87c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import org.jetbrains.ValidatePublications
import org.jetbrains.publicationChannels

@Suppress("DSL_SCOPE_VIOLATION") // fixed in Gradle 8.1 https://github.com/gradle/gradle/pull/23639
plugins {
    id("org.jetbrains.conventions.base")
    id("org.jetbrains.conventions.dokka")

    alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
    alias(libs.plugins.gradlePublish) apply false // see #3031 for "apply false" reasoning
    alias(libs.plugins.nexusPublish)
}

val dokka_version: String by project

group = "org.jetbrains.dokka"
version = dokka_version


logger.lifecycle("Publication version: $dokka_version")
tasks.register<ValidatePublications>("validatePublications")

nexusPublishing {
    repositories {
        sonatype {
            username.set(System.getenv("SONATYPE_USER"))
            password.set(System.getenv("SONATYPE_PASSWORD"))
        }
    }
}

val dokkaPublish by tasks.registering {
    if (publicationChannels.any { it.isMavenRepository() }) {
        finalizedBy(tasks.named("closeAndReleaseSonatypeStagingRepository"))
    }
}

apiValidation {
    // note that subprojects are ignored by their name, not their path https://github.com/Kotlin/binary-compatibility-validator/issues/16
    ignoredProjects += setOf(
        // NAME                    PATH
        "frontend",            // :plugins:base:frontend

        "kotlin-analysis",     // :kotlin-analysis
        "compiler-dependency", // :kotlin-analysis:compiler-dependency
        "intellij-dependency", // :kotlin-analysis:intellij-dependency

        "integration-tests",   // :integration-tests
        "gradle",              // :integration-tests:gradle
        "cli",                 // :integration-tests:cli
        "maven",               // integration-tests:maven
    )
}