Possible fix/workaround for idea enabling annotation processors when we dont really need them.

dev/0.11
modmuss50 2019-12-11 14:19:47 +00:00
parent c67206297e
commit dcbe6c4566
3 changed files with 13 additions and 4 deletions

View File

@ -290,4 +290,8 @@ public class LoomGradleExtension {
return refmapName;
}
public boolean ideSync() {
return Boolean.parseBoolean(System.getProperty("idea.sync.active", "false"));
}
}

View File

@ -156,6 +156,7 @@ public class LoomDependencyManager {
}
private static void handleInstallerJson(JsonObject jsonObject, Project project) {
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
JsonObject libraries = jsonObject.get("libraries").getAsJsonObject();
Configuration mcDepsConfig = project.getConfigurations().getByName(Constants.MINECRAFT_DEPENDENCIES);
Configuration apDepsConfig = project.getConfigurations().getByName("annotationProcessor");
@ -166,7 +167,10 @@ public class LoomDependencyManager {
ExternalModuleDependency modDep = (ExternalModuleDependency) project.getDependencies().create(name);
modDep.setTransitive(false);
mcDepsConfig.getDependencies().add(modDep);
apDepsConfig.getDependencies().add(modDep);
if (!extension.ideSync()) {
apDepsConfig.getDependencies().add(modDep);
}
project.getLogger().debug("Loom adding " + name + " from installer JSON");

View File

@ -59,9 +59,10 @@ public class SetupIntelijRunConfigs {
}
private static void generate(Project project) throws IOException {
//Ensures the assets are downloaded when idea is syncing a project
if (Boolean.parseBoolean(System.getProperty("idea.sync.active", "false"))) {
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
if (extension.ideSync()) {
//Ensures the assets are downloaded when idea is syncing a project
MinecraftAssetsProvider.provide(extension.getMinecraftProvider(), project);
MinecraftNativesProvider.provide(extension.getMinecraftProvider(), project);
}