Sit/build.gradle

123 lines
3 KiB
Groovy
Raw Permalink Normal View History

2023-07-20 20:17:52 -05:00
plugins {
2025-05-12 23:18:33 -05:00
id 'fabric-loom' version "1.10-SNAPSHOT"
2023-07-20 20:17:52 -05:00
id 'maven-publish'
2025-05-08 13:03:15 -05:00
id "me.modmuss50.mod-publish-plugin" version "0.8.4"
2024-10-28 15:51:57 -05:00
id 'co.uzzu.dotenv.gradle' version '4.0.0'
2023-07-20 20:17:52 -05:00
}
version = project.mod_version
group = project.maven_group
base {
2024-10-01 11:04:39 -05:00
archivesName = project.file_name
2023-07-20 20:17:52 -05:00
}
repositories {
2025-05-03 15:36:42 -05:00
mavenLocal()
2025-03-13 17:47:43 -05:00
maven { url = "https://maven.terraformersmc.com/releases/" }
maven { url = "https://maven.isxander.dev/releases" }
2023-07-20 20:17:52 -05:00
}
2024-09-30 15:17:52 -05:00
loom {
accessWidenerPath = file("src/main/resources/sit!.accesswidener")
}
2023-07-20 20:17:52 -05:00
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}"
2025-05-03 15:36:42 -05:00
modImplementation "one.oth3r:otterlib:${project.otterlib_version}"
2023-07-20 20:17:52 -05:00
}
processResources {
2025-03-13 17:47:43 -05:00
filteringCharset = "UTF-8"
2023-07-20 20:17:52 -05:00
2024-09-22 12:03:50 -05:00
var replaceProperties = [
version : project.version,
minecraft_version : minecraft_version,
min_minecraft_version : min_minecraft_version,
2025-03-25 12:13:17 -05:00
max_minecraft_version : max_minecraft_version,
otterlib_version : otterlib_version,
2024-10-01 11:04:39 -05:00
loader_version : loader_version
2024-09-22 12:03:50 -05:00
]
inputs.properties replaceProperties
2023-07-20 20:17:52 -05:00
filesMatching("fabric.mod.json") {
2024-09-22 12:03:50 -05:00
expand replaceProperties
2023-07-20 20:17:52 -05:00
}
}
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.
}
2024-09-22 12:03:50 -05:00
}
2025-05-08 13:03:15 -05:00
publishMods {
2024-09-22 12:03:50 -05:00
changelog = file('changelog.md').text
2025-05-08 13:03:15 -05:00
type = STABLE
file = remapJar.archiveFile
modLoaders.add("fabric")
modLoaders.add("quilt")
2024-09-22 12:03:50 -05:00
2025-05-08 13:03:15 -05:00
version = mod_version
2025-05-13 14:01:40 -05:00
displayName = "v${mod_version} [Fabric]"
2024-09-22 12:03:50 -05:00
2025-05-08 13:03:15 -05:00
curseforge {
accessToken = env.fetchOrNull('CURSEFORGE')
projectId = "892424"
projectSlug = "sit1"
minecraftVersions.addAll(minecraft_versions.split(",").toList())
2024-09-22 12:03:50 -05:00
2025-05-08 13:03:15 -05:00
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"
}
2023-07-20 20:17:52 -05:00
}