Skip to content

Commit 9bdf896

Browse files
committed
Dependency updates and Gradle improvements
1 parent 08a8f25 commit 9bdf896

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

build.gradle

+25-28
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id 'fabric-loom' version '0.11-SNAPSHOT'
2+
id 'fabric-loom' version '1.1-SNAPSHOT'
33
id 'maven-publish'
44
id 'com.matthewprenger.cursegradle' version '1.4.0'
5-
id 'com.modrinth.minotaur' version '1.2.1'
5+
id 'com.modrinth.minotaur' version '2.7.5'
66
id "com.github.breadmoirai.github-release" version "2.2.12"
77
}
88

@@ -38,9 +38,10 @@ dependencies {
3838

3939
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
4040

41-
modImplementation(include("de.siphalor:amecsapi-$minecraft_major_version:1.3.9+")) {
41+
modImplementation(include("de.siphalor:amecsapi-$minecraft_major_version:$amecs_api_version")) {
4242
exclude group: "net.fabricmc.fabric-api"
4343
}
44+
modCompileOnly(modLocalRuntime("de.siphalor:nmuk-$minecraft_major_version:$nmuk_version"))
4445

4546
testmodImplementation sourceSets.main.output
4647
}
@@ -60,14 +61,15 @@ processResources {
6061
// ensure that the encoding is set to UTF-8, no matter what the system default is
6162
// this fixes some edge cases with special characters not displaying correctly
6263
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
63-
tasks.withType(JavaCompile) {
64+
tasks.withType(JavaCompile).configureEach {
6465
options.encoding = "UTF-8"
6566
}
6667

6768
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
6869
// if it is present.
6970
// If you remove this task, sources will not be generated.
70-
task sourcesJar(type: Jar, dependsOn: classes) {
71+
tasks.register('sourcesJar', Jar) {
72+
dependsOn classes
7173
archiveClassifier.set("sources")
7274
from sourceSets.main.allSource
7375
}
@@ -79,7 +81,7 @@ jar {
7981
// configure the maven publication
8082
publishing {
8183
publications {
82-
mavenJava(MavenPublication) {
84+
create("mavenJava", MavenPublication) {
8385
artifactId = "${project.archives_base_name}-${project.minecraft_major_version}"
8486

8587
from components.java
@@ -107,9 +109,9 @@ static def getChangelog() {
107109
return 'git log -1 --format=format:##%x20%s%n%n%b%nRelease%x20by%x20%an --grep Version'.execute().text.trim()
108110
}
109111

110-
task uploadToModSites {
111-
dependsOn build
112-
group = "upload"
112+
tasks.register('uploadToModSites') {
113+
dependsOn build
114+
group = "upload"
113115
}
114116

115117
if (project.hasProperty("siphalorCurseForgeApi")) {
@@ -136,26 +138,21 @@ if (project.hasProperty("siphalorCurseForgeApi")) {
136138
uploadToModSites.finalizedBy(tasks.curseforge)
137139
}
138140

139-
import com.modrinth.minotaur.TaskModrinthUpload
140-
if (project.hasProperty("siphalorModrinthApi")) {
141-
task modrinth (type: TaskModrinthUpload) {
142-
group = "upload"
143-
dependsOn(build)
144-
145-
token = project.siphalorModrinthApi
146-
projectId = "rcLriA4v"
147-
versionNumber = version
148-
versionName = "[${project.mod_mc_version_specifier}] ${project.mod_version}"
149-
changelog = getChangelog()
150-
uploadFile = remapJar
151-
versionType = project.mod_release
152-
for (version in ((String) project.mod_mc_versions).split(";")) {
153-
addGameVersion(version)
154-
}
155-
addLoader("fabric")
156-
}
157-
uploadToModSites.finalizedBy(tasks.modrinth)
141+
modrinth {
142+
if (project.hasProperty("modrinthToken")) {
143+
token = project.modrinthToken
144+
uploadToModSites.finalizedBy(tasks.modrinth)
145+
}
146+
147+
projectId = "rcLriA4v"
148+
versionName = "[${project.mod_mc_version_specifier}] ${project.mod_version}"
149+
versionType = project.mod_release
150+
changelog = project.getChangelog()
151+
uploadFile = remapJar
152+
gameVersions.set(project.mod_mc_versions.split(";") as List<String>)
153+
loaders.set(["fabric"])
158154
}
155+
tasks.modrinth.group = "upload"
159156

160157
if (project.hasProperty("siphalorGitHubToken")) {
161158
githubRelease {

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx1G
44
minecraft_major_version = 1.16
55
minecraft_version = 1.16.3
66
yarn_mappings = 11
7-
loader_version = 0.13.1
7+
loader_version = 0.14.11
88

99
#Mod properties
1010
mod_version = 1.3.8
@@ -16,3 +16,5 @@ archives_base_name = amecs
1616

1717
#Dependencies
1818
fabric_api_version = 0.20.2+build.402-1.16
19+
amecs_api_version = 1.4.0+mc1.16.5
20+
nmuk_version = 1.1.0+mc1.16.4

0 commit comments

Comments
 (0)