-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
102 lines (85 loc) · 2.83 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
plugins {
`java-library`
`maven-publish`
// lombok
id("io.freefair.lombok") version "6.2.0"
// shadowJar
id("com.github.johnrengelman.shadow") version "7.1.2"
}
val clayUsername: String by project
val clayPassword: String by project
val gprUser: String by project
val gprKey: String by project
allprojects {
plugins.apply("java-library")
plugins.apply("maven-publish")
if (path != ":") {
group = "com.mineclay.tclite${path.split(":").dropLast(1).joinToString(".")}"
}
java {
withSourcesJar()
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
}
tasks.compileJava {
options.encoding = "UTF-8"
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
}
}
repositories {
val snapshot = version.toString().endsWith("-SNAPSHOT")
if (clayUsername.isNotEmpty()) {
maven("https://maven.mineclay.com/repository/zhua-${if (snapshot) "snapshot" else "release"}/") {
credentials {
username = clayUsername
password = clayPassword
}
}
}
if (gprUser.isNotEmpty()) {
maven("https://maven.pkg.github.com/theTd/tclite") {
credentials {
username = gprUser
password = gprKey
}
}
}
}
}
}
repositories {
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.dmulloy2.net/repository/public/")
mavenCentral()
}
dependencies {
api(project(":nativeport-api"))
api("com.github.cryptomorin:XSeries:11.2.0.1")
compileOnly("com.comphenix.protocol:ProtocolLib:4.8.0")
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
api("org.jetbrains:annotations:22.0.0")
api("com.google.code.findbugs:jsr305:3.0.2")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT")
testCompileOnly("org.jetbrains:annotations:22.0.0")
// mockito
testImplementation("org.mockito:mockito-inline:3.12.4")
testImplementation("org.mockito:mockito-junit-jupiter:3.12.4")
}
tasks.test {
useJUnitPlatform()
}
tasks.jar {
val nativeports = project.subprojects.filter { it.path.startsWith(":nativeport") }
dependsOn(nativeports.map { it.tasks.build })
nativeports.map {
it.tasks.jar.get().outputs.files.singleFile.absolutePath.replace("-dev.jar", ".jar")
}.forEach {
from(zipTree(file(it)))
}
}