Add versions used to compile/build against to jar manifest (#428)

* Add versions used to compile/build against to jar manifest

* checkstyle

* Move to post remap

* Fix build

* Add mc version and mixin group

* Typo

* Make test run across versions better.

(cherry picked from commit 2259a4efc8)
Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
modmuss50
2021-07-14 06:10:07 +08:00
committed by shedaniel
parent 959df385ea
commit d1902ecb0e
11 changed files with 230 additions and 30 deletions

View File

@@ -140,27 +140,29 @@ public class LoomDependencyManager {
String platformSuffix = extension.isForge() ? "_forge" : "";
String mappingsKey = mappingsProvider.getMappingsKey() + platformSuffix;
if (extension.getInstallerJson() == null && !extension.isForge()) {
if (extension.getInstallerData() == null && !extension.isForge()) {
//If we've not found the installer JSON we've probably skipped remapping Fabric loader, let's go looking
project.getLogger().info("Searching through modCompileClasspath for installer JSON");
final Configuration configuration = project.getConfigurations().getByName(Constants.Configurations.MOD_COMPILE_CLASSPATH);
for (File input : configuration.resolve()) {
JsonObject jsonObject = ModProcessor.readInstallerJson(input, project);
for (Dependency dependency : configuration.getAllDependencies()) {
for (File input : configuration.files(dependency)) {
JsonObject jsonObject = ModProcessor.readInstallerJson(input, project);
if (jsonObject != null) {
if (extension.getInstallerJson() != null) {
project.getLogger().info("Found another installer JSON in, ignoring it! " + input);
continue;
if (jsonObject != null) {
if (extension.getInstallerData() != null) {
project.getLogger().info("Found another installer JSON in, ignoring it! " + input);
continue;
}
project.getLogger().info("Found installer JSON in " + input);
extension.setInstallerData(new InstallerData(dependency.getVersion(), jsonObject));
handleInstallerJson(jsonObject, project);
}
project.getLogger().info("Found installer JSON in " + input);
extension.setInstallerJson(jsonObject);
handleInstallerJson(extension.getInstallerJson(), project);
}
}
if (extension.getInstallerJson() == null) {
if (extension.getInstallerData() == null) {
project.getLogger().warn("fabric-installer.json not found in classpath!");
}
}