new ProjectHelper2().parse(project, upgradeFile);
Target defaultTarget = (Target) project.getTargets().get(project.getDefaultTarget());
for (Task t : defaultTarget.getTasks()) {
DBUpgrader upgrader = null;
if (t instanceof DBUpgrader) {
upgrader = (DBUpgrader) t;
} else if (t instanceof UnknownElement) {
if ("dbupgrade".equals(t.getTaskType())) {
UnknownElement u = (UnknownElement)t;
u.maybeConfigure();
if (u.getTask() instanceof DBUpgrader) {
upgrader = (DBUpgrader) u.getTask();
}
}
}
if (upgrader != null) {
upgrader.setConnection(connection);
break;
}
}
project.executeTarget(project.getDefaultTarget());