summaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: d5d7c86744307e7d7e1bda0f34a8f525741ded8b (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import org.gradle.testing.jacoco.tasks.JacocoReport
import org.jetbrains.dokka.gradle.DokkaExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "2.3.21" apply false
    kotlin("plugin.serialization") version "2.3.21" apply false
    id("com.gradleup.shadow") version "9.4.2" apply false
    id("xyz.jpenilla.run-paper") version "3.0.2" apply false
    id("org.jlleitschuh.gradle.ktlint") version "14.2.0" apply false
    id("org.jetbrains.dokka") version "2.2.0" apply false
}

allprojects {
    group = "dev.m1sk9"

    repositories {
        mavenCentral()
    }
}

subprojects {
    // Skip dokka module (aggregator only, no Kotlin compilation needed)
    if (name == "dokka") return@subprojects

    apply(plugin = "org.jetbrains.kotlin.jvm")
    apply(plugin = "org.jlleitschuh.gradle.ktlint")
    apply(plugin = "org.jetbrains.dokka")
    apply(plugin = "jacoco")

    tasks.withType<KotlinCompile> {
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_25)
        }
    }

    tasks.withType<Test> {
        useJUnitPlatform()
        finalizedBy(tasks.named("jacocoTestReport"))
    }

    tasks.withType<JacocoReport> {
        dependsOn(tasks.withType<Test>())
        reports {
            xml.required.set(true)
            html.required.set(false)
        }
    }

    configure<DokkaExtension> {
        dokkaSourceSets {
            configureEach {
                sourceLink {
                    remoteUrl("https://github.com/m1sk9/LunaticChat/tree/main")
                    localDirectory.set(rootDir)
                }
            }
        }
    }

    afterEvaluate {
        dependencies {
            // Common test dependencies (applied to all subprojects)
            add("testImplementation", "org.jetbrains.kotlin:kotlin-test-junit5")
            add("testImplementation", "org.junit.jupiter:junit-jupiter-api:6.1.0")
            add("testRuntimeOnly", "org.junit.jupiter:junit-jupiter-engine:6.1.0")
        }
    }
}