- /*
- * File rootDir = new File(project
- * .getUserProperty(SlcAntConstants.ROOT_DIR_PROPERTY))
- * .getAbsoluteFile(); File baseDir =
- * project.getBaseDir().getAbsoluteFile(); List<File> dirs = new Vector<File>();
- * File currentDir = baseDir; do { dirs.add(currentDir); currentDir =
- * currentDir.getParentFile(); if (log.isTraceEnabled()) log.trace("List " +
- * currentDir); } while (!currentDir.equals(rootDir.getParentFile())); //
- * first path is root dir (because of previous algorithm) TreeSPath
- * currPath = TreeSPath.createRootPath(rootDir.getName()); for (int i =
- * dirs.size() - 1; i >= 0; i--) { File dir = dirs.get(i); // retrieves
- * description for this path final String description; if (i == 0) {//
- * project itself description = project.getDescription() != null &&
- * !project.getDescription().equals("") ? project .getDescription() :
- * project.getName(); } else { description = dir.getName(); if
- * (log.isTraceEnabled()) log.trace("Dir desc " + i + "/" + dirs.size() + ": " +
- * description); } SimpleSElement element = new
- * SimpleSElement(description); // creates and register path if
- * (!dir.equals(rootDir)) {// already set currPath =
- * currPath.createChild(dir.getName()); } registry.register(currPath,
- * element); } project.addReference(SlcAntConstants.REF_PROJECT_PATH,
- * currPath);
- */
+ // Project level
+ String projectName = project.getName() != null
+ && !project.getName().equals("") ? project.getName()
+ : "project";
+ TreeSPath projectPath = currPath.createChild(projectName);
+
+ String projectDesc = project.getDescription() != null
+ && !project.getDescription().equals("") ? project
+ .getDescription() : projectPath.getName();
+
+ registry.register(projectPath, new SimpleSElement(projectDesc));
+ project.addReference(AntConstants.REF_PROJECT_PATH, projectPath);
+
+ if (log.isDebugEnabled())
+ log.debug("Project path: " + projectPath);