Flywheel/vanillinForge/build.gradle.kts
Jozufozu 73341320ac What is your build?
- Add build numbers in mod version strings
- Remove default process resources from SubprojectExtension
2025-03-01 16:44:57 -08:00

94 lines
2.3 KiB
Kotlin

plugins {
idea
java
`maven-publish`
id("dev.architectury.loom")
id("flywheel.subproject")
id("flywheel.platform")
}
val common = ":common"
val platform = ":forge"
subproject.init("vanillin-forge", "vanillin_group", "vanillin_version")
val main = sourceSets.getByName("main")
platform {
setupLoomRuns()
}
transitiveSourceSets {
sourceSet(main) {
compileClasspath(project(platform), "api", "lib")
bundleFrom(project(common), "vanillin")
}
}
val replaceProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"vanillin_id",
"vanillin_name",
"vanillin_description",
"flywheel_maven_version_range",
"minecraft_maven_version_range",
"forge_version_range",
).associateWith { property(it) as String }
.plus("vanillin_version" to "${property("vanillin_version")}${if (subproject.buildNumber != null) "-${subproject.buildNumber}" else ""}")
tasks.withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(listOf("pack.mcmeta", "META-INF/mods.toml")) {
expand(replaceProperties)
}
}
jarSets {
mainSet.publishWithRawSources {
artifactId = "vanillin-forge-${property("artifact_minecraft_version")}"
}
}
defaultPackageInfos {
sources(main)
}
loom {
mixin {
useLegacyMixinAp = true
add(main, "vanillin.refmap.json")
}
forge {
mixinConfig("vanillin.mixins.json")
}
runs {
configureEach {
property("forge.logging.markers", "")
property("forge.logging.console.level", "debug")
}
}
}
dependencies {
forge("net.minecraftforge:forge:${property("minecraft_version")}-${property("forge_version")}")
modCompileOnly("maven.modrinth:embeddium:${property("embeddium_version")}")
compileOnly(project(path = common, configuration = "vanillinClasses"))
compileOnly(project(path = common, configuration = "vanillinResources"))
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1")!!)
implementation(include("io.github.llamalad7:mixinextras-forge:0.4.1")!!)
// JiJ flywheel proper
include(project(path = platform, configuration = "flywheelRemap"))
runtimeOnly(project(path = platform, configuration = "flywheelDev"))
}