\r
import org.springframework.util.Log4jConfigurer;\r
\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
import org.apache.tools.ant.Project;\r
\r
/**\r
public static String DEFAULT_TEST_RUN_PROPERTY = "slc.defaultTestRun";\r
\r
// SLC LOCAL PROPERTIES\r
- /** Property for the dir description (SLC local property file). */\r
- public static String DIR_DESCRIPTION_PROPERTY = "slc.dirDescription";\r
+ /** Property for the dir label (SLC local property file). */\r
+ public static String DIR_LABEL_PROPERTY = "slc.dirLabel";\r
\r
private String slcRootFileName = "slcRoot.properties";\r
private String slcLocalFileName = "slcLocal.properties";\r
\r
// pass the project properties through the System properties\r
System.getProperties().putAll((Map<?, ?>) project.getUserProperties());\r
- Properties all = prepareAllProperties(slcRootFile);\r
+ Properties all = new Properties();\r
+ all.putAll(System.getProperties());\r
+ prepareAllProperties(slcRootFile, all);\r
+\r
+ Log log = LogFactory.getLog(this.getClass());\r
for (Object o : all.keySet()) {\r
String key = o.toString();\r
- //System.out.println(key+"="+all.getProperty(key));\r
+ // System.out.println(key+"="+all.getProperty(key));\r
if (project.getUserProperty(key) == null) {// not already set\r
+ // if (log.isDebugEnabled())\r
+ // log.debug(key + "=" + all.getProperty(key));\r
project.setUserProperty(key, all.getProperty(key));\r
}\r
}\r
* @return the prepared properties. Note that it also contains the System\r
* and Ant properties which had previously been set.\r
*/\r
- protected Properties prepareAllProperties(File slcRootFile) {\r
+ public void prepareAllProperties(File slcRootFile, Properties all) {\r
try {\r
final String fileUrlPrefix = "";\r
\r
- Properties all = new Properties();\r
- all.putAll(System.getProperties());\r
all.put(ROOT_FILE_PROPERTY, slcRootFile.getCanonicalPath());\r
// Remove basedir property in order to avoid conflict with Maven\r
if (all.containsKey("basedir"))\r
}\r
// Default test run\r
if (all.getProperty(DEFAULT_TEST_RUN_PROPERTY) == null) {\r
- all.setProperty(DEFAULT_TEST_RUN_PROPERTY, "defaultTestRun");\r
+ all.setProperty(DEFAULT_TEST_RUN_PROPERTY,\r
+ "defaultTestRun");\r
}\r
\r
// Default log4j\r
Log4jConfigurer.initLogging(confDir.getCanonicalPath()\r
+ File.separator + "log4j.properties");\r
}\r
-\r
- return all;\r
} catch (Exception e) {\r
throw new SlcAntException("Unexpected exception while configuring",\r
e);\r
/**\r
* Looks for a file named {@link #getSlcLocalFileName()} in the directory,\r
* loads it as properties file and return the value of the property\r
- * {@link #DIR_DESCRIPTION_PROPERTY}.\r
+ * {@link #DIR_LABEL_PROPERTY}.\r
*/\r
public String getDescriptionForDir(File dir) {\r
String description = dir.getName();\r
if (slcLocal.exists()) {\r
Properties properties = loadFile(slcLocal.getAbsolutePath());\r
description = properties.getProperty(\r
- SlcAntConfig.DIR_DESCRIPTION_PROPERTY, description);\r
+ SlcAntConfig.DIR_LABEL_PROPERTY, description);\r
}\r
return description;\r
}\r