plugins { id "com.github.johnrengelman.shadow" version "7.0.0" id "com.matthewprenger.cursegradle" } loom { forge { mixinConfig "architectury.mixins.json" mixinConfig "architectury-common.mixins.json" } } configurations { shadowCommon dev } artifacts { dev(jar) } architectury { platformSetupLoomIde() forge() } dependencies { forge "net.minecraftforge:forge:${rootProject.architectury.minecraft}-${rootProject.forge_version}" implementation(project(path: ":common", configuration: "dev")) { transitive = false } developmentForge(project(path: ":common", configuration: "dev")) { transitive = false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } } processResources { filesMatching("META-INF/mods.toml") { expand "version": project.version } inputs.property "META-INF/mods.toml", project.version } shadowJar { exclude "fabric.mod.json" exclude "architectury-common.accessWidener" configurations = [project.configurations.shadowCommon] classifier "shadow" } remapJar { dependsOn(shadowJar) input.set(shadowJar.archivePath) archiveClassifier = "forge" } sourcesJar { afterEvaluate { [":common"].forEach { def depSources = project(it).sourcesJar dependsOn depSources from(depSources.archiveFile.map { zipTree(it) }) { exclude "architectury.accessWidener" } } } } publishing { publications { mavenForge(MavenPublication) { artifactId = rootProject.archivesBaseName + "-forge" artifact(remapJar) { classifier null } afterEvaluate { artifact(remapSourcesJar.output) { builtBy remapSourcesJar classifier "sources" } } } } repositories { if (System.getenv("MAVEN_PASS") != null) { maven { url = "https://deploy.shedaniel.me/" credentials { username = "shedaniel" password = System.getenv("MAVEN_PASS") } } } } } curseforge { if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) { apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY") project { id = "419699" releaseType = "$rootProject.cf_type" changelogType = "html" changelog = releaseChangelog() addGameVersion "1.17" addGameVersion "1.17.1" addGameVersion "Java 16" addGameVersion "Forge" mainArtifact(remapJar.archivePath) { displayName = "[Forge $rootProject.supported_version] v$project.version" } afterEvaluate { uploadTask.dependsOn("build") } } } options { forgeGradleIntegration = false javaVersionAutoDetect = false } } rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")