Start on NeoForge support

This commit is contained in:
2025-01-21 00:44:33 +13:00
parent fff624aa9d
commit cdaab07aa5
12 changed files with 220 additions and 110 deletions

View File

@@ -1,63 +1,49 @@
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
id 'com.github.johnrengelman.shadow'
}
architectury {
injectInjectables = false
platformSetupLoomIde()
fabric()
}
configurations {
common
shadowCommon
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common
archivesBaseName = rootProject.archives_base_name + "-fabric"
// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.properties["fabric_loader_version"]}"
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':common', configuration: 'transformProductionFabric')
}
processResources {
inputs.property "version", project.version
inputs.property 'version', project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
filesMatching('fabric.mod.json') {
expand version: project.version
}
}
shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
setArchiveClassifier("dev-shadow")
configurations = [project.configurations.shadowBundle]
archiveClassifier = 'dev-shadow'
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
setArchiveClassifier(null)
}
jar {
setArchiveClassifier("dev")
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
inputFile.set shadowJar.archiveFile
}