2022-02-27 22:38:55 +00:00
|
|
|
plugins {
|
2024-06-20 17:29:42 +00:00
|
|
|
// Allow blossom to mark sources root of templates
|
|
|
|
idea
|
2024-02-23 16:58:39 +00:00
|
|
|
alias(libs.plugins.blossom)
|
2022-04-24 18:35:49 +00:00
|
|
|
id("geyser.publish-conventions")
|
2022-02-27 22:38:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-04-17 03:52:46 +00:00
|
|
|
constraints {
|
|
|
|
implementation(libs.raknet) // Ensure protocol does not override the RakNet version
|
|
|
|
}
|
|
|
|
|
2022-02-27 22:38:55 +00:00
|
|
|
api(projects.common)
|
2023-02-09 16:34:27 +00:00
|
|
|
api(projects.api)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
|
|
|
// Jackson JSON and YAML serialization
|
2022-09-26 15:43:17 +00:00
|
|
|
api(libs.bundles.jackson)
|
2024-05-23 23:57:22 +00:00
|
|
|
annotationProcessor(libs.configurate.`interface`.ap)
|
|
|
|
api(libs.configurate.`interface`)
|
|
|
|
implementation(libs.configurate.yaml)
|
2022-09-26 15:43:17 +00:00
|
|
|
api(libs.guava)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
2024-06-26 16:49:42 +00:00
|
|
|
compileOnly(libs.gson.record.factory) {
|
|
|
|
isTransitive = false
|
|
|
|
}
|
|
|
|
|
2022-02-27 22:38:55 +00:00
|
|
|
// Fastutil Maps
|
2022-09-26 15:43:17 +00:00
|
|
|
implementation(libs.bundles.fastutil)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
|
|
|
// Network libraries
|
2022-09-26 15:43:17 +00:00
|
|
|
implementation(libs.websocket)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
2022-10-30 00:23:21 +00:00
|
|
|
api(libs.bundles.protocol)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
2022-09-26 15:43:17 +00:00
|
|
|
api(libs.mcauthlib)
|
|
|
|
api(libs.mcprotocollib) {
|
2022-09-20 18:25:39 +00:00
|
|
|
exclude("io.netty", "netty-all")
|
2022-03-20 01:46:30 +00:00
|
|
|
exclude("com.github.GeyserMC", "packetlib")
|
|
|
|
exclude("com.github.GeyserMC", "mcauthlib")
|
2022-02-27 22:38:55 +00:00
|
|
|
}
|
|
|
|
|
2022-09-26 15:43:17 +00:00
|
|
|
implementation(libs.raknet) {
|
2023-06-17 01:39:53 +00:00
|
|
|
exclude("io.netty", "*")
|
2022-02-27 22:38:55 +00:00
|
|
|
}
|
|
|
|
|
2022-09-26 15:43:17 +00:00
|
|
|
implementation(libs.netty.resolver.dns)
|
|
|
|
implementation(libs.netty.resolver.dns.native.macos) { artifact { classifier = "osx-x86_64" } }
|
|
|
|
implementation(libs.netty.codec.haproxy)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
|
|
|
// Network dependencies we are updating ourselves
|
2022-09-26 15:43:17 +00:00
|
|
|
api(libs.netty.handler)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
2022-09-26 15:43:17 +00:00
|
|
|
implementation(libs.netty.transport.native.epoll) { artifact { classifier = "linux-x86_64" } }
|
|
|
|
implementation(libs.netty.transport.native.epoll) { artifact { classifier = "linux-aarch_64" } }
|
|
|
|
implementation(libs.netty.transport.native.kqueue) { artifact { classifier = "osx-x86_64" } }
|
2024-04-19 09:50:40 +00:00
|
|
|
implementation(libs.netty.transport.native.io.uring) { artifact { classifier = "linux-x86_64" } }
|
|
|
|
implementation(libs.netty.transport.native.io.uring) { artifact { classifier = "linux-aarch_64" } }
|
2022-02-27 22:38:55 +00:00
|
|
|
|
|
|
|
// Adventure text serialization
|
2022-10-24 17:26:28 +00:00
|
|
|
api(libs.bundles.adventure)
|
2022-02-27 22:38:55 +00:00
|
|
|
|
2023-03-30 19:44:55 +00:00
|
|
|
api(libs.erosion.common) {
|
|
|
|
isTransitive = false
|
|
|
|
}
|
|
|
|
|
2022-02-27 22:38:55 +00:00
|
|
|
// Test
|
2022-09-26 15:43:17 +00:00
|
|
|
testImplementation(libs.junit)
|
2024-06-26 16:49:42 +00:00
|
|
|
testImplementation(libs.gson.runtime) // Record support
|
2022-02-27 22:38:55 +00:00
|
|
|
|
|
|
|
// Annotation Processors
|
2022-03-20 02:13:37 +00:00
|
|
|
compileOnly(projects.ap)
|
2022-02-27 23:26:50 +00:00
|
|
|
|
2022-02-27 22:38:55 +00:00
|
|
|
annotationProcessor(projects.ap)
|
2023-04-22 18:53:46 +00:00
|
|
|
|
|
|
|
api(libs.events)
|
2022-02-27 22:38:55 +00:00
|
|
|
}
|
|
|
|
|
2022-09-19 15:22:09 +00:00
|
|
|
tasks.processResources {
|
|
|
|
// This is solely for backwards compatibility for other programs that used this file before the switch to gradle.
|
|
|
|
// It used to be generated by the maven Git-Commit-Id-Plugin
|
|
|
|
filesMatching("git.properties") {
|
|
|
|
val info = GitInfo()
|
|
|
|
expand(
|
|
|
|
"branch" to info.branch,
|
|
|
|
"buildNumber" to info.buildNumber,
|
2024-06-22 18:32:29 +00:00
|
|
|
"projectVersion" to info.version,
|
2022-09-19 15:22:09 +00:00
|
|
|
"commit" to info.commit,
|
|
|
|
"commitAbbrev" to info.commitAbbrev,
|
|
|
|
"commitMessage" to info.commitMessage,
|
|
|
|
"repository" to info.repository
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2022-02-28 04:43:06 +00:00
|
|
|
|
2024-06-20 17:29:42 +00:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
blossom {
|
|
|
|
val info = GitInfo()
|
|
|
|
javaSources {
|
2024-06-22 18:32:29 +00:00
|
|
|
property("version", "${info.version} (${info.gitVersion})")
|
2024-06-20 17:29:42 +00:00
|
|
|
property("gitVersion", info.gitVersion)
|
|
|
|
property("buildNumber", info.buildNumber.toString())
|
|
|
|
property("branch", info.branch)
|
|
|
|
property("commit", info.commit)
|
|
|
|
property("repository", info.repository)
|
2024-06-22 18:32:29 +00:00
|
|
|
property("devVersion", info.isDev.toString())
|
2024-06-20 17:29:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-28 05:01:24 +00:00
|
|
|
}
|
|
|
|
|
2024-06-22 18:32:29 +00:00
|
|
|
fun buildNumber(): Int =
|
2024-04-20 01:47:00 +00:00
|
|
|
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
|
2022-09-19 15:22:09 +00:00
|
|
|
|
2024-06-22 18:32:29 +00:00
|
|
|
fun isDevBuild(branch: String, repository: String): Boolean {
|
|
|
|
return branch != "master" || repository.equals("https://github.com/GeyserMC/Geyser", ignoreCase = true).not()
|
|
|
|
}
|
|
|
|
|
2022-09-19 15:22:09 +00:00
|
|
|
inner class GitInfo {
|
|
|
|
val branch: String
|
|
|
|
val commit: String
|
|
|
|
val commitAbbrev: String
|
|
|
|
|
|
|
|
val gitVersion: String
|
|
|
|
val version: String
|
|
|
|
val buildNumber: Int
|
|
|
|
|
|
|
|
val commitMessage: String
|
|
|
|
val repository: String
|
|
|
|
|
2024-06-22 18:32:29 +00:00
|
|
|
val isDev: Boolean
|
|
|
|
|
2022-09-19 15:22:09 +00:00
|
|
|
init {
|
2024-06-22 18:32:29 +00:00
|
|
|
branch = indraGit.branchName() ?: "DEV"
|
2022-09-19 15:22:09 +00:00
|
|
|
|
|
|
|
val commit = indraGit.commit()
|
|
|
|
this.commit = commit?.name ?: "0".repeat(40)
|
|
|
|
commitAbbrev = commit?.name?.substring(0, 7) ?: "0".repeat(7)
|
|
|
|
|
|
|
|
gitVersion = "git-${branch}-${commitAbbrev}"
|
|
|
|
|
|
|
|
val git = indraGit.git()
|
|
|
|
commitMessage = git?.commit()?.message ?: ""
|
|
|
|
repository = git?.repository?.config?.getString("remote", "origin", "url") ?: ""
|
2024-06-22 18:32:29 +00:00
|
|
|
|
|
|
|
buildNumber = buildNumber()
|
|
|
|
isDev = isDevBuild(branch, repository)
|
|
|
|
val projectVersion = if (isDev) project.version else project.version.toString().replace("SNAPSHOT", "b${buildNumber}")
|
|
|
|
version = "$projectVersion ($gitVersion)"
|
2022-09-19 15:22:09 +00:00
|
|
|
}
|
|
|
|
}
|
2023-05-27 13:05:41 +00:00
|
|
|
|
2024-03-11 07:29:27 +00:00
|
|
|
// Manual task to download the bedrock data files from the CloudburstMC/Data repository
|
|
|
|
// Invoke with ./gradlew :core:downloadBedrockData --suffix=1_20_70
|
|
|
|
// Set suffix to the current Bedrock version
|
|
|
|
tasks.register<DownloadFilesTask>("downloadBedrockData") {
|
|
|
|
urls = listOf(
|
|
|
|
"https://raw.githubusercontent.com/CloudburstMC/Data/master/entity_identifiers.dat",
|
|
|
|
"https://raw.githubusercontent.com/CloudburstMC/Data/master/biome_definitions.dat",
|
|
|
|
"https://raw.githubusercontent.com/CloudburstMC/Data/master/block_palette.nbt",
|
|
|
|
"https://raw.githubusercontent.com/CloudburstMC/Data/master/creative_items.json",
|
|
|
|
"https://raw.githubusercontent.com/CloudburstMC/Data/master/runtime_item_states.json"
|
|
|
|
)
|
|
|
|
suffixedFiles = listOf("block_palette.nbt", "creative_items.json", "runtime_item_states.json")
|
|
|
|
|
|
|
|
destinationDir = "$projectDir/src/main/resources/bedrock"
|
2024-06-26 14:17:21 +00:00
|
|
|
}
|