Files
2024-08-24 23:01:50 +02:00

83 lines
2.9 KiB
Groovy

plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
mavenCentral()
maven { url "https://repo.viaversion.com" }
maven { url "https://libraries.minecraft.net" }
maven { url "https://maven.lenni0451.net/everything" }
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
implementation "com.viaversion:viaversion-common:5.0.3"
implementation "com.viaversion:viabackwards-common:5.0.3"
implementation "com.viaversion:viarewind-common:4.0.2"
implementation "net.raphimc:viaaprilfools-common:3.0.2-SNAPSHOT"
implementation "net.raphimc:ViaLegacy:3.0.3-SNAPSHOT"
implementation "net.raphimc:ViaBedrock:0.0.10-SNAPSHOT"
implementation("net.raphimc:ViaLoader:3.0.3-SNAPSHOT") {
exclude group: "org.slf4j", module: "slf4j-api"
}
modImplementation "org.apache.logging.log4j:log4j-core:2.23.1"
modImplementation "org.apache.logging.log4j:log4j-slf4j-impl:2.23.1"
}
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
}
}
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release.set(targetJavaVersion)
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}