Files
architectury-api/forge/build.gradle
Max c12524b7aa [norelease] Switch to loom 0.9, crane and quiltflower
(I can't believe that ALL of these work out of the box)
2021-06-22 12:30:45 +02:00

124 lines
3.1 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.matthewprenger.cursegradle"
}
loom {
mixinConfigs = ["architectury.mixins.json", "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")) {
transitive = false
}
developmentForge(project(path: ":common")) {
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 "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")