Patch fabric api to fix loom deprecations

dev/0.11
modmuss50 2021-09-05 16:38:11 +01:00
parent 2bdeb869ab
commit ffaf893716
3 changed files with 30 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait {
repo: "https://github.com/FabricMC/fabric.git",
commit: "fc40aa9d88e9457957bdf3f8cec9698846828cd3",
version: version,
warningMode: "all" // TODO remove once api has updated to 0.10
patch: "fabric_api"
)
// Set the version to something constant

View File

@ -61,13 +61,23 @@ trait GradleProjectTestTrait {
return
}
if (options["repo"]) {
if (options.repo) {
String repo = options.repo
String commit = options.commit
exec(projectDir, "git", "clone", repo, ".")
exec(projectDir, "git", "checkout", commit)
if (options.patch) {
def patchFile = new File("src/test/resources/patches/${options.patch}.patch")
if (!patchFile.exists()) {
throw new FileNotFoundException("Could not find patch file at: " + patchFile.absolutePath)
}
exec(projectDir, "git", "apply", patchFile.absolutePath)
}
return
}

View File

@ -0,0 +1,18 @@
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision fc40aa9d88e9457957bdf3f8cec9698846828cd3)
+++ b/build.gradle (date 1630855787420)
@@ -270,13 +270,7 @@
publishing {
publications {
mavenJava(MavenPublication) {
- artifact(remapMavenJar) {
- builtBy remapMavenJar
- }
-
- artifact(sourcesJar) {
- builtBy remapSourcesJar
- }
+ from components.java
artifact javadocJar