]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java
Revert change of default test run
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / ant / SlcAntConfig.java
index fcf7ad7f2d840ede1820af8c02b86f639e35eeb6..9b2824886aca8503e3cc6dba6e73186729691772 100644 (file)
@@ -127,8 +127,8 @@ public class SlcAntConfig {
        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
@@ -153,15 +153,17 @@ public class SlcAntConfig {
 \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
                        if (project.getUserProperty(key) == null) {// not already set\r
-                               if (log.isDebugEnabled())\r
-                                       log.debug(key + "=" + all.getProperty(key));\r
+                       // if (log.isDebugEnabled())\r
+                       // log.debug(key + "=" + all.getProperty(key));\r
                                project.setUserProperty(key, all.getProperty(key));\r
                        }\r
                }\r
@@ -177,12 +179,10 @@ public class SlcAntConfig {
         * @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
@@ -246,7 +246,8 @@ public class SlcAntConfig {
                        }\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
@@ -258,8 +259,6 @@ public class SlcAntConfig {
                                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
@@ -282,7 +281,7 @@ public class SlcAntConfig {
        /**\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
@@ -291,7 +290,7 @@ public class SlcAntConfig {
                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