create-air-fabric/build.gradle

109 lines
3.4 KiB
Groovy
Raw Normal View History

2023-10-30 23:50:02 +08:00
plugins {
2025-01-21 19:49:39 +08:00
alias libs.plugins.fabric.loom
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 19:49:39 +08:00
base {
archivesName = project.archives_base_name
}
2023-10-30 23:50:02 +08:00
2025-01-21 06:43:53 +08:00
String buildNumber = System.getenv("RUN_NUMBER")
2025-01-21 19:49:39 +08:00
version = "${mod_version}+${libs.versions.minecraft.get()}" + (buildNumber != null ? "-${buildNumber}" : "")
group = project.maven_group
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.terraformersmc.com/releases/" } // Mod Menu
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
}
2025-01-21 19:49:39 +08:00
// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
2023-10-30 23:50:02 +08:00
dependencies {
2025-01-21 19:49:39 +08:00
minecraft libs.minecraft
mappings loom.layered {
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings()
}
modImplementation libs.fabric.loader
2023-10-30 23:50:02 +08:00
// Fabric API. This is technically optional, but you probably want it anyway.
2025-01-21 19:49:39 +08:00
modImplementation libs.fabric.api
// Create - dependencies are added transitively
2025-01-21 19:49:39 +08:00
modImplementation libs.create
// Thin Air
2025-01-21 19:49:39 +08:00
modImplementation libs.thinair
2023-11-13 02:16:54 +08:00
// Ad Astra
2025-01-21 19:49:39 +08:00
modImplementation libs.adastra
modImplementation libs.botarium
2023-11-13 02:16:54 +08:00
// Development QOL
2025-01-21 19:49:39 +08:00
modLocalRuntime libs.lazydfu
modLocalRuntime libs.modmenu
2025-01-21 01:16:53 +08:00
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.4.1")))
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,
2025-01-21 19:49:39 +08:00
"fabric_loader_version": libs.versions.fabric.loader.get(),
"fabric_api_version": libs.versions.fabric.api.get(),
"create_version": libs.versions.create.get(),
"minecraft_version": libs.versions.minecraft.get()
2025-01-21 07:22:27 +08:00
]
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 {
2025-01-21 19:49:39 +08:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2025-01-21 20:23:59 +08:00
// withSourcesJar()
2023-10-30 23:50:02 +08:00
}
jar {
from("LICENSE") {
2025-01-21 19:49:39 +08:00
rename { "${it}_${base.archivesName.get()}"}
2023-10-30 23:50:02 +08:00
}
}