public static List<? extends ImportModule> performImport(@NonNull GradleImport importer,@NonNull Collection<EclipseProject> projects){
  List<EclipseImportModule> modules=Lists.newArrayList();
  List<EclipseImportModule> replacedByDependencies=Lists.newArrayList();
  for (  EclipseProject project : projects) {
    EclipseImportModule module=new EclipseImportModule(importer,project);
    module.initialize();
    if (module.isReplacedWithDependency()) {
      replacedByDependencies.add(module);
    }
 else {
      modules.add(module);
    }
  }
  for (  EclipseImportModule replaced : replacedByDependencies) {
    assert replaced.getReplaceWithDependencies() != null;
    EclipseProject project=replaced.getProject();
    for (    EclipseImportModule module : modules) {
      if (module.getProject().getAllLibraries().contains(project)) {
        module.addDependencies(replaced.getReplaceWithDependencies());
      }
    }
  }
  for (  EclipseImportModule module : modules) {
    module.removeJarDependencies();
  }
  Collections.sort(modules);
  return modules;
}

public static List < ? extends ImportModule > performImport ( @ NonNull GradleImport importer , @ NonNull Collection < EclipseProject > projects ) { List < EclipseImportModule > modules = Lists . newArrayList ( ) ; List < EclipseImportModule > replacedByDependencies = Lists . newArrayList ( ) ; for ( EclipseProject project : projects ) { EclipseImportModule module = new EclipseImportModule ( importer , project ) ; module . initialize ( ) ; if ( module . isReplacedWithDependency ( ) ) { replacedByDependencies . add ( module ) ; } else { modules . add ( module ) ; } } for ( EclipseImportModule replaced : replacedByDependencies ) { assert replaced . getReplaceWithDependencies ( ) != null ; EclipseProject project = replaced . getProject ( ) ; for ( EclipseImportModule module : modules ) { if ( module . getProject ( ) . getAllLibraries ( ) . contains ( project ) ) { module . addDependencies ( replaced . getReplaceWithDependencies ( ) ) ; } } } for ( EclipseImportModule module : modules ) { module . removeJarDependencies ( ) ; } Collections . sort ( modules ) ; return modules ; }
creates a list of modules from the given set of projects . the returned list is in dependency order .
