2024-09-26 02:19:00 +08:00
|
|
|
plugins {
|
2025-01-27 13:05:23 +08:00
|
|
|
alias libs.plugins.fabric.loom
|
|
|
|
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
|
2024-09-26 02:19:00 +08:00
|
|
|
id 'maven-publish'
|
|
|
|
}
|
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName = project.archives_base_name
|
|
|
|
}
|
|
|
|
|
2025-01-27 13:05:23 +08:00
|
|
|
String buildNumber = System.getenv("RUN_NUMBER")
|
|
|
|
version = "${mod_version}+${libs.versions.minecraft.get()}" + (buildNumber != null ? "-${buildNumber}" : "")
|
|
|
|
group = project.maven_group
|
|
|
|
|
2024-09-26 02:19:00 +08:00
|
|
|
loom {
|
|
|
|
splitEnvironmentSourceSets()
|
|
|
|
|
|
|
|
mods {
|
|
|
|
"donpayinteg" {
|
|
|
|
sourceSet sourceSets.main
|
|
|
|
sourceSet sourceSets.client
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
// Add repositories to retrieve artifacts from in here.
|
|
|
|
// You should only use this when depending on other mods because
|
|
|
|
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
|
|
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
|
|
|
// for more information about repositories.
|
|
|
|
}
|
|
|
|
|
2024-09-26 04:59:23 +08:00
|
|
|
configurations {
|
|
|
|
includedJars
|
|
|
|
}
|
|
|
|
|
2024-09-26 02:19:00 +08:00
|
|
|
dependencies {
|
|
|
|
// To change the versions see the gradle.properties file
|
2025-01-27 13:05:23 +08:00
|
|
|
minecraft libs.minecraft
|
|
|
|
mappings variantOf(libs.yarn.mappings) { classifier 'v2' }
|
|
|
|
|
|
|
|
modImplementation libs.fabric.loader
|
2024-09-26 02:19:00 +08:00
|
|
|
|
|
|
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
2025-01-27 13:05:23 +08:00
|
|
|
modImplementation libs.fabric.version
|
2024-09-26 02:19:00 +08:00
|
|
|
|
|
|
|
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
2024-09-26 04:59:23 +08:00
|
|
|
includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
2024-09-26 02:19:00 +08:00
|
|
|
implementation group: 'org.json', name: 'json', version: '20240303'
|
2024-09-26 04:59:23 +08:00
|
|
|
includedJars group: 'org.json', name: 'json', version: '20240303'
|
2024-09-26 02:19:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
inputs.property "version", project.version
|
|
|
|
|
|
|
|
filesMatching("fabric.mod.json") {
|
2025-01-27 13:05:23 +08:00
|
|
|
expand "version": project.version
|
2024-09-26 02:19:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
|
|
it.options.encoding = "UTF-8"
|
2025-01-27 13:05:23 +08:00
|
|
|
it.options.release = 21
|
2024-09-26 02:19:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
2025-01-27 13:05:23 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
|
|
|
|
|
|
// withSourcesJar()
|
2024-09-26 02:19:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2024-09-26 04:59:23 +08:00
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
2024-09-26 02:19:00 +08:00
|
|
|
from("LICENSE") {
|
|
|
|
rename { "${it}_${project.archivesBaseName}" }
|
|
|
|
}
|
2024-09-29 16:49:18 +08:00
|
|
|
from {
|
|
|
|
configurations.includedJars.collect {
|
|
|
|
it.isDirectory() ? it : zipTree(it)
|
|
|
|
}
|
2024-09-26 04:59:23 +08:00
|
|
|
}
|
2025-01-27 13:05:23 +08:00
|
|
|
}
|