@Override
public void addDirectManagedDependency(Dependency dep)
{
getGradleFacet().installForgeLibrary();
GradleModelBuilder model = GradleModelBuilder.create(getGradleFacet().getModel());
Dependency newDep = null;
// First try to enforce version using imported dependencies (like Maven do)
newDep = resolveVersionIn(getEffectiveImports(), dep);
if (newDep == null)
{
newDep = dep;
}
model.addManagedDependency(forgeDepToGradleDep(newDep));
if (listContainsDep(gradleDepsToForgeDeps(model.getDependencies()), newDep))
{
model.removeDependency(forgeDepToGradleDep(newDep));
model.addDependency(forgeDepToGradleDep(DependencyBuilder.create(newDep).setVersion(null)));
}
getGradleFacet().setModel(model);
}