import org.gradle.plugins.ide.idea.model.ModuleDependency;
class ModuleDependencyBuilder {
public ModuleDependency create(Project project, String scope) {
if (project.getPlugins().hasPlugin(IdeaPlugin.class)) {
return new ModuleDependency(((IdeaModel) project.getExtensions().getByName("idea")).getModule().getName(), scope);
} else {
return new ModuleDependency(project.getName(), scope);
}
}