Fix building mods

dev/0.11
modmuss50 2018-10-31 19:55:29 +00:00
parent 79cfe6fbb3
commit f32359d7c3
5 changed files with 5 additions and 10 deletions

View File

@ -79,7 +79,6 @@ public class AbstractPlugin implements Plugin<Project> {
project.getConfigurations().maybeCreate(Constants.CONFIG_MC_DEPENDENCIES_CLIENT);
project.getConfigurations().maybeCreate(Constants.CONFIG_NATIVES);
Configuration compileModsConfig = project.getConfigurations().maybeCreate(Constants.COMPILE_MODS);
project.getConfigurations().maybeCreate(Constants.COMPILE_MODS_PROCESSED);
compileModsConfig.setTransitive(false); //Dont get transitive deps of mods
@ -172,12 +171,10 @@ public class AbstractPlugin implements Plugin<Project> {
ideaModule.getModule().setDownloadSources(true);
ideaModule.getModule().setInheritOutputDirs(true);
ideaModule.getModule().getScopes().get("COMPILE").get("plus").add(project.getConfigurations().getByName(Constants.CONFIG_MINECRAFT));
ideaModule.getModule().getScopes().get("COMPILE").get("plus").add(project.getConfigurations().getByName(Constants.COMPILE_MODS_PROCESSED));
// ECLIPSE
EclipseModel eclipseModule = (EclipseModel) project.getExtensions().getByName("eclipse");
eclipseModule.getClasspath().getPlusConfigurations().add(project.getConfigurations().getByName(Constants.CONFIG_MINECRAFT));
eclipseModule.getClasspath().getPlusConfigurations().add(project.getConfigurations().getByName(Constants.COMPILE_MODS_PROCESSED));
}
/**

View File

@ -36,11 +36,11 @@ public class FinaliseJar extends DefaultTask {
@TaskAction
public void finaliseJar() throws IOException {
//What is the point to this?
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
if(Constants.MINECRAFT_FINAL_JAR.get(extension).exists()){
Constants.MINECRAFT_FINAL_JAR.get(extension).delete();
if(!Constants.MINECRAFT_FINAL_JAR.get(extension).exists()){
FileUtils.copyFile(Constants.MINECRAFT_MAPPED_JAR.get(extension), Constants.MINECRAFT_FINAL_JAR.get(extension));
}
FileUtils.copyFile(Constants.MINECRAFT_MAPPED_JAR.get(extension), Constants.MINECRAFT_FINAL_JAR.get(extension));
}

View File

@ -54,7 +54,7 @@ public class SetupTask extends DefaultTask {
}
ModProccessor.handleMod(input, output, getProject());
Validate.isTrue(output.exists());
getProject().getDependencies().add(Constants.COMPILE_MODS_PROCESSED, getProject().files(output.getPath()));
getProject().getDependencies().add(Constants.CONFIG_MINECRAFT, getProject().files(output.getPath()));
});
}
}

View File

@ -82,7 +82,6 @@ public class Constants {
public static final String CONFIG_MC_DEPENDENCIES_CLIENT = "MC_DEPENDENCIES_CLIENT";
public static final String SYSTEM_ARCH = System.getProperty("os.arch").equals("64") ? "64" : "32";
public static final String COMPILE_MODS = "modCompile";
public static final String COMPILE_MODS_PROCESSED = "modCompile_PROCESSED";
public static List<String> getClassPath() {
URL[] urls = ((URLClassLoader) Constants.class.getClassLoader()).getURLs();

View File

@ -96,8 +96,7 @@ public class ModRemapper {
throw new RuntimeException("Failed to rebof jar");
}
//Add the deobf jar to be uploaded to maven
project.getArtifacts().add("archives", deobfJar);
deobfJar.delete();
}
}