Geyser/core/build.gradle.kts

151 lines
4.9 KiB
Text
Raw Normal View History

2022-02-27 22:38:55 +00: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 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 {
constraints {
implementation(libs.raknet) // Ensure protocol does not override the RakNet version
}
2022-02-27 22:38:55 +00: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 16:34:27 +00:00
api(projects.api)
2022-02-27 22:38:55 +00:00
// Jackson JSON and YAML serialization
api(libs.bundles.jackson)
api(libs.guava)
2022-02-27 22:38:55 +00:00
// Fastutil Maps
implementation(libs.bundles.fastutil)
2022-02-27 22:38:55 +00:00
// Network libraries
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
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
}
implementation(libs.raknet) {
exclude("io.netty", "*")
2022-02-27 22:38:55 +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
api(libs.netty.handler)
2022-02-27 22:38:55 +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" } }
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
api(libs.erosion.common) {
isTransitive = false
}
2022-02-27 22:38:55 +00:00
// Test
testImplementation(libs.junit)
2022-02-27 22:38:55 +00:00
// Annotation Processors
2022-03-20 02:13:37 +00:00
compileOnly(projects.ap)
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
}
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 project.version,
"commit" to info.commit,
"commitAbbrev" to info.commitAbbrev,
"commitMessage" to info.commitMessage,
"repository" to info.repository
)
}
}
sourceSets {
main {
blossom {
val info = GitInfo()
javaSources {
property("version", "${project.version} (${info.gitVersion})")
property("gitVersion", info.gitVersion)
property("buildNumber", info.buildNumber.toString())
property("branch", info.branch)
property("commit", info.commit)
property("repository", info.repository)
}
}
}
2022-02-28 05:01:24 +00:00
}
fun Project.buildNumber(): Int =
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
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
init {
// On Jenkins, a detached head is checked out, so indra cannot determine the branch.
// Fortunately, this environment variable is available.
branch = indraGit.branchName() ?: System.getenv("BRANCH_NAME") ?: "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}"
version = "${project.version} ($gitVersion)"
buildNumber = buildNumber()
val git = indraGit.git()
commitMessage = git?.commit()?.message ?: ""
repository = git?.repository?.config?.getString("remote", "origin", "url") ?: ""
}
}
2023-05-27 13:05:41 +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"
}