mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Improve gradle
Mostly taken from Quilt's template mod. - No longer JIJs FAPI - Update gradle wrapper
This commit is contained in:
parent
6cb7a4a047
commit
bd52a34644
6 changed files with 52 additions and 52 deletions
56
build.gradle
56
build.gradle
|
@ -1,49 +1,33 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '0.11.+'
|
||||
id 'io.github.juuxel.loom-quiltflower' version '1.7.+'
|
||||
id 'org.quiltmc.quilt-mappings-on-loom' version '4.0.0'
|
||||
id 'org.ajoberstar.grgit' version '5.0.0'
|
||||
alias(libs.plugins.fabric.loom)
|
||||
alias(libs.plugins.loom.quiltflower)
|
||||
alias(libs.plugins.qmol)
|
||||
alias(libs.plugins.grgit)
|
||||
}
|
||||
|
||||
sourceCompatibility = '17'
|
||||
targetCompatibility = '17'
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = "${project.mod_version}+${getMetadata()}"
|
||||
group = project.maven_group
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
name = 'Modrinth'
|
||||
url = 'https://api.modrinth.com/maven'
|
||||
content {
|
||||
includeGroup "maven.modrinth"
|
||||
includeGroup 'maven.modrinth'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var apiModules = [
|
||||
"fabric-api-base",
|
||||
"fabric-networking-api-v1",
|
||||
"fabric-object-builder-api-v1",
|
||||
"fabric-registry-sync-v0"
|
||||
]
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
minecraft libs.minecraft
|
||||
mappings loom.layered {
|
||||
addLayer quiltMappings.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.quilt_mappings}:v2")
|
||||
addLayer quiltMappings.mappings("org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:v2")
|
||||
}
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation libs.fabric.loader
|
||||
|
||||
// Fabric API
|
||||
apiModules.forEach {
|
||||
include modImplementation(fabricApi.module(it, project.fabric_version))
|
||||
}
|
||||
|
||||
// Sodium
|
||||
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
||||
modImplementation libs.fabric.api
|
||||
modCompileOnly libs.sodium
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -57,9 +41,15 @@ processResources {
|
|||
|
||||
tasks.withType(JavaCompile) {
|
||||
it.options.encoding = 'UTF-8'
|
||||
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
|
||||
it.options.release = 17
|
||||
}
|
||||
|
||||
java {
|
||||
// Still required by IDEs such as Eclipse and Visual Studio Code
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
|
@ -70,13 +60,13 @@ jar {
|
|||
}
|
||||
|
||||
def getMetadata() {
|
||||
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
||||
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
||||
def build_id = System.getenv('GITHUB_RUN_NUMBER')
|
||||
def workflow_id = System.getenv('GITHUB_WORKFLOW')
|
||||
|
||||
def metadata = project.minecraft_version
|
||||
def metadata = libs.versions.minecraft.get()
|
||||
|
||||
// Release builds only
|
||||
if (workflow_id == "build-release") {
|
||||
if (workflow_id == 'build-release') {
|
||||
return metadata
|
||||
}
|
||||
|
||||
|
@ -88,7 +78,7 @@ def getMetadata() {
|
|||
|
||||
// Flag the build if the build tree is not clean
|
||||
if (!grgit.status().clean) {
|
||||
id += "-dirty"
|
||||
id += '-dirty'
|
||||
}
|
||||
|
||||
metadata += "-${id}"
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
# Done to increase the memory available to gradle.
|
||||
# Gradle Properties
|
||||
org.gradle.jvmargs = -Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop/
|
||||
minecraft_version=1.19
|
||||
quilt_mappings=1
|
||||
loader_version=0.14.6
|
||||
fabric_version=0.55.2+1.19
|
||||
org.gradle.parallel = true
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.0.2
|
||||
mod_version=1.0.3
|
||||
maven_group=me.tibinonest.mods
|
||||
archives_base_name=cauldron-dyeing
|
||||
|
||||
# Dependencies
|
||||
sodium_version=mc1.19-0.4.2
|
||||
# Dependencies are managed at gradle/libs.versions.toml
|
||||
|
|
21
gradle/libs.versions.toml
Normal file
21
gradle/libs.versions.toml
Normal file
|
@ -0,0 +1,21 @@
|
|||
[versions]
|
||||
minecraft = "1.19"
|
||||
quilt_mappings = "1.19+build.1"
|
||||
fabric_loader = "0.14.6"
|
||||
|
||||
fabric_api = "0.55.2+1.19"
|
||||
sodium = "mc1.19-0.4.2"
|
||||
|
||||
[libraries]
|
||||
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
|
||||
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
|
||||
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
|
||||
|
||||
fabric_api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric_api" }
|
||||
sodium = { module = "maven.modrinth:sodium", version.ref = "sodium" }
|
||||
|
||||
[plugins]
|
||||
fabric_loom = { id = "fabric-loom", version = "0.12.+" }
|
||||
loom_quiltflower = { id = "io.github.juuxel.loom-quiltflower", version = "1.7.+" }
|
||||
qmol = { id = "org.quiltmc.quilt-mappings-on-loom", version = "4.2.0" }
|
||||
grgit = { id = "org.ajoberstar.grgit", version = "5.0.0" }
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
name 'Quilt'
|
||||
url 'https://maven.quiltmc.org/repository/release'
|
||||
name = 'Quilt'
|
||||
url = 'https://maven.quiltmc.org/repository/release'
|
||||
}
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
}
|
||||
maven {
|
||||
name = 'Cotton'
|
||||
url = 'https://server.bbkr.space/artifactory/libs-release/'
|
||||
}
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue