Improve build files

This commit is contained in:
FlorianMichael 2024-12-27 17:40:44 +01:00
parent 454cc227ef
commit b34f7770fe
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
9 changed files with 51 additions and 51 deletions

View File

@ -1,10 +1,7 @@
plugins {
id "vfp.base-conventions"
id "vfp.mod-conventions"
}
dependencies {
compileOnly project(":viafabricplus-api")
compileOnly "com.viaversion:viaversion-common:${project.viaversion_version}"
compileOnly "net.raphimc:ViaLoader:${project.vialoader_version}"
}

View File

@ -0,0 +1 @@
maven_description=Legacy compatibility for mods using the ViaFabricPlus pre 4.0.0 API.

View File

@ -1,8 +1,3 @@
plugins {
id "vfp.base-conventions"
id "vfp.mod-conventions"
}
dependencies {
compileOnly "com.viaversion:viaversion-common:${project.viaversion_version}"
compileOnly "net.raphimc:ViaLoader:${project.vialoader_version}"
}

1
api/gradle.properties Normal file
View File

@ -0,0 +1 @@
maven_description=Interface for third-party mods to interact with ViaFabricPlus internals.

View File

@ -40,10 +40,31 @@ repositories {
}
}
configurations {
// Workaround Gradle 8+ not supporting including a configuration as dependency by
// just extending a defined configuration later to other configurations :)
vvDependencies
compileOnly.extendsFrom vvDependencies
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
vvDependencies "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
vvDependencies "com.viaversion:viabackwards-common:5.2.1-SNAPSHOT"
vvDependencies "net.raphimc:viaaprilfools-common:3.0.4"
vvDependencies "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT"
vvDependencies ("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") {
exclude group: "io.jsonwebtoken"
exclude group: "com.mojang", module: "brigadier"
}
vvDependencies ("net.raphimc:ViaLoader:3.0.4") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
}
java {

View File

@ -0,0 +1,12 @@
plugins {
id "vfp.base-conventions"
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
"description": project.description
)
}
}

View File

@ -17,9 +17,12 @@ configurations {
include.extendsFrom modJij
modImplementation.extendsFrom modJij
modCompileOnlyApi.extendsFrom modJij
jij.extendsFrom vvDependencies
}
dependencies {
// Fabric API
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)
@ -28,26 +31,17 @@ dependencies {
modJij fabricApi.module("fabric-particles-v1", project.fabric_api_version)
modJij fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version)
// Manually include to ignore dependencies
include implementation(compileOnlyApi(project(path: ":viafabricplus-api", configuration: "namedElements")))
include implementation(compileOnlyApi(project(path: ":viafabricplus-visuals", configuration: "namedElements")))
// Sub projects, since they are Fabric mods as well (mainly to access the game code) we have to first
// implement the namedElements (raw output) to compile against, then include the mappedElements into the output jar1
implementation project(path: ":viafabricplus-api", configuration: "namedElements")
implementation project(path: ":viafabricplus-api-legacy", configuration: "namedElements")
implementation project(path: ":viafabricplus-visuals", configuration: "namedElements")
// Will be removed in future versions
include implementation(compileOnlyApi(project(":viafabricplus-api-legacy")))
jij "com.viaversion:viaversion-common:${project.viaversion_version}"
jij "com.viaversion:viabackwards-common:${project.viabackwards_version}"
jij "net.raphimc:viaaprilfools-common:${project.viaaprilfools_version}"
jij "net.raphimc:ViaLegacy:${project.vialegacy_version}"
jij ("net.raphimc:ViaBedrock:${project.viabedrock_version}") {
exclude group: "io.jsonwebtoken"
exclude group: "com.mojang", module: "brigadier"
}
jij ("net.raphimc:ViaLoader:${project.vialoader_version}") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
include project(":viafabricplus-api")
include project(":viafabricplus-api-legacy")
include project(":viafabricplus-visuals")
// Dependencies exclusively to the root mod
jij ("net.raphimc:MinecraftAuth:4.1.1") {
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
@ -56,12 +50,12 @@ dependencies {
jij("net.lenni0451:MCPing:1.4.2") {
exclude group: "com.google.code.gson", module: "gson"
}
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
exclude group: "io.netty"
}
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT"
// Only to compile against for the ModMenu integration
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

View File

@ -13,13 +13,5 @@ yarn_version=1.21.4+build.2
loader_version=0.16.9
fabric_api_version=0.112.0+1.21.4
# Via, keeping it here to re-use accross projects without requiring to recompile build scripts
viaversion_version=5.2.1-SNAPSHOT
viabackwards_version=5.2.1-SNAPSHOT
viaaprilfools_version=3.0.4
vialegacy_version=3.0.7-SNAPSHOT
viabedrock_version=0.0.14-SNAPSHOT
vialoader_version=3.0.4
# Set to empty to use the Minecraft version above
supported_versions=

View File

@ -1,5 +1,5 @@
plugins {
id "vfp.base-conventions"
id "vfp.mod-conventions"
}
loom {
@ -11,17 +11,4 @@ dependencies {
modCompileOnly fabricApi.module("fabric-api-base", project.fabric_api_version)
modCompileOnly fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version)
compileOnly "com.viaversion:viaversion-common:${project.viaversion_version}"
compileOnly "net.raphimc:ViaLoader:${project.vialoader_version}"
compileOnly "net.raphimc:ViaLegacy:${project.vialegacy_version}"
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
"description": project.description
)
}
}