Files
draggable_lists/neoforge/build.gradle
T

92 lines
2.5 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
maven { url "https://maven.neoforged.net/releases/" }
}
architectury {
platformSetupLoomIde()
neoForge()
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentNeoforge.extendsFrom common
}
dependencies {
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-neoforge:${rootProject.architectury_version}"
modApi "me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_config_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/neoforge.mods.toml") {
expand "version": project.version,
"description": rootProject.mod_description,
"minecraft_version": rootProject.minecraft_version,
"architectury_version": rootProject.architectury_version,
"cloth_config_version": rootProject.cloth_config_version
}
}
shadowJar {
exclude "fabric.mod.json"
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
archiveClassifier.set "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set null
}
jar {
archiveClassifier.set "dev-shadow"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenNeoforge(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.
}
}