Patch fabric api to fix loom deprecations
This commit is contained in:
		
							parent
							
								
									2bdeb869ab
								
							
						
					
					
						commit
						ffaf893716
					
				
					 3 changed files with 30 additions and 2 deletions
				
			
		|  | @ -46,7 +46,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait { | ||||||
| 					repo: "https://github.com/FabricMC/fabric.git", | 					repo: "https://github.com/FabricMC/fabric.git", | ||||||
| 					commit: "fc40aa9d88e9457957bdf3f8cec9698846828cd3", | 					commit: "fc40aa9d88e9457957bdf3f8cec9698846828cd3", | ||||||
| 					version: version, | 					version: version, | ||||||
| 					warningMode: "all" // TODO remove once api has updated to 0.10 | 					patch: "fabric_api" | ||||||
| 			) | 			) | ||||||
| 
 | 
 | ||||||
| 			// Set the version to something constant | 			// Set the version to something constant | ||||||
|  |  | ||||||
|  | @ -61,13 +61,23 @@ trait GradleProjectTestTrait { | ||||||
|             return |             return | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (options["repo"]) { |         if (options.repo) { | ||||||
|             String repo  = options.repo |             String repo  = options.repo | ||||||
|             String commit = options.commit |             String commit = options.commit | ||||||
| 
 | 
 | ||||||
|             exec(projectDir, "git", "clone", repo, ".") |             exec(projectDir, "git", "clone", repo, ".") | ||||||
|             exec(projectDir, "git", "checkout", commit) |             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 |             return | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										18
									
								
								src/test/resources/patches/fabric_api.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/test/resources/patches/fabric_api.patch
									
									
									
									
									
										Normal 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 | ||||||
|  | 
 | ||||||
		Loading…
	
		Reference in a new issue