throw new BuildException("The given base dir does not exist " + basedir);
Workspace workspace = Workspace.getWorkspace(basedir.getParentFile());
workspace.addBasicPlugin(new ConsoleProgress());
Project project = workspace.getProject(basedir.getName());
if (project == null)
throw new BuildException("Unable to find bnd project in directory: " + basedir);
project.setProperty("in.ant", "true");
project.setProperty("environment", "ant");
// Check if we are in a sub build, in that case
// top will be set to the target directory at the
// top project.
if (top != null && top.length() > 0 && !top.startsWith("$"))
project.setProperty("top", top);
project.setExceptions(true);
Properties properties = project.getFlattenedProperties();
checkForTesting(project, properties);
if (report() || report(workspace) || report(project))
throw new BuildException("Errors during preparing bnd");