Search in sources :

Example 1 with ProjectDependency

use of com.badlogic.gdx.setup.DependencyBank.ProjectDependency in project libgdx by libgdx.

the class GdxSetup method parseDependencies.

private static List<Dependency> parseDependencies(String dependencies, DependencyBank bank) {
    List<String> dependencyNames = new ArrayList<String>();
    while (dependencies.contains(";")) {
        dependencyNames.add(dependencies.substring(0, dependencies.indexOf(";")).toLowerCase());
        dependencies = dependencies.substring(dependencies.indexOf(";") + 1);
    }
    dependencyNames.add(dependencies.toLowerCase());
    Map<String, Dependency> dependencyMap = new HashMap<String, Dependency>();
    for (ProjectDependency pd : ProjectDependency.values()) {
        dependencyMap.put(pd.name().toLowerCase(), bank.getDependency(pd));
    }
    List<Dependency> dependencyList = new ArrayList<Dependency>();
    dependencyList.add(bank.getDependency(ProjectDependency.GDX));
    for (String name : dependencyNames) {
        if (dependencyMap.containsKey(name)) {
            System.out.println("Extension " + name + " found");
            dependencyList.add(dependencyMap.get(name));
        } else
            System.out.println("Extension " + name + " not found");
    }
    return dependencyList;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ProjectDependency(com.badlogic.gdx.setup.DependencyBank.ProjectDependency) ProjectDependency(com.badlogic.gdx.setup.DependencyBank.ProjectDependency)

Aggregations

ProjectDependency (com.badlogic.gdx.setup.DependencyBank.ProjectDependency)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1