X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fant%2FSlcAntConfig.java;h=9b2824886aca8503e3cc6dba6e73186729691772;hb=058a6bfa5fe4e90f8ff825b6168eb8a1d5d2101c;hp=fcf7ad7f2d840ede1820af8c02b86f639e35eeb6;hpb=ad39dc06e6fcc81a50caf5c617f93f83b6cc698a;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java index fcf7ad7f2..9b2824886 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java @@ -127,8 +127,8 @@ public class SlcAntConfig { public static String DEFAULT_TEST_RUN_PROPERTY = "slc.defaultTestRun"; // SLC LOCAL PROPERTIES - /** Property for the dir description (SLC local property file). */ - public static String DIR_DESCRIPTION_PROPERTY = "slc.dirDescription"; + /** Property for the dir label (SLC local property file). */ + public static String DIR_LABEL_PROPERTY = "slc.dirLabel"; private String slcRootFileName = "slcRoot.properties"; private String slcLocalFileName = "slcLocal.properties"; @@ -153,15 +153,17 @@ public class SlcAntConfig { // pass the project properties through the System properties System.getProperties().putAll((Map) project.getUserProperties()); - Properties all = prepareAllProperties(slcRootFile); + Properties all = new Properties(); + all.putAll(System.getProperties()); + prepareAllProperties(slcRootFile, all); Log log = LogFactory.getLog(this.getClass()); for (Object o : all.keySet()) { String key = o.toString(); // System.out.println(key+"="+all.getProperty(key)); if (project.getUserProperty(key) == null) {// not already set - if (log.isDebugEnabled()) - log.debug(key + "=" + all.getProperty(key)); + // if (log.isDebugEnabled()) + // log.debug(key + "=" + all.getProperty(key)); project.setUserProperty(key, all.getProperty(key)); } } @@ -177,12 +179,10 @@ public class SlcAntConfig { * @return the prepared properties. Note that it also contains the System * and Ant properties which had previously been set. */ - protected Properties prepareAllProperties(File slcRootFile) { + public void prepareAllProperties(File slcRootFile, Properties all) { try { final String fileUrlPrefix = ""; - Properties all = new Properties(); - all.putAll(System.getProperties()); all.put(ROOT_FILE_PROPERTY, slcRootFile.getCanonicalPath()); // Remove basedir property in order to avoid conflict with Maven if (all.containsKey("basedir")) @@ -246,7 +246,8 @@ public class SlcAntConfig { } // Default test run if (all.getProperty(DEFAULT_TEST_RUN_PROPERTY) == null) { - all.setProperty(DEFAULT_TEST_RUN_PROPERTY, "defaultTestRun"); + all.setProperty(DEFAULT_TEST_RUN_PROPERTY, + "defaultTestRun"); } // Default log4j @@ -258,8 +259,6 @@ public class SlcAntConfig { Log4jConfigurer.initLogging(confDir.getCanonicalPath() + File.separator + "log4j.properties"); } - - return all; } catch (Exception e) { throw new SlcAntException("Unexpected exception while configuring", e); @@ -282,7 +281,7 @@ public class SlcAntConfig { /** * Looks for a file named {@link #getSlcLocalFileName()} in the directory, * loads it as properties file and return the value of the property - * {@link #DIR_DESCRIPTION_PROPERTY}. + * {@link #DIR_LABEL_PROPERTY}. */ public String getDescriptionForDir(File dir) { String description = dir.getName(); @@ -291,7 +290,7 @@ public class SlcAntConfig { if (slcLocal.exists()) { Properties properties = loadFile(slcLocal.getAbsolutePath()); description = properties.getProperty( - SlcAntConfig.DIR_DESCRIPTION_PROPERTY, description); + SlcAntConfig.DIR_LABEL_PROPERTY, description); } return description; }