Files
saturnclient/build.gradle
T
2026-03-03 11:32:02 +01:00

190 lines
5.7 KiB
Groovy

/*
* ================================================================
* Saturn Client - Fabric Mod Build Configuration
* ================================================================
*
* This build file configures:
* - Fabric Loom (Minecraft mod development)
* - Dependency management
* - Resource processing
* - Java toolchain (Java 21)
* - Publishing setup
*
* All version values are defined in gradle.properties.
* ================================================================
*/
plugins {
// Fabric mod development plugin
id 'fabric-loom' version '1.9-SNAPSHOT'
// Maven publishing support
id 'maven-publish'
}
/*
* ================================================================
* Project Metadata
* ================================================================
*/
version = project.mod_version
group = project.maven_group
/*
* ================================================================
* Repositories
* ================================================================
* All dependency sources.
*/
repositories {
// Fabric
maven { url 'https://maven.fabricmc.net/' }
// JitPack (GitHub releases)
maven { url 'https://jitpack.io' }
// Parchment mappings (if needed later)
maven { url 'https://maven.parchmentmc.org' }
// Player Animation Library
maven { name = "KoSmX Maven"; url = 'https://maven.kosmx.dev/' }
// Central repository
mavenCentral()
}
/*
* ================================================================
* Dependencies
* ================================================================
*/
dependencies {
// ─────────────────────────────────────────────
// Minecraft Core
// ─────────────────────────────────────────────
minecraft "com.mojang:minecraft:${project.minecraft_version}"
// Yarn mappings (named mappings for dev environment)
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// Fabric Loader
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// ─────────────────────────────────────────────
// Rendering / Model Libraries
// ─────────────────────────────────────────────
// OBJ Reading Library
implementation "de.javagl:obj:0.4.0"
include "de.javagl:obj:0.4.0"
// SVG Rendering Library
include implementation("com.formdev:svgSalamander:1.1.4")
// ─────────────────────────────────────────────
// Animation
// ─────────────────────────────────────────────
// Player Animation Library
include modImplementation(
"dev.kosmx.player-anim:player-animation-lib-fabric:${project.player_anim}"
)
// Optional: BendyLib
// include modRuntimeOnly(
// "io.github.kosmx.bendy-lib:bendy-lib-fabric:${project.bendylib_version}"
// )
// ─────────────────────────────────────────────
// External Libraries
// ─────────────────────────────────────────────
// Session Java (Saturn auth/session handling)
include implementation("com.github.selimaj-dev:session-java:0.1.6")
}
/*
* ================================================================
* Resource Processing
* ================================================================
* Injects version values into fabric.mod.json.
*/
processResources {
inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "loader_version", project.loader_version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
"minecraft_version": project.minecraft_version,
"loader_version": project.loader_version
)
}
}
/*
* ================================================================
* Java Configuration
* ================================================================
* Targeting Java 21.
*/
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(targetJavaVersion)
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
archivesBaseName = project.archives_base_name
withSourcesJar()
}
/*
* ================================================================
* Jar Packaging
* ================================================================
* Includes LICENSE and NOTICE inside the final jar.
*/
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
from("NOTICE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
/*
* ================================================================
* Publishing
* ================================================================
* Configured but no remote repository defined yet.
*/
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
// Add publishing repository here when needed
}
}