public boolean ensureLibraryIsIncluded(@NotNull Module module,@NotNull Iterable<GradleCoordinate> dependencies,@Nullable Runnable callback){
  GradleBuildModel buildModel=GradleBuildModel.get(module);
  if (buildModel == null) {
    return false;
  }
  List<GradleCoordinate> missing=findMissingLibrariesFromGradleBuildFile(buildModel,dependencies);
  if (missing.isEmpty()) {
    return true;
  }
  if (userWantToAddDependencies(module,missing)) {
    addDependenciesInTransaction(buildModel,module,missing,callback);
    return true;
  }
  return false;
}

public boolean ensureLibraryIsIncluded ( @ NotNull Module module , @ NotNull Iterable < GradleCoordinate > dependencies , @ Nullable Runnable callback ) { GradleBuildModel buildModel = GradleBuildModel . get ( module ) ; if ( buildModel == null ) { return false ; } List < GradleCoordinate > missing = findMissingLibrariesFromGradleBuildFile ( buildModel , dependencies ) ; if ( missing . isEmpty ( ) ) { return true ; } if ( userWantToAddDependencies ( module , missing ) ) { addDependenciesInTransaction ( buildModel , module , missing , callback ) ; return true ; } return false ; }
ensures that all the specified dependencies are included in the specified module . < p / > if some dependencies are missing a dialog is presented to the user if those dependencies should be added to the module . if the user agrees the dependencies are added . the caller may supply a callback to determine when the requested dependencies have been added ( this make take several seconds ) .
