Allow running without a POMF version set, and remove cyclic dep of fabric base to allow building for now.

This commit is contained in:
modmuss50
2017-02-09 18:21:42 +00:00
parent 017a7a3688
commit 2eaae5be44
6 changed files with 27 additions and 9 deletions

View File

@@ -253,8 +253,11 @@ public class AbstractPlugin implements Plugin<Project> {
project.getTasks().getByName("build").doLast(task -> {
project.getLogger().lifecycle(":remapping mods");
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
try {
ModRemapper.remap(project);
if(extension.hasPomf()){
ModRemapper.remap(project);
}
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -56,4 +56,8 @@ public class LoomGradleExtension {
}
return userCache;
}
public boolean hasPomf(){
return pomfVersion != null && !pomfVersion.isEmpty();
}
}

View File

@@ -72,12 +72,12 @@ public class DownloadTask extends DefaultTask {
Constants.POMF_DIR.get(extension).mkdir();
}
if (!Constants.MAPPINGS_ZIP.get(extension).exists()) {
if (!Constants.MAPPINGS_ZIP.get(extension).exists() && extension.hasPomf()) {
this.getLogger().lifecycle(":downloading mappings");
FileUtils.copyURLToFile(new URL("http://modmuss50.me:8080/job/pomf/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-enigma-" + extension.version + "." + extension.pomfVersion + ".zip"), Constants.MAPPINGS_ZIP.get(extension));
}
if (!Constants.MAPPINGS_TINY.get(extension).exists()) {
if (!Constants.MAPPINGS_TINY.get(extension).exists() && extension.hasPomf()) {
if (!Constants.MAPPINGS_TINY_GZ.get(extension).exists()) {
getLogger().lifecycle(":downloading tiny mappings");
FileUtils.copyURLToFile(new URL("http://modmuss50.me:8080/job/pomf/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-tiny-" + extension.version + "." + extension.pomfVersion + ".gz"), Constants.MAPPINGS_TINY_GZ.get(extension));

View File

@@ -49,6 +49,11 @@ public class MapJarsTask extends DefaultTask {
public void mapJars() throws IOException, MappingParseException {
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
if (!Constants.MINECRAFT_MAPPED_JAR.get(extension).exists()) {
if(!extension.hasPomf()){
this.getLogger().lifecycle("POMF version not set, skipping mapping!");
FileUtils.copyFile(Constants.MINECRAFT_MERGED_JAR.get(extension), Constants.MINECRAFT_MAPPED_JAR.get(extension));
return;
}
this.getLogger().lifecycle(":unpacking mappings");
if (!Constants.MAPPINGS_DIR.get(extension).exists()) {
ZipUtil.unpack(Constants.MAPPINGS_ZIP.get(extension), Constants.MAPPINGS_DIR.get(extension));

View File

@@ -24,11 +24,9 @@
package net.fabricmc.loom.util.proccessing;
import net.fabricmc.base.util.mixin.MixinPrebaker;
import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.task.ProcessModsTask;
import net.fabricmc.loom.util.Constants;
import org.apache.logging.log4j.LogManager;
import org.gradle.api.Project;
import java.io.File;
@@ -48,8 +46,8 @@ public class PreBakeMixins {
}
project.getLogger().lifecycle(":preBaking mixins");
ProcessModsTask.addFile(Constants.MINECRAFT_MAPPED_JAR.get(extension), this);
LogManager.getFormatterLogger("test");
MixinPrebaker.main(args);
//LogManager.getFormatterLogger("test");
// MixinPrebaker.main(args);
}
}