summaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: 8b65cd91d06991599e3accabc4334558f4f8313e (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
71
72
73
74
75
76
77
78
79
80
81
82
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.Coroutines

plugins {
    kotlin("jvm") version "1.2.51"
    id("com.github.johnrengelman.plugin-shadow") version "2.0.3"
}

group = "io.dico"
version = "0.1"

repositories {
    mavenCentral()
    mavenLocal()
    maven("https://dl.bintray.com/kotlin/exposed")
}

kotlin.experimental.coroutines = Coroutines.ENABLE

dependencies {
    compile(kotlin("stdlib-jdk8"))

    shadow(files("../res/spigot-1.13-pre7.jar"))

    compile("io.dico.dicore:dicore3-core:1.2-mc-1.13")
    compile("io.dico.dicore:dicore3-command:1.2-mc-1.13")

    compile("org.jetbrains.exposed:exposed:0.10.3")
    compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.4")
    compile("com.zaxxer:HikariCP:3.2.0")
    compile(files("../h2/bin/h2-client-1.4.197.jar"))

    val jacksonVersion = "2.9.6"
    compile("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
    compile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
    compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
    //compile("org.yaml:snakeyaml:1.21")
    compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")

    shadow("org.slf4j:slf4j-api:1.7.25")
    compile("ch.qos.logback:logback-classic:1.2.3")

    testCompile("junit:junit:4.12")
}

tasks {
    val jar by getting(Jar::class)

    val fatJar by creating(Jar::class) {
        destinationDir = file("$rootDir/debug/plugins")
        baseName = "parcels2-all"
        from(*configurations.compile.map(::zipTree).toTypedArray())
        with(jar)
    }

    val shadowJar by getting(ShadowJar::class) {
        destinationDir = file("$rootDir/debug/plugins")
        baseName = "parcels2-shaded"

        dependencies {
            exclude(dependency(files("../res/spigot-1.13-pre7.jar")))
        }

        relocate("", "io.dico.parcels2.util.") {
            exclude("kotlin*")
            exclude("META-INF/*")
            exclude("logback*xml")
            exclude("plugin*yml")
        }

        relocate("kotlin", "kotlin")
    }

    val relocateSnakeyamlJar by creating(ShadowJar::class) {
        destinationDir = file("$rootDir/debug/plugins")
        baseName = "parcels2-shaded"
        relocate("org.yaml", "shadow.org.yaml")

        from(*project.configurations.compile.map(::zipTree).toTypedArray())
        with(jar)
    }
}