131 lines
3.4 KiB
Groovy
131 lines
3.4 KiB
Groovy
plugins {
|
|
id "com.github.johnrengelman.shadow" version "7.0.0"
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath.set(project(":common").file("src/main/resources/lod.accesswidener"))
|
|
}
|
|
|
|
architectury {
|
|
platformSetupLoomIde()
|
|
fabric()
|
|
}
|
|
|
|
configurations {
|
|
compileClasspath.extendsFrom common
|
|
runtimeClasspath.extendsFrom common
|
|
developmentFabric.extendsFrom common
|
|
}
|
|
|
|
repositories {
|
|
// Required for ModMenu and ClothAPI
|
|
maven { url "https://maven.shedaniel.me/" }
|
|
maven { url "https://maven.terraformersmc.com/" }
|
|
}
|
|
|
|
|
|
dependencies {
|
|
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
|
|
|
// TODO: This is only for LodMain, try to find a way to remove it
|
|
// Fabric API
|
|
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
|
|
|
// Mod Menu
|
|
modImplementation("com.terraformersmc:modmenu:2.0.14") {
|
|
exclude(group: "net.fabricmc.fabric-api")
|
|
}
|
|
|
|
// Cloth Config (including Auto Config)
|
|
modApi("me.shedaniel.cloth:cloth-config-fabric:5.0.38") {
|
|
exclude(group: "net.fabricmc.fabric-api")
|
|
}
|
|
|
|
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
|
shadowMe(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
|
|
|
common 'org.tukaani:xz:1.9'
|
|
common 'org.apache.commons:commons-compress:1.21'
|
|
shadowMe 'org.tukaani:xz:1.9'
|
|
shadowMe 'org.apache.commons:commons-compress:1.21'
|
|
}
|
|
|
|
// This method copies the access wideners from the common project to the fabric project. And it was generated by Github Copilot
|
|
task copyAccessWidener(type: Copy) {
|
|
from project(":common").file("src/main/resources/lod.accesswidener")
|
|
into file("src/generated/resources")
|
|
}
|
|
|
|
task copyCoreResources(type: Copy) {
|
|
from fileTree(project(":core").file("src/main/resources"))
|
|
into file("build/resources/main")
|
|
}
|
|
|
|
task deleteResources(type: Delete) {
|
|
delete file("build/resources/main")
|
|
}
|
|
|
|
task copyCommonResources(type: Copy) {
|
|
from fileTree(project(":common").file("src/main/resources"))
|
|
into file("build/resources/main")
|
|
}
|
|
|
|
runClient {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyCommonResources)
|
|
finalizedBy(deleteResources)
|
|
}
|
|
|
|
processResources {
|
|
dependsOn(copyAccessWidener)
|
|
inputs.property "version", project.version
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
configurations = [project.configurations.shadowMe]
|
|
relocate 'org.tukaani', 'shaded.tukaani'
|
|
relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress'
|
|
|
|
classifier "dev-shadow"
|
|
}
|
|
|
|
remapJar {
|
|
input.set shadowJar.archiveFile
|
|
dependsOn shadowJar
|
|
classifier null
|
|
}
|
|
|
|
jar {
|
|
classifier "dev"
|
|
}
|
|
|
|
sourcesJar {
|
|
def commonSources = project(":common").sourcesJar
|
|
dependsOn commonSources
|
|
from commonSources.archiveFile.map { zipTree(it) }
|
|
}
|
|
|
|
components.java {
|
|
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
|
skip()
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenFabric(MavenPublication) {
|
|
artifactId = rootProject.archives_base_name + "-" + project.name
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
|
repositories {
|
|
// Add repositories to publish to here.
|
|
}
|
|
}
|