ViaFabricPlus/build.gradle

115 lines
3.2 KiB
Groovy
Raw Normal View History

2023-02-19 23:17:33 +01:00
plugins {
id "vfp.base-conventions"
2023-02-19 23:17:33 +01:00
}
2023-10-24 03:24:58 +02:00
base {
archivesName = "ViaFabricPlus"
}
loom {
accessWidenerPath = file("src/main/resources/viafabricplus.accesswidener")
2023-10-24 03:24:58 +02:00
}
2023-02-19 23:17:33 +01:00
2023-02-21 04:24:49 +01:00
configurations {
jij // jar in jar configuration
modJij // jar in jar configuration for mods
include.extendsFrom modJij
modImplementation.extendsFrom modJij
modCompileOnlyApi.extendsFrom modJij
2023-02-21 04:24:49 +01:00
}
2023-02-19 23:17:33 +01:00
dependencies {
modJij fabricApi.module("fabric-api-base", project.fabric_api_version)
modJij fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)
modJij fabricApi.module("fabric-networking-api-v1", project.fabric_api_version)
modJij fabricApi.module("fabric-command-api-v2", project.fabric_api_version)
modJij fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version)
modJij fabricApi.module("fabric-particles-v1", project.fabric_api_version)
modJij fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version)
2024-12-23 20:18:02 +01:00
// Workaround resolution errors by not using jij tasks
include implementation(project(":viafabricplus-api"))
include implementation(project(":viafabricplus-api-legacy"))
jij "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
jij "com.viaversion:viabackwards-common:5.2.1-SNAPSHOT"
2024-12-16 01:29:53 +01:00
jij "net.raphimc:viaaprilfools-common:3.0.4"
jij "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT"
jij ("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") {
exclude group: "io.jsonwebtoken"
exclude group: "com.mojang", module: "brigadier"
}
2024-12-16 01:29:53 +01:00
jij ("net.raphimc:ViaLoader:3.0.4") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
2024-09-26 00:50:23 +02:00
jij ("net.raphimc:MinecraftAuth:4.1.1") {
2023-10-24 03:24:58 +02:00
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
}
jij "net.lenni0451:Reflect:1.4.0"
jij("net.lenni0451:MCPing:1.4.2") {
exclude group: "com.google.code.gson", module: "gson"
}
2023-03-15 00:47:06 +01:00
2024-08-05 17:00:14 +02:00
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
exclude group: "io.netty"
}
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT"
modCompileOnly "com.terraformersmc:modmenu:12.0.0"
// Fabric's jar in jar system doesn't support transitive dependencies, so we have to manually add them
afterEvaluate {
2024-06-10 17:28:52 +02:00
configurations.jij.incoming.resolutionResult.allDependencies.each {
dependencies.include(dependencies.implementation(dependencies.compileOnlyApi(it.requested.toString()) {
transitive = false
}))
}
}
2023-02-19 23:17:33 +01:00
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
2024-08-05 17:26:18 +02:00
"description": project.description,
"implVersion": "git-${project.name}-${project.version}:${latestCommitHash().get()}",
2024-08-08 17:59:40 +02:00
"mcVersion": mcVersion()
)
}
}
2024-08-08 17:59:40 +02:00
String mcVersion() {
if (project.supported_versions.isEmpty()) {
return project.minecraft_version
} else {
return project.supported_versions
}
}
Provider<String> latestCommitHash() {
return providers.exec {
commandLine = ["git", "rev-parse", "--short", "HEAD"]
}.standardOutput.getAsText().map(String::trim)
2023-02-19 23:17:33 +01:00
}
jar {
2023-10-24 03:24:58 +02:00
// Rename the project's license file to LICENSE_<project_name> to avoid conflicts
from("LICENSE") {
rename {
"${it}_${project.archivesBaseName}"
}
}
2023-02-19 23:17:33 +01:00
}
2023-06-01 16:13:57 +02:00
2023-12-25 20:30:50 +01:00
idea {
module {
["run"].each {
excludeDirs << file("$it")
}
}
}