public class SlcProjectHelper extends ProjectHelper2 {\r
private static Log log;\r
\r
- /** The Ant reference to the Spring application context used. */\r
- public static String REF_ROOT_CONTEXT = "slcApplicationContext";\r
- /** The Ant reference to the SLC structure registry used. */\r
- public static String REF_STRUCTURE_REGISTRY = "slcStructureRegistry";\r
- /** The Ant reference to the <code>TreePath</code> of the current project */\r
- public static String REF_PROJECT_PATH = "slcProjectPath";\r
- /**\r
- * Resource path to the property file listing the SLC specific Ant tasks:\r
- * /org/argeo/slc/ant/taskdefs.properties\r
- */\r
- private static String SLC_TASKDEFS_RESOURCE_PATH = "/org/argeo/slc/ant/taskdefs.properties";\r
- private static String SLC_TYPEDEFS_RESOURCE_PATH = "/org/argeo/slc/ant/typedefs.properties";\r
-\r
protected SlcAntConfig slcAntConfig = null;\r
\r
@Override\r
\r
// Init structure registry\r
DefaultSRegistry registry = new DefaultSRegistry();\r
- project.addReference(REF_STRUCTURE_REGISTRY, registry);\r
+ project.addReference(SlcAntConstants.REF_STRUCTURE_REGISTRY, registry);\r
}\r
\r
/**\r
private void registerProjectAndParents(Project project,\r
SlcAntConfig slcAntConfig) {\r
StructureRegistry<TreeSPath> registry = (StructureRegistry<TreeSPath>) project\r
- .getReference(REF_STRUCTURE_REGISTRY);\r
+ .getReference(SlcAntConstants.REF_STRUCTURE_REGISTRY);\r
File rootDir = new File(project\r
- .getUserProperty(SlcAntConfig.ROOT_DIR_PROPERTY))\r
+ .getUserProperty(SlcAntConstants.ROOT_DIR_PROPERTY))\r
.getAbsoluteFile();\r
File baseDir = project.getBaseDir().getAbsoluteFile();\r
List<File> dirs = new Vector<File>();\r
}\r
registry.register(currPath, element);\r
}\r
- project.addReference(REF_PROJECT_PATH, currPath);\r
+ project.addReference(SlcAntConstants.REF_PROJECT_PATH, currPath);\r
}\r
\r
/** Gets the path of a project (root). */\r
AbstractApplicationContext context = new FileSystemXmlApplicationContext(\r
'/' + acPath);\r
context.registerShutdownHook();\r
- project.addReference(REF_ROOT_CONTEXT, context);\r
+ project.addReference(SlcAntConstants.REF_ROOT_CONTEXT, context);\r
\r
createAndRegisterSlcExecution(project);\r
// Add build listeners declared in Spring context\r
\r
/** Loads the SLC specific Ant tasks. */\r
protected static void addCustomTaskAndTypes(Project project) {\r
- Properties taskdefs = getDefs(project, SLC_TASKDEFS_RESOURCE_PATH);\r
+ Properties taskdefs = getDefs(project, SlcAntConstants.SLC_TASKDEFS_RESOURCE_PATH);\r
for (Object o : taskdefs.keySet()) {\r
String name = o.toString();\r
try {\r
log.error("Unknown class for task " + name, e);\r
}\r
}\r
- Properties typedefs = getDefs(project, SLC_TYPEDEFS_RESOURCE_PATH);\r
+ Properties typedefs = getDefs(project, SlcAntConstants.SLC_TYPEDEFS_RESOURCE_PATH);\r
for (Object o : typedefs.keySet()) {\r
String name = o.toString();\r
try {\r
slcExecution.setHost(SlcExecution.UNKOWN_HOST);\r
}\r
\r
- if (project.getReference(SlcProjectHelper.REF_ROOT_CONTEXT) != null) {\r
- slcExecution.setType(SlcExecutionBuildListener.SLC_ANT_TYPE);\r
+ if (project.getReference(SlcAntConstants.REF_ROOT_CONTEXT) != null) {\r
+ slcExecution.setType(SlcAntConstants.EXECTYPE_SLC_ANT);\r
} else {\r
- slcExecution.setType(SlcExecutionBuildListener.ANT_TYPE);\r
+ slcExecution.setType(SlcAntConstants.EXECTYPE_ANT);\r
}\r
\r
slcExecution.setUser(System.getProperty("user.name"));\r
slcExecution.getAttributes().put("ant.file",\r
project.getProperty("ant.file"));\r
\r
- project.addReference(SlcExecutionBuildListener.REF_SLC_EXECUTION,\r
+ project.addReference(SlcAntConstants.REF_SLC_EXECUTION,\r
slcExecution);\r
\r
// Add build listeners declared in Spring context\r
Map<String, ProjectRelatedBuildListener> listeners = ((ListableBeanFactory) project\r
- .getReference(REF_ROOT_CONTEXT)).getBeansOfType(\r
+ .getReference(SlcAntConstants.REF_ROOT_CONTEXT)).getBeansOfType(\r
ProjectRelatedBuildListener.class, false, true);\r
for (ProjectRelatedBuildListener listener : listeners.values()) {\r
listener.init(project);\r