GeyserMC/core/build.gradle.kts

160 lines
5.1 KiB
Text
Raw Normal View History

2022-02-27 23:38:55 +01:00
plugins {
// Allow blossom to mark sources root of templates
idea
NeoForge Platform Support (#3781) * Initial work on Forge platform * Rework modded platforms to use a common module * Add support for integrated worlds on modded platforms * Fix classload errors and move mixins to shared module * Fix Fabric mixins and check min height in mod world manager * Add Forge command support * Add back modrinth publishing * Don't apply application plugin to shared mod sources * Fix docs * Delete unused class * Clean up repositories * - Update to 1.20.2 - set custom refmap name - fixed console commands crashing the server (hasPermission now accepts CommandSourceStack instead of Player) - Forge wants fastutil relocated, so be it Current issues: - ClassNotFound exceptions with classes that are clearly present * - Fix ClassNotFound errors on Forge due to weird Classloader - Dont relocate gson * merge upstream * oh no * Bump lombok, architectury-loom * init: neoforge 1.20.4 support * NeoForge builds Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Archive neoforge artifacts * transformForge -> transformNeoForge * Neoforge boots! * Fix mixins on neoforge * Update build/pr file names * Update mods.toml to new neoforge standard * Fix refmap naming * more fixes - no need to include gson - cleanup nullable/nonnull annotations - add more info to geyser dumps on neoforge * yeet platform executor * yet another temp branch to figure out the runServer task * yeet transitive dependency, that cant be right * Attempt at getting the runServer task to work, part two * Revert the changes for the runServer task, try and shut down the injector * Remove spigot weird bug workaround, shut down properly Also add a compileOnly dependency for the mod module to get rid of spammy false warnings * Update to latest restart changes - fix duplicate nodes crashing neoforge - connector -> geyser in GeyserModCommandExecutor - create command manager early to fix issues with permission gather event * Consistent NeoForge spelling, move some dependencies to the version toml * Add lombok to version catalogue * Add plugins to version catalogue * revert move to buildSrc * Create `assets/geyser/icon.png` to reference icon from a single file on standalone/neoforge/fabric * add fabric permissions api to libs.versions.toml --------- Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> Co-authored-by: onebeastchris <github@onechris.mozmail.com> Co-authored-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
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 {
constraints {
implementation(libs.raknet) // Ensure protocol does not override the RakNet version
}
2022-02-27 23:38:55 +01:00
api(projects.common)
Merge remote-tracking branch 'origin/master' # Conflicts: # api/src/main/java/org/geysermc/geyser/api/GeyserApi.java # api/src/main/java/org/geysermc/geyser/api/command/Command.java # api/src/main/java/org/geysermc/geyser/api/command/CommandExecutor.java # api/src/main/java/org/geysermc/geyser/api/command/CommandSource.java # api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java # api/src/main/java/org/geysermc/geyser/api/event/EventBus.java # api/src/main/java/org/geysermc/geyser/api/event/EventRegistrar.java # api/src/main/java/org/geysermc/geyser/api/event/EventSubscriber.java # api/src/main/java/org/geysermc/geyser/api/event/ExtensionEventBus.java # api/src/main/java/org/geysermc/geyser/api/event/ExtensionEventSubscriber.java # api/src/main/java/org/geysermc/geyser/api/event/connection/ConnectionEvent.java # api/src/main/java/org/geysermc/geyser/api/event/downstream/ServerDefineCommandsEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineCommandsEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineCustomItemsEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserLoadResourcePacksEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserPostInitializeEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserPreInitializeEvent.java # api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserShutdownEvent.java # api/src/main/java/org/geysermc/geyser/api/extension/Extension.java # api/src/main/java/org/geysermc/geyser/api/extension/ExtensionDescription.java # api/src/main/java/org/geysermc/geyser/api/extension/ExtensionLoader.java # api/src/main/java/org/geysermc/geyser/api/extension/ExtensionLogger.java # api/src/main/java/org/geysermc/geyser/api/extension/ExtensionManager.java # api/src/main/java/org/geysermc/geyser/api/extension/exception/InvalidDescriptionException.java # api/src/main/java/org/geysermc/geyser/api/extension/exception/InvalidExtensionException.java # api/src/main/java/org/geysermc/geyser/api/item/custom/CustomItemData.java # api/src/main/java/org/geysermc/geyser/api/item/custom/CustomItemOptions.java # api/src/main/java/org/geysermc/geyser/api/item/custom/CustomRenderOffsets.java # api/src/main/java/org/geysermc/geyser/api/item/custom/NonVanillaCustomItemData.java # api/src/main/java/org/geysermc/geyser/api/network/AuthType.java # api/src/main/java/org/geysermc/geyser/api/network/BedrockListener.java # api/src/main/java/org/geysermc/geyser/api/network/RemoteServer.java # api/src/main/java/org/geysermc/geyser/api/util/TriState.java # core/build.gradle.kts # gradle/libs.versions.toml # settings.gradle.kts
2023-02-09 17:34:27 +01:00
api(projects.api)
2022-02-27 23:38:55 +01:00
// Jackson JSON and YAML serialization
api(libs.bundles.jackson)
api(libs.guava)
2022-02-27 23:38:55 +01:00
// Fastutil Maps
implementation(libs.bundles.fastutil)
2022-02-27 23:38:55 +01:00
// Network libraries
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
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
}
implementation(libs.raknet) {
exclude("io.netty", "*")
2022-02-27 23:38:55 +01: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
api(libs.netty.handler)
2022-02-27 23:38:55 +01: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" } }
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
api(libs.erosion.common) {
isTransitive = false
}
2022-02-27 23:38:55 +01:00
// Test
testImplementation(libs.junit)
2022-02-27 23:38:55 +01:00
// Annotation Processors
2022-03-20 03:13:37 +01:00
compileOnly(projects.ap)
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
}
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,
"projectVersion" to info.version,
"commit" to info.commit,
"commitAbbrev" to info.commitAbbrev,
"commitMessage" to info.commitMessage,
"repository" to info.repository
)
}
}
sourceSets {
main {
blossom {
val info = GitInfo()
javaSources {
2024-07-01 04:03:30 +02:00
property("version", info.version)
property("gitVersion", info.gitVersion)
property("buildNumber", info.buildNumber.toString())
property("branch", info.branch)
property("commit", info.commit)
property("repository", info.repository)
property("devVersion", info.isDev.toString())
}
}
}
2022-02-28 06:01:24 +01:00
}
fun buildNumber(): Int =
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
fun isDevBuild(branch: String, repository: String): Boolean {
return branch != "master" || repository.equals("https://github.com/GeyserMC/Geyser", ignoreCase = true).not()
}
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
val isDev: Boolean
init {
branch = indraGit.branchName() ?: "DEV"
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") ?: ""
buildNumber = buildNumber()
isDev = isDevBuild(branch, repository)
val projectVersion = if (isDev) project.version else project.version.toString().replace("SNAPSHOT", "b${buildNumber}")
version = "$projectVersion ($gitVersion)"
}
}
2023-05-27 15:05:41 +02: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-07-01 04:03:30 +02:00
}