Files
architectury-api/fabric/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

131 lines
3.4 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.matthewprenger.cursegradle"
}
loom {
accessWidener = file("src/main/resources/architectury.accessWidener")
}
configurations {
shadowCommon
dev
}
artifacts {
dev(jar)
}
architectury {
platformSetupLoomIde()
fabric()
}
repositories {
maven { url "https://maven.terraformersmc.com/releases/" }
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
modCompileOnly("com.terraformersmc:modmenu:${rootProject.mod_menu_version}") { transitive false }
implementation(project(path: ":common")) {
transitive = false
}
developmentFabric(project(path: ":common")) {
transitive = false
}
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) {
transitive = false
}
}
processResources {
filesMatching("fabric.mod.json") {
expand "version": project.version
}
inputs.property "version", project.version
}
shadowJar {
configurations = [project.configurations.shadowCommon]
classifier "shadow"
}
remapJar {
dependsOn(shadowJar)
input.set(shadowJar.archiveFile)
archiveClassifier = "fabric"
}
sourcesJar {
afterEvaluate {
[":common"].forEach {
def depSources = project(it).sourcesJar
dependsOn depSources
from(depSources.archiveFile.map { zipTree(it) }) {
exclude "architectury.accessWidener"
}
}
}
}
publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archivesBaseName + "-fabric"
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 = "419697"
releaseType = "$rootProject.cf_type"
changelogType = "html"
changelog = releaseChangelog()
addGameVersion "1.17"
addGameVersion "1.17-Snapshot"
addGameVersion "Java 16"
addGameVersion "Fabric"
relations {
requiredDependency "fabric-api"
}
mainArtifact(remapJar.archivePath) {
displayName = "[Fabric $rootProject.supported_version] v$project.version"
}
afterEvaluate {
uploadTask.dependsOn("build")
}
}
}
options {
forgeGradleIntegration = false
javaVersionAutoDetect = false
}
}
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")