-
Notifications
You must be signed in to change notification settings - Fork 63
/
build.gradle.kts
118 lines (95 loc) · 3.13 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import gg.essential.gradle.util.setJvmDefault
import java.io.ByteArrayOutputStream
// Version
val targetJavaVersion: String by rootProject
plugins {
java
idea
id("com.github.johnrengelman.shadow")
alias(libs.plugins.idea.ext)
alias(libs.plugins.dokka)
alias(libs.plugins.crowdin) apply(false)
kotlin("jvm") version(libs.versions.kotlin.get())
kotlin("plugin.lombok") version(libs.versions.kotlin.get())
kotlin("kapt") version(libs.versions.kotlin.get())
id("gg.essential.multi-version.root") apply(false)
}
subprojects {
if (project.buildFile.name.equals("root.gradle.kts")) return@subprojects
apply(plugin = "java")
apply(plugin = "idea")
apply(plugin = "maven-publish")
apply(plugin = "kotlin")
apply(plugin = "kotlin-lombok")
if (properties.containsKey("snapshot")) {
val gitCommitHash: String = ByteArrayOutputStream().use { outputStream ->
rootProject.exec {
commandLine("git")
.args("rev-parse", "--verify", "--short", "HEAD")
standardOutput = outputStream
}
outputStream.toString().trim()
}.substring(0, 7) // windows moment?
version = "$version+$gitCommitHash-SNAPSHOT"
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(rootProject.libs.kotlinx.coroutines)
implementation(rootProject.libs.kotlinx.coroutines.jdk8)
implementation(rootProject.libs.kotlinx.json)
compileOnly(rootProject.libs.guava)
compileOnly(rootProject.libs.gson)
api(rootProject.libs.annotations)
api(rootProject.libs.lombok)
annotationProcessor(rootProject.libs.lombok)
testCompileOnly(rootProject.libs.junit.api)
testAnnotationProcessor(rootProject.libs.junit.api)
testRuntimeOnly(rootProject.libs.junit.engine)
testImplementation(rootProject.libs.guava)
testImplementation(rootProject.libs.gson)
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks {
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
compileJava {
options.encoding = Charsets.UTF_8.name()
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
compileKotlin {
setJvmDefault("all")
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xcontext-receivers"
}
}
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.plo.su")
maven("https://repo.plasmoverse.com/snapshots")
maven("https://repo.plasmoverse.com/releases")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://jitpack.io/")
}
}
tasks {
jar {
enabled = false
}
}