-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
119 lines (106 loc) · 3.78 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
val targetJavaVersion = 8
version = "2.1.6"
group = "city.newnan.violet"
description = "Useful toolkits java library for Bukkit Server Plugin."
plugins {
id("idea")
id("maven-publish")
kotlin("jvm") version "1.6.21"
}
repositories {
mavenLocal()
maven("https://repo.lucko.me/")
maven("https://libraries.minecraft.net/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.songoda.com/repository/public/")
maven("https://nexus.velocitypowered.com/repository/maven-public/")
mavenCentral()
}
dependencies {
listOf(
// Minecraft
"org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT",
// Utils
"me.lucko:helper:5.6.13",
// Gui
"dev.triumphteam:triumph-gui:3.1.2",
// Database
"mysql:mysql-connector-java:8.0.33",
"com.zaxxer:HikariCP:4.0.3",
"org.ktorm:ktorm-core:3.6.0",
// Network
"com.squareup.okhttp3:okhttp:4.11.0",
// ConfigureFile
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
"com.fasterxml.jackson.core:jackson-databind:2.15.2",
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.2",
"com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.2",
"com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.15.2",
"com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2",
"com.fasterxml.jackson.dataformat:jackson-dataformat-properties:2.15.2",
"com.jasonclawson:jackson-dataformat-hocon:1.1.0",
"com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2",
"com.mojang:authlib:1.5.26",
).forEach {
compileOnly(it);
testImplementation(it)
}
// Test
testImplementation(kotlin("test"))
}
tasks.test { useJUnitPlatform() }
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType<JavaCompile>().configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible) {
options.release.set(targetJavaVersion)
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.toVersion(targetJavaVersion).toString()
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
// Applies the component for the release build variant.
from(components["kotlin"])
// You can then customize attributes of the publication as shown below.
groupId = project.group as String
artifactId = project.name
version = project.version as String
pom {
name.set(project.name)
description.set(project.description!!)
url.set("https://github.com/NewNanCity/Violet")
licenses {
license {
name.set("MIT License")
url.set("https://mit-license.org/")
}
}
developers {
developer {
id.set("Gk0Wk")
name.set("Gk0Wk")
email.set("[email protected]")
url.set("https://github.com/Gk0Wk")
organization.set("NewNanCity")
organizationUrl.set("https://github.com/NewNanCity")
}
}
}
}
}
}
}