summaryrefslogtreecommitdiff
path: root/platform-velocity/build.gradle.kts
blob: 9f35faeab1c80d344e54e90e01109638f13efd44 (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
plugins {
    kotlin("jvm")
    kotlin("plugin.serialization")
    id("com.gradleup.shadow")
}

version = findProperty("velocityVersion")?.toString() ?: "0.0.0"

repositories {
    maven("https://repo.papermc.io/repository/maven-public/") {
        name = "papermc-repo"
    }
}

dependencies {
    // Engine module (provides serialization)
    api(project(":engine"))

    // Velocity-specific dependencies
    compileOnly("com.velocitypowered:velocity-api:4.0.0")

    // Test dependencies
    testImplementation("com.velocitypowered:velocity-api:4.0.0")
    testImplementation("io.mockk:mockk:1.14.11")
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.11.0")
}

tasks {
    shadowJar {
        archiveClassifier.set("velocity")
        archiveBaseName.set("LunaticChat")
    }

    jar {
        enabled = false
    }

    processResources {
        val gitCommitHash =
            providers
                .exec {
                    commandLine("git", "rev-parse", "--short", "HEAD")
                }.standardOutput
                .asText
                .get()
                .trim()

        val isNightly = providers.gradleProperty("isNightly").orNull?.toBoolean() ?: false
        val props =
            mapOf(
                "version" to project.version,
                "gitCommitHash" to gitCommitHash,
                "channel" to if (isNightly) "nightly" else "stable",
            )
        inputs.properties(props)
        filteringCharset = "UTF-8"
        filesMatching("velocity-plugin.json") {
            expand(props)
        }
    }

    build {
        dependsOn(shadowJar)
    }
}