diff options
3 files changed, 30 insertions, 2 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy index 16d1e30d..cbefa2e0 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy @@ -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 diff --git a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy index a04d8b5a..91a19b91 100644 --- a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy @@ -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 } diff --git a/src/test/resources/patches/fabric_api.patch b/src/test/resources/patches/fabric_api.patch new file mode 100644 index 00000000..613e56d4 --- /dev/null +++ b/src/test/resources/patches/fabric_api.patch @@ -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 + |