options-profiles/fabric/build.gradle
2026-03-29 01:17:10 -04:00

49 lines
No EOL
1.4 KiB
Groovy

plugins {
id 'multiloader-loader'
id 'net.fabricmc.fabric-loom'
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
implementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
}
loom {
def aw = project(':common').file("src/main/resources/${mod_id}.accesswidener")
if (aw.exists()) {
accessWidenerPath.set(aw)
}
runs {
client {
client()
setConfigName('Fabric Client')
ideConfigGenerated(true)
runDir('runs/client')
}
server {
server()
setConfigName('Fabric Server')
ideConfigGenerated(true)
runDir('runs/server')
}
}
}
// Implement mcgradleconventions loader attribute
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements', 'includeInternal', 'modCompileClasspath'].each { variant ->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'fabric')
}
}
}
sourceSets.configureEach {
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'fabric')
}
}
}
}