mirror of
				https://github.com/chylex/Better-Controls.git
				synced 2025-10-31 20:17:17 +01:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			761fdb76da
			...
			476689deb9
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 476689deb9 | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 21 KiB | 
| @@ -6,7 +6,7 @@ | ||||
|   "version": "${version}", | ||||
|   "license": "${license}", | ||||
|    | ||||
|   "icon": "assets/bettercontrols/icon.png", | ||||
|   "icon": "assets/${id}/logo.png", | ||||
|    | ||||
|   "authors": [ | ||||
|     "${author}" | ||||
|   | ||||
| @@ -11,7 +11,7 @@ displayURL = "${sourcesURL}" | ||||
| description = "${description}" | ||||
| authors = "${author}" | ||||
| version = "${version}" | ||||
| logoFile = "icon.png" | ||||
| logoFile = "assets/${id}/logo.png" | ||||
|  | ||||
| [[mixins]] | ||||
| config = "${id}.mixins.json" | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 21 KiB | 
| @@ -1,6 +1,6 @@ | ||||
| @file:Suppress("ConvertLambdaToReference") | ||||
|  | ||||
| import org.gradle.api.file.DuplicatesStrategy.EXCLUDE | ||||
| import org.gradle.jvm.tasks.Jar | ||||
|  | ||||
| val modId: String by project | ||||
| val modName: String by project | ||||
| @@ -94,6 +94,24 @@ allprojects { | ||||
| 	dependencies { | ||||
| 		implementation("org.jetbrains:annotations:24.1.0") | ||||
| 	} | ||||
| 	 | ||||
| 	tasks.withType<ProcessResources> { | ||||
| 		inputs.property("id", modId) | ||||
| 		inputs.property("name", modName) | ||||
| 		inputs.property("description", modDescription) | ||||
| 		inputs.property("version", modVersion) | ||||
| 		inputs.property("author", modAuthor) | ||||
| 		inputs.property("license", modLicense) | ||||
| 		inputs.property("sourcesURL", modSourcesURL) | ||||
| 		inputs.property("issuesURL", modIssuesURL) | ||||
| 		inputs.property("minimumMinecraftVersion", minimumMinecraftVersion) | ||||
| 		inputs.property("minimumNeoForgeVersion", minimumNeoForgeVersion) | ||||
| 		inputs.property("minimumFabricVersion", minimumFabricVersion) | ||||
| 		 | ||||
| 		from(rootProject.file("logo.png")) { | ||||
| 			into("assets/$modId") | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| subprojects { | ||||
| @@ -112,18 +130,6 @@ subprojects { | ||||
| 	} | ||||
| 	 | ||||
| 	tasks.processResources { | ||||
| 		inputs.property("id", modId) | ||||
| 		inputs.property("name", modName) | ||||
| 		inputs.property("description", modDescription) | ||||
| 		inputs.property("version", modVersion) | ||||
| 		inputs.property("author", modAuthor) | ||||
| 		inputs.property("license", modLicense) | ||||
| 		inputs.property("sourcesURL", modSourcesURL) | ||||
| 		inputs.property("issuesURL", modIssuesURL) | ||||
| 		inputs.property("minimumMinecraftVersion", minimumMinecraftVersion) | ||||
| 		inputs.property("minimumNeoForgeVersion", minimumNeoForgeVersion) | ||||
| 		inputs.property("minimumFabricVersion", minimumFabricVersion) | ||||
| 		 | ||||
| 		from(rootProject.sourceSets.main.get().resources) { | ||||
| 			expand(inputs.properties) | ||||
| 		} | ||||
| @@ -131,18 +137,12 @@ subprojects { | ||||
| 	 | ||||
| 	tasks.jar { | ||||
| 		archiveVersion.set(jarVersion) | ||||
| 		entryCompression = ZipEntryCompression.STORED | ||||
| 		 | ||||
| 		from(rootProject.file("LICENSE")) | ||||
| 		 | ||||
| 		manifest { | ||||
| 			attributes( | ||||
| 				"Specification-Title" to modId, | ||||
| 				"Specification-Vendor" to modAuthor, | ||||
| 				"Specification-Version" to "1", | ||||
| 				"Implementation-Title" to "$modNameStripped-${project.name}", | ||||
| 				"Implementation-Vendor" to modAuthor, | ||||
| 				"Implementation-Version" to modVersion, | ||||
| 			) | ||||
| 			packageInformation(modId, "$modNameStripped-${project.name}") | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| @@ -151,18 +151,54 @@ subprojects { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| val copyJars = tasks.register<Copy>("copyJars") { | ||||
| fun Manifest.packageInformation(specificationTitle: String, implementationTitle: String) { | ||||
| 	attributes( | ||||
| 		"Specification-Title" to specificationTitle, | ||||
| 		"Specification-Vendor" to modAuthor, | ||||
| 		"Specification-Version" to "1", | ||||
| 		"Implementation-Title" to implementationTitle, | ||||
| 		"Implementation-Vendor" to modAuthor, | ||||
| 		"Implementation-Version" to modVersion, | ||||
| 	) | ||||
| } | ||||
|  | ||||
| val multiloaderSources = sourceSets.register("multiloader") | ||||
|  | ||||
| val multiloaderJar = tasks.register<Jar>("multiloaderJar") { | ||||
| 	group = "build" | ||||
| 	duplicatesStrategy = EXCLUDE | ||||
| 	 | ||||
| 	for (subproject in subprojects) { | ||||
| 		dependsOn(subproject.tasks.assemble) | ||||
| 		from(subproject.base.libsDirectory.file("${subproject.base.archivesName.get()}-$jarVersion.jar")) | ||||
| 	archiveBaseName.set(modNameStripped) | ||||
| 	archiveVersion.set(jarVersion) | ||||
| 	 | ||||
| 	destinationDirectory = layout.buildDirectory.dir("dist") | ||||
| 	 | ||||
| 	fun includeJar(project: Project, jarTask: (TaskContainer) -> TaskProvider<out Jar>) { | ||||
| 		from(jarTask(project.tasks).map { it.outputs }) { | ||||
| 			into("jars") | ||||
| 			rename { "$modNameStripped-${project.name}.jar" } | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	into(project.layout.buildDirectory.dir("dist")) | ||||
| 	findProject(":NeoForge")?.let { includeJar(it, TaskContainer::jar) } | ||||
| 	findProject(":Fabric")?.let { includeJar(it, TaskContainer::remapJar) } | ||||
| 	 | ||||
| 	from(multiloaderSources.map { it.output }) | ||||
| 	 | ||||
| 	manifest { | ||||
| 		packageInformation("$modId-multiloader", modNameStripped) | ||||
| 		attributes("FMLModType" to "GAMELIBRARY") | ||||
| 	} | ||||
| } | ||||
|  | ||||
| tasks.named<ProcessResources>("processMultiloaderResources").configure { | ||||
| 	inputs.property("group", project.group) | ||||
| 	inputs.property("jarPrefix", modNameStripped) | ||||
| 	 | ||||
| 	filesMatching(listOf("fabric.mod.json", "META-INF/jarjar/metadata.json")) { | ||||
| 		expand(inputs.properties) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| tasks.assemble { | ||||
| 	finalizedBy(copyJars) | ||||
| 	finalizedBy(multiloaderJar) | ||||
| } | ||||
|   | ||||
							
								
								
									
										13
									
								
								src/multiloader/resources/META-INF/jarjar/metadata.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/multiloader/resources/META-INF/jarjar/metadata.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| { | ||||
|   "jars": [{ | ||||
|     "identifier": { | ||||
|       "group": "${group}", | ||||
|       "artifact": "${id}" | ||||
|     }, | ||||
|     "version": { | ||||
|       "artifactVersion": "${version}", | ||||
|       "range": "[${version}]" | ||||
|     }, | ||||
|     "path": "jars/${jarPrefix}-NeoForge.jar" | ||||
|   }] | ||||
| } | ||||
							
								
								
									
										34
									
								
								src/multiloader/resources/fabric.mod.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								src/multiloader/resources/fabric.mod.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| { | ||||
|   "schemaVersion": 1, | ||||
|   "id": "${id}_multiloader", | ||||
|   "name": "${name} (Multiloader)", | ||||
|   "description": "${description}", | ||||
|   "version": "${version}", | ||||
|   "license": "${license}", | ||||
|    | ||||
|   "icon": "assets/${id}/logo.png", | ||||
|    | ||||
|   "authors": [ | ||||
|     "${author}" | ||||
|   ], | ||||
|    | ||||
|   "contact": { | ||||
|     "homepage": "https://chylex.com", | ||||
|     "issues": "${issuesURL}", | ||||
|     "sources": "${sourcesURL}" | ||||
|   }, | ||||
|    | ||||
|   "environment": "client", | ||||
|    | ||||
|   "jars": [{ | ||||
|       "file": "jars/${jarPrefix}-Fabric.jar" | ||||
|   }], | ||||
|    | ||||
|   "custom": { | ||||
|     "modmenu": { | ||||
|       "parent": "${id}", | ||||
|       "badges": [ "library" ], | ||||
|       "update_checker": false | ||||
|     } | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user