Files
MidnightLib/quilt/build.gradle
2022-10-31 11:56:53 +01:00

89 lines
2.4 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
maven { url "https://maven.quiltmc.org/repository/release/" }
}
architectury {
platformSetupLoomIde()
loader("quilt")
}
loom {
}
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
developmentQuilt.extendsFrom common
archivesBaseName = rootProject.archives_base_name + "-quilt"
}
dependencies {
modImplementation "org.quiltmc:quilt-loader:${rootProject.quilt_loader_version}"
modApi "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.quilt_fabric_api_version}"
// Remove the next few lines if you don't want to depend on the API
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionQuilt")) { transitive false }
common(project(path: ":fabric-like", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":fabric-like", configuration: "transformProductionQuilt")) { transitive false }
}
processResources {
inputs.property "group", rootProject.maven_group
inputs.property "version", project.version
filesMatching("quilt.mod.json") {
expand "group": rootProject.maven_group,
"version": project.version
}
}
shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenQuilt(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}