mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
130 lines
3.5 KiB
Groovy
130 lines
3.5 KiB
Groovy
plugins {
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
|
id "com.matthewprenger.cursegradle"
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath = project(":common").loom.accessWidenerPath
|
|
}
|
|
|
|
architectury {
|
|
platformSetupLoomIde()
|
|
fabric()
|
|
}
|
|
|
|
configurations {
|
|
common
|
|
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
|
|
compileClasspath.extendsFrom common
|
|
runtimeClasspath.extendsFrom common
|
|
developmentFabric.extendsFrom common
|
|
}
|
|
|
|
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 }
|
|
|
|
common(project(path: ":common", configuration: "namedElements")) { 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 {
|
|
exclude "architectury-common.accessWidener"
|
|
exclude "architectury.common.json"
|
|
|
|
configurations = [project.configurations.shadowCommon]
|
|
classifier "dev-shadow"
|
|
}
|
|
|
|
remapJar {
|
|
injectAccessWidener = true
|
|
input.set shadowJar.archiveFile
|
|
dependsOn shadowJar
|
|
classifier null
|
|
}
|
|
|
|
jar {
|
|
classifier "dev"
|
|
}
|
|
|
|
sourcesJar {
|
|
afterEvaluate {
|
|
[":common"].forEach {
|
|
def depSources = project(it).sourcesJar
|
|
dependsOn depSources
|
|
from(depSources.archiveFile.map { zipTree(it) }) {
|
|
exclude "architectury.accessWidener"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
components.java {
|
|
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
|
skip()
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenFabric(MavenPublication) {
|
|
artifactId = rootProject.archivesBaseName + "-fabric"
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
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.19-Snapshot"
|
|
addGameVersion "Java 17"
|
|
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")
|