Controller controller = new Controller(workspace, new VertexCreatingVisitor());
for (String libraryPath : options.getLibraryPaths()) {
CommandLineLibraryNameParser parser = new CommandLineLibraryNameParser(libraryPath).invoke();
Project project = parser.getProject();
Library library = repository.load(project, parser.getLibraryName());
project.addLibrary(library);
controller.addProject(new NewProjectOperation(project));
}
Library mainLib = workspace.lookupLibrary(UUID.fromString(options.getMainLib()));
if (mainLib == null) {
throw new IllegalArgumentException("No library found with id " + options.getMainLib());
}
Block entryPoint = (Block) mainLib.getElements().get(options.getEntryPoint());
if (entryPoint == null) {
throw new IllegalArgumentException("No block found named " + options.getEntryPoint());
}
System.out.println("entryPoint to execute: " + entryPoint.name);