Fix building mods
parent
79cfe6fbb3
commit
f32359d7c3
|
@ -79,7 +79,6 @@ public class AbstractPlugin implements Plugin<Project> {
|
||||||
project.getConfigurations().maybeCreate(Constants.CONFIG_MC_DEPENDENCIES_CLIENT);
|
project.getConfigurations().maybeCreate(Constants.CONFIG_MC_DEPENDENCIES_CLIENT);
|
||||||
project.getConfigurations().maybeCreate(Constants.CONFIG_NATIVES);
|
project.getConfigurations().maybeCreate(Constants.CONFIG_NATIVES);
|
||||||
Configuration compileModsConfig = project.getConfigurations().maybeCreate(Constants.COMPILE_MODS);
|
Configuration compileModsConfig = project.getConfigurations().maybeCreate(Constants.COMPILE_MODS);
|
||||||
project.getConfigurations().maybeCreate(Constants.COMPILE_MODS_PROCESSED);
|
|
||||||
|
|
||||||
compileModsConfig.setTransitive(false); //Dont get transitive deps of mods
|
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().setDownloadSources(true);
|
||||||
ideaModule.getModule().setInheritOutputDirs(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.CONFIG_MINECRAFT));
|
||||||
ideaModule.getModule().getScopes().get("COMPILE").get("plus").add(project.getConfigurations().getByName(Constants.COMPILE_MODS_PROCESSED));
|
|
||||||
|
|
||||||
// ECLIPSE
|
// ECLIPSE
|
||||||
EclipseModel eclipseModule = (EclipseModel) project.getExtensions().getByName("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.CONFIG_MINECRAFT));
|
||||||
eclipseModule.getClasspath().getPlusConfigurations().add(project.getConfigurations().getByName(Constants.COMPILE_MODS_PROCESSED));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,11 +36,11 @@ public class FinaliseJar extends DefaultTask {
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void finaliseJar() throws IOException {
|
public void finaliseJar() throws IOException {
|
||||||
|
//What is the point to this?
|
||||||
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
|
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
|
||||||
if(Constants.MINECRAFT_FINAL_JAR.get(extension).exists()){
|
if(!Constants.MINECRAFT_FINAL_JAR.get(extension).exists()){
|
||||||
Constants.MINECRAFT_FINAL_JAR.get(extension).delete();
|
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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class SetupTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
ModProccessor.handleMod(input, output, getProject());
|
ModProccessor.handleMod(input, output, getProject());
|
||||||
Validate.isTrue(output.exists());
|
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()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,6 @@ public class Constants {
|
||||||
public static final String CONFIG_MC_DEPENDENCIES_CLIENT = "MC_DEPENDENCIES_CLIENT";
|
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 SYSTEM_ARCH = System.getProperty("os.arch").equals("64") ? "64" : "32";
|
||||||
public static final String COMPILE_MODS = "modCompile";
|
public static final String COMPILE_MODS = "modCompile";
|
||||||
public static final String COMPILE_MODS_PROCESSED = "modCompile_PROCESSED";
|
|
||||||
|
|
||||||
public static List<String> getClassPath() {
|
public static List<String> getClassPath() {
|
||||||
URL[] urls = ((URLClassLoader) Constants.class.getClassLoader()).getURLs();
|
URL[] urls = ((URLClassLoader) Constants.class.getClassLoader()).getURLs();
|
||||||
|
|
|
@ -96,8 +96,7 @@ public class ModRemapper {
|
||||||
throw new RuntimeException("Failed to rebof jar");
|
throw new RuntimeException("Failed to rebof jar");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add the deobf jar to be uploaded to maven
|
deobfJar.delete();
|
||||||
project.getArtifacts().add("archives", deobfJar);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue