2022-02-27 23:38:55 +01:00
|
|
|
plugins {
|
2024-06-20 19:29:42 +02:00
|
|
|
// Allow blossom to mark sources root of templates
|
|
|
|
idea
|
2024-02-23 17:58:39 +01:00
|
|
|
alias(libs.plugins.blossom)
|
2022-04-24 20:35:49 +02:00
|
|
|
id("geyser.publish-conventions")
|
2022-02-27 23:38:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-04-17 05:52:46 +02:00
|
|
|
constraints {
|
|
|
|
implementation(libs.raknet) // Ensure protocol does not override the RakNet version
|
|
|
|
}
|
|
|
|
|
2022-02-27 23:38:55 +01:00
|
|
|
api(projects.common)
|
2023-02-09 17:34:27 +01:00
|
|
|
api(projects.api)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
|
|
|
// Jackson JSON and YAML serialization
|
2022-09-26 17:43:17 +02:00
|
|
|
api(libs.bundles.jackson)
|
2024-05-24 01:57:22 +02:00
|
|
|
annotationProcessor(libs.configurate.`interface`.ap)
|
|
|
|
api(libs.configurate.`interface`)
|
|
|
|
implementation(libs.configurate.yaml)
|
2022-09-26 17:43:17 +02:00
|
|
|
api(libs.guava)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
2024-06-26 18:49:42 +02:00
|
|
|
compileOnly(libs.gson.record.factory) {
|
|
|
|
isTransitive = false
|
|
|
|
}
|
|
|
|
|
2022-02-27 23:38:55 +01:00
|
|
|
// Fastutil Maps
|
2022-09-26 17:43:17 +02:00
|
|
|
implementation(libs.bundles.fastutil)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
|
|
|
// Network libraries
|
2022-09-26 17:43:17 +02:00
|
|
|
implementation(libs.websocket)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
2022-10-30 02:23:21 +02:00
|
|
|
api(libs.bundles.protocol)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
2022-09-26 17:43:17 +02:00
|
|
|
api(libs.mcauthlib)
|
|
|
|
api(libs.mcprotocollib) {
|
2022-09-20 20:25:39 +02:00
|
|
|
exclude("io.netty", "netty-all")
|
2022-03-20 02:46:30 +01:00
|
|
|
exclude("com.github.GeyserMC", "packetlib")
|
|
|
|
exclude("com.github.GeyserMC", "mcauthlib")
|
2022-02-27 23:38:55 +01:00
|
|
|
}
|
|
|
|
|
2022-09-26 17:43:17 +02:00
|
|
|
implementation(libs.raknet) {
|
2023-06-17 03:39:53 +02:00
|
|
|
exclude("io.netty", "*")
|
2022-02-27 23:38:55 +01:00
|
|
|
}
|
|
|
|
|
2022-09-26 17:43:17 +02: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 23:38:55 +01:00
|
|
|
|
|
|
|
// Network dependencies we are updating ourselves
|
2022-09-26 17:43:17 +02:00
|
|
|
api(libs.netty.handler)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
2022-09-26 17:43:17 +02: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 11:50:40 +02: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 23:38:55 +01:00
|
|
|
|
|
|
|
// Adventure text serialization
|
2022-10-24 19:26:28 +02:00
|
|
|
api(libs.bundles.adventure)
|
2022-02-27 23:38:55 +01:00
|
|
|
|
2023-03-30 21:44:55 +02:00
|
|
|
api(libs.erosion.common) {
|
|
|
|
isTransitive = false
|
|
|
|
}
|
|
|
|
|
2022-02-27 23:38:55 +01:00
|
|
|
// Test
|
2022-09-26 17:43:17 +02:00
|
|
|
testImplementation(libs.junit)
|
2024-06-26 18:49:42 +02:00
|
|
|
testImplementation(libs.gson.runtime) // Record support
|
2022-02-27 23:38:55 +01:00
|
|
|
|
|
|
|
// Annotation Processors
|
2022-03-20 03:13:37 +01:00
|
|
|
compileOnly(projects.ap)
|
2022-02-28 00:26:50 +01:00
|
|
|
|
2022-02-27 23:38:55 +01:00
|
|
|
annotationProcessor(projects.ap)
|
2023-04-22 20:53:46 +02:00
|
|
|
|
|
|
|
api(libs.events)
|
2022-02-27 23:38:55 +01:00
|
|
|
}
|
|
|
|
|
2022-09-19 17:22:09 +02: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 20:32:29 +02:00
|
|
|
"projectVersion" to info.version,
|
2022-09-19 17:22:09 +02:00
|
|
|
"commit" to info.commit,
|
|
|
|
"commitAbbrev" to info.commitAbbrev,
|
|
|
|
"commitMessage" to info.commitMessage,
|
|
|
|
"repository" to info.repository
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2022-02-28 05:43:06 +01:00
|
|
|
|
2024-06-20 19:29:42 +02:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
blossom {
|
|
|
|
val info = GitInfo()
|
|
|
|
javaSources {
|
2024-06-22 20:32:29 +02:00
|
|
|
property("version", "${info.version} (${info.gitVersion})")
|
2024-06-20 19:29:42 +02: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 20:32:29 +02:00
|
|
|
property("devVersion", info.isDev.toString())
|
2024-06-20 19:29:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-28 06:01:24 +01:00
|
|
|
}
|
|
|
|
|
2024-06-22 20:32:29 +02:00
|
|
|
fun buildNumber(): Int =
|
2024-04-20 03:47:00 +02:00
|
|
|
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
|
2022-09-19 17:22:09 +02:00
|
|
|
|
2024-06-22 20:32:29 +02:00
|
|
|
fun isDevBuild(branch: String, repository: String): Boolean {
|
|
|
|
return branch != "master" || repository.equals("https://github.com/GeyserMC/Geyser", ignoreCase = true).not()
|
|
|
|
}
|
|
|
|
|
2022-09-19 17:22:09 +02: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 20:32:29 +02:00
|
|
|
val isDev: Boolean
|
|
|
|
|
2022-09-19 17:22:09 +02:00
|
|
|
init {
|
2024-06-22 20:32:29 +02:00
|
|
|
branch = indraGit.branchName() ?: "DEV"
|
2022-09-19 17:22:09 +02: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 20:32:29 +02: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 17:22:09 +02:00
|
|
|
}
|
|
|
|
}
|
2023-05-27 15:05:41 +02:00
|
|
|
|
2024-03-11 08:29:27 +01: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 16:17:21 +02:00
|
|
|
}
|