2023-06-29 18:05:27 +05:30
|
|
|
plugins {
|
|
|
|
id("com.github.johnrengelman.shadow")
|
|
|
|
}
|
|
|
|
|
|
|
|
architectury {
|
|
|
|
platformSetupLoomIde()
|
|
|
|
forge()
|
|
|
|
}
|
|
|
|
|
|
|
|
loom {
|
|
|
|
accessWidenerPath.set(project(":common").loom.accessWidenerPath)
|
|
|
|
|
2023-07-02 07:49:28 +05:30
|
|
|
forge {
|
2023-06-29 18:05:27 +05:30
|
|
|
convertAccessWideners.set(true)
|
|
|
|
extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name)
|
|
|
|
|
|
|
|
mixinConfig("quaedam-common.mixins.json")
|
2023-07-01 10:18:34 +05:30
|
|
|
//mixinConfig("quaedam.mixins.json")
|
2023-06-29 18:05:27 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
val common: Configuration by configurations.creating
|
|
|
|
val shadowCommon: Configuration by configurations.creating
|
|
|
|
val developmentForge: Configuration by configurations.getting
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
compileOnly.configure { extendsFrom(common) }
|
|
|
|
runtimeOnly.configure { extendsFrom(common) }
|
|
|
|
developmentForge.extendsFrom(common)
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "Kotlin for Forge"
|
|
|
|
url = uri("https://thedarkcolour.github.io/KotlinForForge/")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
forge("net.minecraftforge:forge:${rootProject.property("forge_version")}")
|
|
|
|
modApi("dev.architectury:architectury-forge:${rootProject.property("architectury_version")}")
|
|
|
|
|
|
|
|
common(project(":common", "namedElements")) { isTransitive = false }
|
|
|
|
shadowCommon(project(":common", "transformProductionForge")) { isTransitive = false }
|
|
|
|
|
|
|
|
implementation("thedarkcolour:kotlinforforge:${rootProject.property("kotlin_for_forge_version")}")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
inputs.property("version", project.version)
|
|
|
|
|
|
|
|
filesMatching("META-INF/mods.toml") {
|
2023-06-29 18:12:06 +05:30
|
|
|
expand(
|
|
|
|
mapOf(
|
|
|
|
"version" to project.version,
|
|
|
|
"minecraft_version" to rootProject.property("minecraft_version"),
|
|
|
|
"architectury_version" to rootProject.property("architectury_version"),
|
|
|
|
"kotlin_for_forge_version" to rootProject.property("kotlin_for_forge_version")
|
|
|
|
)
|
|
|
|
)
|
2023-06-29 18:05:27 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.shadowJar {
|
|
|
|
exclude("fabric.mod.json")
|
|
|
|
exclude("architectury.common.json")
|
|
|
|
configurations = listOf(shadowCommon)
|
|
|
|
archiveClassifier.set("dev-shadow")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.remapJar {
|
|
|
|
injectAccessWidener.set(true)
|
|
|
|
inputFile.set(tasks.shadowJar.get().archiveFile)
|
|
|
|
dependsOn(tasks.shadowJar)
|
|
|
|
archiveClassifier.set(null as String?)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jar {
|
|
|
|
archiveClassifier.set("dev")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.sourcesJar {
|
|
|
|
val commonSources = project(":common").tasks.getByName<Jar>("sourcesJar")
|
|
|
|
dependsOn(commonSources)
|
|
|
|
from(commonSources.archiveFile.map { zipTree(it) })
|
|
|
|
}
|
|
|
|
|
|
|
|
components.getByName("java") {
|
|
|
|
this as AdhocComponentWithVariants
|
|
|
|
this.withVariantsFromConfiguration(project.configurations["shadowRuntimeElements"]) {
|
|
|
|
skip()
|
|
|
|
}
|
|
|
|
}
|