import java.util.Properties;\r
import java.util.Vector;\r
\r
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;\r
import org.springframework.context.ApplicationContext;\r
import org.springframework.context.support.FileSystemXmlApplicationContext;\r
\r
import org.apache.tools.ant.helper.ProjectHelperImpl;\r
\r
import org.argeo.slc.core.structure.DefaultSRegistry;\r
+import org.argeo.slc.core.structure.SimpleSElement;\r
import org.argeo.slc.core.structure.StructureRegistry;\r
-import org.argeo.slc.core.structure.tree.TreeSElement;\r
import org.argeo.slc.core.structure.tree.TreeSPath;\r
\r
/**\r
SlcAntConfig.initProject(project, slcRootFile);\r
\r
// init Spring application context\r
- String acPath = project\r
- .getUserProperty(SlcAntConfig.APPLICATION_CONTEXT_PROPERTY);\r
- ApplicationContext context = new FileSystemXmlApplicationContext(acPath);\r
- project.addReference(REF_ROOT_CONTEXT, context);\r
-\r
- // init structure register if it does not exist\r
+ initSpringContext(project);\r
+ \r
+ // init structure registry\r
DefaultSRegistry registry = new DefaultSRegistry();\r
project.addReference(REF_STRUCTURE_REGISTRY, registry);\r
\r
// call the underlying implementation to do the actual work\r
super.parse(project, source);\r
\r
- addSlcTasks(project);\r
-\r
// create structure root\r
registerProjectAndParents(project);\r
+\r
+ addSlcTasks(project);\r
+\r
}\r
\r
private void registerProjectAndParents(Project project) {\r
.getDescription() : "";\r
}\r
}\r
- TreeSElement element = new TreeSElement(description);\r
+ SimpleSElement element = new SimpleSElement(description);\r
\r
if (dir.equals(rootDir)) {\r
currPath = TreeSPath.createRootPath(rootDir.getName());\r
}\r
}\r
\r
+ private void initSpringContext(Project project) {\r
+ System.getProperties().putAll(project.getProperties());\r
+ String acPath = project\r
+ .getUserProperty(SlcAntConfig.APPLICATION_CONTEXT_PROPERTY);\r
+ ApplicationContext context = new FileSystemXmlApplicationContext(acPath);\r
+ project.addReference(REF_ROOT_CONTEXT, context);\r
+ }\r
+\r
private void addSlcTasks(Project project) {\r
Properties taskdefs = new Properties();\r
try {\r