135 lines
4.0 KiB
Groovy
135 lines
4.0 KiB
Groovy
plugins {
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
|
}
|
|
|
|
version = rootProject.mod_version+"-"+rootProject.minecraft_version+"-"+new Date().format("yyyy_MM_dd_HH_mm")
|
|
|
|
repositories {
|
|
maven { url "https://maven.quiltmc.org/repository/release/" }
|
|
}
|
|
|
|
architectury {
|
|
platformSetupLoomIde()
|
|
loader("quilt")
|
|
}
|
|
|
|
configurations {
|
|
common
|
|
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
|
|
compileClasspath.extendsFrom common
|
|
runtimeClasspath.extendsFrom common
|
|
developmentQuilt.extendsFrom common
|
|
|
|
addModJar
|
|
include.extendsFrom addModJar
|
|
modImplementation.extendsFrom addModJar
|
|
}
|
|
|
|
def addMod(path, enabled) {
|
|
if (enabled == "2")
|
|
dependencies { modImplementation(path) }
|
|
else if (enabled == "1")
|
|
dependencies { modCompileOnly(path) }
|
|
}
|
|
|
|
dependencies {
|
|
// Quilt loader
|
|
modImplementation "org.quiltmc:quilt-loader:${rootProject.quilt_loader_version}"
|
|
|
|
// Fabric API
|
|
addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version))
|
|
addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.fabric_api_version))
|
|
addModJar(fabricApi.module("fabric-networking-api-v1", rootProject.fabric_api_version))
|
|
|
|
// Mod Menu
|
|
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
|
|
|
|
// Sodium
|
|
addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium)
|
|
implementation "org.joml:joml:1.10.2"
|
|
modImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", rootProject.fabric_api_version))
|
|
modImplementation(fabricApi.module("fabric-rendering-fluids-v1", rootProject.fabric_api_version))
|
|
|
|
|
|
// Toml
|
|
shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {}
|
|
|
|
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
|
shadowCommon(project(path: ":common", configuration: "transformProductionQuilt")) { transitive false }
|
|
common(project(path: ":fabric-like", configuration: "namedElements")) { transitive false }
|
|
shadowCommon(project(path: ":fabric-like", configuration: "transformProductionQuilt")) { transitive false }
|
|
|
|
// Compression
|
|
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'
|
|
}
|
|
|
|
task deleteResources(type: Delete) {
|
|
delete file("build/resources/main")
|
|
}
|
|
|
|
processResources {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyCommonResources)
|
|
dependsOn(copyAccessWidener)
|
|
}
|
|
|
|
runClient {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyCommonResources)
|
|
dependsOn(copyAccessWidener)
|
|
jvmArgs "-XX:-OmitStackTraceInFastThrow"
|
|
finalizedBy(deleteResources)
|
|
}
|
|
|
|
shadowJar {
|
|
exclude "architectury.common.json"
|
|
configurations = [project.configurations.shadowCommon]
|
|
relocate 'org.tukaani', 'shaded.tukaani'
|
|
relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress'
|
|
relocate 'com.electronwill.nightconfig', 'shaded.electronwill.nightconfig'
|
|
|
|
relocate 'com.seibel.lod.common', 'quilt.com.seibel.lod.common'
|
|
|
|
classifier "dev-shadow"
|
|
}
|
|
|
|
remapJar {
|
|
injectAccessWidener = true // Quilt is weird with access wideners
|
|
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 {
|
|
mavenQuilt(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.
|
|
}
|
|
}
|