2023-10-30 23:50:02 +08:00
|
|
|
plugins {
|
|
|
|
id 'fabric-loom' version '1.2-SNAPSHOT'
|
2023-10-31 22:40:09 +08:00
|
|
|
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
|
2023-10-30 23:50:02 +08:00
|
|
|
id 'maven-publish'
|
|
|
|
}
|
|
|
|
|
2023-10-31 22:40:09 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
|
|
|
archivesBaseName = project.archives_base_name
|
2023-10-30 23:50:02 +08:00
|
|
|
group = project.maven_group
|
|
|
|
|
2023-11-01 02:02:15 +08:00
|
|
|
String buildNumber = System.getenv("GITEA_RUN_NUMBER")
|
2023-10-31 22:40:09 +08:00
|
|
|
version = "${mod_version}+${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
|
|
|
|
|
2023-10-30 23:50:02 +08:00
|
|
|
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.
|
2023-10-31 22:40:09 +08:00
|
|
|
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
|
|
|
|
maven { url = "https://dvs1.progwml6.com/files/maven/" } // JEI
|
|
|
|
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
|
|
|
|
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
|
|
|
|
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
|
|
|
|
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
|
|
|
|
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
|
|
|
|
maven { url = "https://cursemaven.com" } // Forge Config API Port
|
|
|
|
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
|
|
|
|
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
|
|
|
|
maven { url = "https://maven.tterrag.com/" } // Flywheel
|
|
|
|
|
2023-11-10 01:35:15 +08:00
|
|
|
exclusiveContent {
|
|
|
|
forRepository {
|
|
|
|
maven {
|
|
|
|
name = "Modrinth"
|
|
|
|
url = "https://api.modrinth.com/maven"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
filter {
|
|
|
|
includeGroup "maven.modrinth"
|
2023-10-31 22:40:09 +08:00
|
|
|
}
|
|
|
|
}
|
2023-10-30 23:50:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
// To change the versions see the gradle.properties file
|
|
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
2023-10-31 22:40:09 +08:00
|
|
|
mappings(loom.layered {
|
|
|
|
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
|
|
|
|
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
|
|
|
|
it.officialMojangMappings { nameSyntheticMembers = false }
|
|
|
|
})
|
|
|
|
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
|
2023-10-30 23:50:02 +08:00
|
|
|
|
|
|
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
2023-10-31 22:40:09 +08:00
|
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
|
|
|
|
|
|
|
|
// Create - dependencies are added transitively
|
|
|
|
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
|
|
|
|
|
|
|
|
// Thin Air
|
2023-11-10 01:35:15 +08:00
|
|
|
modImplementation("maven.modrinth:thin-air:v8.1.3-1.20.1-Fabric")
|
2023-10-31 22:40:09 +08:00
|
|
|
|
2023-11-13 02:16:54 +08:00
|
|
|
// Ad Astra
|
|
|
|
modImplementation("curse.maven:ad-astra-635042:4774341")
|
|
|
|
|
2023-10-31 22:40:09 +08:00
|
|
|
// Development QOL
|
|
|
|
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
|
|
|
|
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
|
|
|
|
|
|
|
|
// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
|
|
|
|
// See root gradle.properties to choose which to use at runtime.
|
|
|
|
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
|
|
|
|
case "jei": modLocalRuntime("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"); break
|
|
|
|
case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"); break
|
|
|
|
case "emi": modLocalRuntime("dev.emi:emi:${emi_version}"); break
|
|
|
|
case "disabled": break
|
|
|
|
default: println("Unknown recipe viewer specified: ${recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
|
|
|
|
}
|
2023-10-30 23:50:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
2023-10-31 22:40:09 +08:00
|
|
|
// require dependencies to be the version compiled against or newer
|
|
|
|
Map<String, String> properties = new HashMap<>()
|
|
|
|
properties.put("version", version)
|
|
|
|
properties.put("fabric_loader_version", fabric_loader_version)
|
|
|
|
properties.put("fabric_api_version", fabric_api_version)
|
|
|
|
properties.put("create_version", create_version)
|
|
|
|
properties.put("minecraft_version", minecraft_version)
|
|
|
|
|
|
|
|
properties.forEach((k, v) -> inputs.property(k, v))
|
2023-10-30 23:50:02 +08:00
|
|
|
|
|
|
|
filesMatching("fabric.mod.json") {
|
2023-10-31 22:40:09 +08:00
|
|
|
expand properties
|
2023-10-30 23:50:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
|
|
it.options.encoding = "UTF-8"
|
2023-10-31 22:40:09 +08:00
|
|
|
it.options.release = Integer.parseInt(sourceCompatibility)
|
2023-10-30 23:50:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
from("LICENSE") {
|
|
|
|
rename { "${it}_${project.archivesBaseName}"}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
}
|
|
|
|
}
|