generated from Project-Cepi/ExampleExtension
/
build.gradle.kts
executable file
·132 lines (99 loc) · 3.47 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
kotlin("jvm") version "1.6.0"
id("com.github.johnrengelman.shadow") version "7.1.0"
id("org.jetbrains.dokka") version "1.9.0"
kotlin("plugin.serialization") version "1.5.0"
`maven-publish`
// Apply the application plugin to add support for building a jar
java
}
repositories {
// Use mavenCentral
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://repo.spongepowered.org/maven")
maven(url = "https://repo.velocitypowered.com/snapshots/")
}
dependencies {
// Align versions of all Kotlin components
compileOnly(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK standard library.
compileOnly(kotlin("stdlib"))
// Use the Kotlin reflect library.
compileOnly(kotlin("reflect"))
// Use the JUpiter test library.
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
// Compile Minestom into project
compileOnly("com.github.Minestom", "Minestom", "7867313290")
// implement KStom
compileOnly("com.github.Project-Cepi:KStom:82f7000079")
// add energy
compileOnly("com.github.Project-Cepi:EnergyExtension:f2bcdfc79e")
// import kotlinx serialization
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
// Add MiniMessage
compileOnly("net.kyori:adventure-text-minimessage:4.10.1")
// Add Kepi
compileOnly("com.github.Project-Cepi:Kepi:071b288ed0")
// Add Gooey
compileOnly("com.github.Project-Cepi:Gooey:91e5ca7944")
// Add projectiles
compileOnly("com.github.Project-Cepi:Projectiles:8191a5b6f8")
// Add mobs
compileOnly("com.github.Project-Cepi:MobExtension:0ed0fc125e")
// Add actions
compileOnly("com.github.Project-Cepi:Actions:3cccca74c8")
// Add Particable
compileOnly("com.github.Project-Cepi:Particable:9ab0e20842")
// Add MinestomPVP
compileOnly("com.github.Project-Cepi:MinestomPVP:b9cb14d4bf")
// Add canvas
implementation("com.github.Project-Cepi:canvas:a61710f9e2")
}
tasks.withType<Test> {
useJUnitPlatform()
}
configurations {
testImplementation {
extendsFrom(configurations.compileOnly.get())
}
}
// Take gradle.properties and apply it to resources.
tasks {
processResources {
// Apply properties to extension.json
filesMatching("META-INF/extension.json") {
expand(project.properties)
}
}
// Set name, minimize, and merge service files
named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
archiveBaseName.set(project.name)
mergeServiceFiles()
minimize()
}
withType<Test> { useJUnitPlatform() }
// Make build depend on shadowJar as shading dependencies will most likely be required.
build { dependsOn(shadowJar) }
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "17" }
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes")
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.properties["group"] as? String?
artifactId = project.name
version = project.properties["version"] as? String?
from(components["java"])
}
}
}