diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..514cf80 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: gradle + directory: / + schedule: + interval: daily \ No newline at end of file diff --git a/build.gradle b/build.gradle index a7044c9..5fc6e53 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + alias libs.plugins.fabric.loom id 'maven-publish' - id 'com.github.johnrengelman.shadow' version '8.1.1' apply false - id 'io.freefair.lombok' version '8.6' - id 'com.github.spotbugs-base' version '6.0.12' - id 'com.diffplug.spotless' version '6.25.0' - id "me.modmuss50.mod-publish-plugin" version "0.5.1" + alias libs.plugins.shadow apply false + alias libs.plugins.lombok + alias libs.plugins.spotbugs.base + alias libs.plugins.spotless + alias libs.plugins.modmuss50.publish } import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar @@ -66,18 +66,21 @@ dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation libs.fabric.loader // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modImplementation libs.fabric.api - def dmModules = ["base", "mixin", "minecraft", "data"] - for (final def module in dmModules) { - modApi include("me.melontini:dark-matter-${module}:${project.dark_matter}") + def dm = libs.dark.matter + [dm.base, dm.mixin, dm.minecraft, dm.data].each { + modApi it + include it } - implementation shade("com.ezylang:EvalEx:${project.evalex_version}") - implementation shade("net.fabricmc:mapping-io:${project.mappingio_version}") + [libs.evalx, libs.mapping.io].each { + implementation it + shade it + } } tasks.register("spotbugs", SpotBugsTask) { task -> @@ -92,13 +95,13 @@ tasks.register("spotbugs", SpotBugsTask) { task -> if (local) { html { required = true - outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html") + outputLocation = file("${layout.buildDirectory.get().asFile}/reports/spotbugs/main/spotbugs.html") stylesheet = 'fancy-hist.xsl' } } else { sarif { required = true - outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.sarif") + outputLocation = file("${layout.buildDirectory.get().asFile}/reports/spotbugs/main/spotbugs.sarif") } } } @@ -119,13 +122,13 @@ loom { processResources { inputs.property "version", project.version inputs.property "minecraft_version", project.minecraft_version - inputs.property "loader_version", project.loader_version + inputs.property "loader_version", libs.fabric.loader.get().version filteringCharset "UTF-8" filesMatching("fabric.mod.json") { expand "version": project.version, "minecraft_version": project.minecraft_version, - "loader_version": project.loader_version + "loader_version": libs.fabric.loader.get().version } } diff --git a/gradle.properties b/gradle.properties index 3f2354f..9928af8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,15 +4,7 @@ org.gradle.jvmargs=-Xmx1G # check these on https://modmuss50.me/fabric.html minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 -loader_version=0.15.7 # Mod Properties mod_version=0.3.2 maven_group=me.melontini archives_base_name=commander -# Dependencies -# check this on https://modmuss50.me/fabric.html -fabric_version=0.92.0+1.20.1 -dark_matter=4.0.0-1.20.1-build.481 -evalex_version=3.2.0 -tiny_remapper_version=0.9.0 -mappingio_version=0.6.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..cfc2553 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +dark-matter = "4.0.0-1.20.1-build.481" + +[libraries] +fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version = "0.15.7" } +fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version = "0.92.0+1.20.1" } +evalx = { group = "com.ezylang", name = "EvalEx", version = "3.2.0" } +mapping-io = { group = "net.fabricmc", name = "mapping-io", version = "0.6.0" } +dark-matter-base = { group = "me.melontini", name = "dark-matter-base", version.ref = "dark-matter" } +dark-matter-mixin = { group = "me.melontini", name = "dark-matter-mixin", version.ref = "dark-matter" } +dark-matter-minecraft = { group = "me.melontini", name = "dark-matter-minecraft", version.ref = "dark-matter" } +dark-matter-data = { group = "me.melontini", name = "dark-matter-data", version.ref = "dark-matter" } + +[plugins] +fabric-loom = { id = "fabric-loom", version = "1.6-SNAPSHOT" } +lombok = { id = "io.freefair.lombok", version = "8.6"} +shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" } +spotbugs-base = { id = "com.github.spotbugs-base", version = "6.0.12" } +spotless = { id = "com.diffplug.spotless", version = "6.25.0" } +modmuss50-publish = { id = "me.modmuss50.mod-publish-plugin", version = "0.5.1" } \ No newline at end of file diff --git a/gradle/mappings.gradle b/gradle/mappings.gradle index 20d4626..67659bd 100644 --- a/gradle/mappings.gradle +++ b/gradle/mappings.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath ("net.fabricmc:mapping-io:${project.mappingio_version}") + classpath (libs.mapping.io) classpath ('com.google.code.gson:gson:2.10.1') } }