This repository has been archived by the owner on Sep 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
77 lines (63 loc) · 2.04 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
idea
java
`java-library`
kotlin("jvm") version "1.4.30-M1"
id("com.github.johnrengelman.shadow") version "6.1.0"
maven
}
group = "io.github.openminigameserver"
version = "1.1.3-SNAPSHOT"
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.enginehub.org/repo/")
maven("https://libraries.minecraft.net")
maven("https://repo.spongepowered.org/maven")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
}
val configurateVersion = "4.0.0"
dependencies {
compileOnly(minestom("7a54b4162d"))
testApi(minestom("7a54b4162d"))
api("com.sk89q.worldedit:worldedit-core:7.3.0-SNAPSHOT")
compileOnly(kotlin("stdlib-jdk8"))
implementation("org.spongepowered:configurate-yaml:$configurateVersion") {
exclude(module = "geantyref")
}
implementation("org.spongepowered:configurate-extra-kotlin:$configurateVersion")
}
tasks {
shadowJar {
archiveClassifier.set("")
}
val templateContext = mapOf("version" to project.version.toString())
processResources {
expand(*templateContext.toList().toTypedArray())
}
create<Copy>("generateKotlinBuildInfo") {
inputs.properties(templateContext) // for gradle up-to-date check
from("src/template/kotlin/")
into("$buildDir/generated/kotlin/")
expand(*templateContext.toList().toTypedArray())
}
kotlin.sourceSets["main"].kotlin.srcDir("$buildDir/generated/kotlin")
compileKotlin.get().dependsOn(get("generateKotlinBuildInfo"))
}
fun minestom(commit: String): String {
return "com.github.Minestom:Minestom:$commit"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}