2025-01-12 09:15:05 +01:00
apply from: rootProject . file ( 'buildscript/standalone.gradle' )
apply plugin: 'fabric-loom'
configurations . all {
resolutionStrategy {
force "org.slf4j:slf4j-api:1.7.36" // Introduced by Minecraft itself
}
}
java {
2025-01-14 02:56:59 +01:00
sourceCompatibility = JavaVersion . VERSION_21
targetCompatibility = JavaVersion . VERSION_21
2025-01-12 09:15:05 +01:00
}
processResources {
filesMatching ( '**/fabric.mod.json' ) {
expand 'VERSION' : project . version , 'MINECRAFT_VERSION' : libs . fabric . minecraft . get ( ) . version , 'LOADER_VERSION' : libs . fabric . loader . get ( ) . version
}
2025-01-13 19:03:05 +01:00
dependsOn generateRuntimeDownloadResourceForRuntimeDownloadOnly
2025-01-12 09:15:05 +01:00
}
shadowJar {
2025-01-13 19:03:05 +01:00
configurations = [ project . configurations . shadow ]
2025-01-12 09:15:05 +01:00
mergeServiceFiles ( )
}
2025-01-14 02:58:00 +01:00
copyOutput {
from remapJar . archiveFile
into rootProject . file ( 'jars' )
}
2025-01-13 19:03:05 +01:00
remapJar {
dependsOn shadowJar
mustRunAfter shadowJar
inputFile = shadowJar . archiveFile
archiveBaseName = 'DiscordSRV-Fabric'
archiveClassifier = jar . archiveClassifier
2025-01-14 02:58:00 +01:00
finalizedBy copyOutput // TODO: This currently adds the remapped jar to the jars folder with the shadow jar. The fix for the buildable jar was the artifacts task.
}
artifacts {
archives remapJar
shadow shadowJar
2025-01-13 19:03:05 +01:00
}
2025-01-12 09:15:05 +01:00
loom {
serverOnlyMinecraftJar ( )
2025-01-15 12:18:46 +01:00
accessWidenerPath = file ( 'src/main/resources/discordsrv.accesswidener' )
2025-01-12 09:15:05 +01:00
}
repositories {
exclusiveContent {
forRepository {
2025-01-13 19:03:05 +01:00
maven { url = 'https://maven.fabricmc.net/' }
2025-01-12 09:15:05 +01:00
}
filter {
includeGroup 'net.fabricmc'
}
}
}
dependencies {
// To change the versions see the settings.gradle file
minecraft ( libs . fabric . minecraft )
mappings ( variantOf ( libs . fabric . yarn ) { classifier ( "v2" ) } )
compileOnly ( libs . fabric . loader )
2025-01-13 19:03:05 +01:00
// Fabric API
2025-01-12 09:15:05 +01:00
modImplementation ( libs . fabric . api )
2025-01-13 19:03:05 +01:00
modImplementation ( libs . fabric . permissions . api )
include ( libs . fabric . permissions . api )
2025-01-12 09:15:05 +01:00
// API
annotationProcessor project ( ':api' )
2025-01-13 19:03:05 +01:00
shadow project ( ':common:common-api' )
2025-01-12 09:15:05 +01:00
// Common
2025-01-13 19:03:05 +01:00
shadow project ( ':common' )
2025-01-12 09:15:05 +01:00
// Adventure
modImplementation ( libs . adventure . platform . fabric )
2025-01-13 19:03:05 +01:00
include ( libs . adventure . platform . fabric )
2025-01-12 09:15:05 +01:00
// DependencyDownload
2025-01-13 19:03:05 +01:00
shadow ( libs . mcdependencydownload . fabric ) {
exclude module: 'fabric-loader'
}
2025-01-12 09:15:05 +01:00
}