137 lines
4.3 KiB
Groovy
137 lines
4.3 KiB
Groovy
plugins {
|
|
id "org.quiltmc.loom" version "0.12.+"
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.lod.accesswidener")
|
|
|
|
// "runs" isn't required, but when we do need it then it can be useful
|
|
runs {
|
|
client {
|
|
client()
|
|
setConfigName("Quilt Client")
|
|
ideConfigGenerated(true)
|
|
runDir("run")
|
|
}
|
|
server {
|
|
server()
|
|
setConfigName("Quilt Server")
|
|
ideConfigGenerated(true)
|
|
runDir("run")
|
|
}
|
|
}
|
|
}
|
|
|
|
remapJar {
|
|
// Set the input jar for the task, also valid for remapSourcesJar
|
|
inputFile = project(":quilt").file("build/libs/DistantHorizons-quilt-${rootProject.versionStr}-all.jar")
|
|
}
|
|
|
|
configurations {
|
|
// The addModJar basically embeds the mod to the built jar
|
|
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 {
|
|
minecraft "com.mojang:minecraft:${minecraft_version}"
|
|
mappings loom.layered() {
|
|
// Mojmap mappings
|
|
officialMojangMappings()
|
|
// Parchment mappings (it adds parameter mappings & javadoc)
|
|
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
|
|
}
|
|
// Quilt loader
|
|
modImplementation "org.quiltmc:quilt-loader:${rootProject.quilt_loader_version}"
|
|
|
|
// Quilted Fabric API
|
|
modImplementation "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.quilted_api_version}" // For now until quilt has a better way of doing this, just use quilt's qfapi
|
|
// addModJar(fabricApi.module("fabric-events-interaction-v0", rootProject.quilted_api_version))
|
|
// addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.quilted_api_version))
|
|
// addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.quilted_api_version))
|
|
// addModJar(fabricApi.module("fabric-resource-loader-v0", rootProject.quilted_api_version))
|
|
// addModJar(fabricApi.module("fabric-rendering-v1", rootProject.quilted_api_version)) // TODO: Remove this as it is only needed in 1 line (QuiltClientProxy)
|
|
// addModJar(fabricApi.module("fabric-api-base", rootProject.quilted_api_version))
|
|
|
|
// Mod Menu
|
|
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
|
|
|
|
|
|
|
|
// Starlight
|
|
addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight)
|
|
|
|
// Phosphor
|
|
addMod("curse.maven:phosphor-372124:${rootProject.phosphor_version_fabric}", rootProject.enable_phosphor)
|
|
|
|
// Sodium
|
|
addMod("maven.modrinth:sodium:${rootProject.sodium_version}", rootProject.enable_sodium)
|
|
|
|
// Lithium
|
|
addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium)
|
|
|
|
// Iris
|
|
addMod("maven.modrinth:iris:${rootProject.iris_version}", rootProject.enable_iris)
|
|
|
|
// BCLib
|
|
addMod("com.github.paulevsGitch:BCLib:${rootProject.bclib_version}", rootProject.enable_bclib)
|
|
}
|
|
|
|
|
|
task deleteResources(type: Delete) {
|
|
delete file("build/resources/main")
|
|
}
|
|
|
|
processResources {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyAccessWidener)
|
|
}
|
|
|
|
runClient {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyAccessWidener)
|
|
jvmArgs "-XX:-OmitStackTraceInFastThrow"
|
|
finalizedBy(deleteResources)
|
|
}
|
|
|
|
//jar {
|
|
// classifier "dev"
|
|
//}
|
|
|
|
sourcesJar {
|
|
def commonSources = project(":common").sourcesJar
|
|
dependsOn commonSources
|
|
from commonSources.archiveFile.map { zipTree(it) }
|
|
|
|
def fabricLikeSources = project(":fabricLike").sourcesJar
|
|
dependsOn fabricLikeSources
|
|
from fabricLikeSources.archiveFile.map { zipTree(it) }
|
|
}
|
|
|
|
//components.java {
|
|
// withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
|
// skip()
|
|
// }
|
|
//}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenFabric(MavenPublication) {
|
|
artifactId = rootProject.mod_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.
|
|
}
|
|
} |