create-air-fabric/build.gradle

123 lines
4.7 KiB
Groovy
Raw Normal View History

2023-10-30 23:50:02 +08:00
plugins {
2025-01-21 07:39:04 +08:00
id "fabric-loom" version "1.8+"
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
2023-10-30 23:50:02 +08:00
id 'maven-publish'
}
2025-01-21 07:22:27 +08:00
base.archivesName = archives_base_name
2023-10-30 23:50:02 +08:00
group = project.maven_group
2025-01-21 06:43:53 +08:00
String buildNumber = System.getenv("RUN_NUMBER")
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.
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
2025-01-21 07:05:06 +08:00
maven { url = "https://maven.blamejared.com" } // JEI
2025-01-21 07:32:33 +08:00
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
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://cursemaven.com" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
2025-01-21 07:05:06 +08:00
maven { // Fabric ASM for Porting Lib
url = "https://jitpack.io/"
content { includeGroupAndSubgroups("com.github") }
}
maven { url = "https://maven.tterrag.com/" } // Flywheel
2025-01-21 07:05:06 +08:00
maven { url = "https://mvn.devos.one/snapshots/" } // Create and several dependencies
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port
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-30 23:50:02 +08:00
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
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.
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
// Create - dependencies are added transitively
2024-03-12 15:08:13 +08:00
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
// Thin Air
2024-03-12 12:32:40 +08:00
modImplementation("maven.modrinth:thin-air:${thinair_version}")
2023-11-13 02:16:54 +08:00
// Ad Astra
2024-03-12 12:34:48 +08:00
modImplementation("maven.modrinth:ad-astra:${adastra_version}")
2024-03-12 15:08:13 +08:00
modImplementation("maven.modrinth:botarium:${botarium_version}")
2023-11-13 02:16:54 +08:00
// Development QOL
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
2025-01-21 01:16:53 +08:00
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.4.1")))
// 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)) {
2025-01-21 07:22:27 +08:00
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-fabric:$emi_version"); break
case "disabled": break
2025-01-21 07:22:27 +08:00
default: println("Unknown recipe viewer specified: $recipe_viewer. Must be JEI, REI, EMI, or disabled.")
}
2023-10-30 23:50:02 +08:00
}
processResources {
// require dependencies to be the version compiled against or newer
2025-01-21 07:22:27 +08:00
Map<String, Object> properties = [
"version": version,
"fabric_loader_version": fabric_loader_version,
"fabric_api_version": fabric_api_version,
"create_version": create_version,
"minecraft_version": minecraft_version
]
inputs.properties(properties)
2023-10-30 23:50:02 +08:00
filesMatching("fabric.mod.json") {
expand properties
2023-10-30 23:50:02 +08:00
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
2025-01-21 07:39:04 +08:00
it.options.release = 17
2023-10-30 23:50:02 +08:00
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}