Sit/build.gradle
2025-05-12 23:18:33 -05:00

123 lines
No EOL
3 KiB
Groovy

plugins {
id 'fabric-loom' version "1.10-SNAPSHOT"
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.8.4"
id 'co.uzzu.dotenv.gradle' version '4.0.0'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.file_name
}
repositories {
mavenLocal()
maven { url = "https://maven.terraformersmc.com/releases/" }
maven { url = "https://maven.isxander.dev/releases" }
}
loom {
accessWidenerPath = file("src/main/resources/sit!.accesswidener")
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
modImplementation "one.oth3r:otterlib:${project.otterlib_version}"
}
processResources {
filteringCharset = "UTF-8"
var replaceProperties = [
version : project.version,
minecraft_version : minecraft_version,
min_minecraft_version : min_minecraft_version,
max_minecraft_version : max_minecraft_version,
otterlib_version : otterlib_version,
loader_version : loader_version
]
inputs.properties replaceProperties
filesMatching("fabric.mod.json") {
expand replaceProperties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
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.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
publishMods {
changelog = file('changelog.md').text
type = STABLE
file = remapJar.archiveFile
modLoaders.add("fabric")
modLoaders.add("quilt")
version = mod_version
displayName = mod_version+" [Fabric]"
curseforge {
accessToken = env.fetchOrNull('CURSEFORGE')
projectId = "892424"
projectSlug = "sit1"
minecraftVersions.addAll(minecraft_versions.split(",").toList())
requires("fabric-api", "otterlib")
announcementTitle = "Download from CurseForge"
}
modrinth {
accessToken = env.fetchOrNull('MODRINTH')
projectId = "EsYqsGV4"
minecraftVersions.addAll(minecraft_versions.split(",").toList())
requires("fabric-api", "otterlib")
announcementTitle = "Download from Modrinth"
}
}