]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.agent/src/main/java/org/argeo/slc/cli/DefaultSlcRuntime.java
Introduce examples modules
[gpl/argeo-slc.git] / org.argeo.slc.agent / src / main / java / org / argeo / slc / cli / DefaultSlcRuntime.java
index 3fc2a5671fced3e77bb54b9fb7c290e84d5a6607..841a823012f96ceed2542a4101e96b220166384f 100644 (file)
@@ -69,6 +69,10 @@ public class DefaultSlcRuntime {
 
                Resource scriptRes = findScript(script);
                Resource slcRootFile = findSlcRootFile(scriptRes);
+               if (slcRootFile == null)
+                       throw new SlcException(
+                                       "Could not find any SLC root file, "
+                                                       + "please configure one at the root of your scripts hierarchy.");
 
                SlcExecution slcExecution = createSlcExecution(runtime, slcRootFile,
                                scriptRes, targets);
@@ -112,8 +116,8 @@ public class DefaultSlcRuntime {
                slcExecution.getAttributes().put(AntConstants.EXECATTR_ANT_FILE,
                                scriptRelativePath);
                if (targets != null)
-                       slcExecution.getAttributes().put(
-                                       AntConstants.EXECATTR_ANT_TARGETS, targets);
+                       slcExecution.getAttributes().put(AntConstants.EXECATTR_ANT_TARGETS,
+                                       targets);
 
                slcExecution.setStatus(SlcExecution.STATUS_SCHEDULED);
                return slcExecution;
@@ -189,12 +193,14 @@ public class DefaultSlcRuntime {
         * defined by {@link #SLC_ROOT_FILE_NAME}.
         */
        protected Resource findSlcRootFile(Resource currDir) {
-               if (log.isDebugEnabled())
-                       log.debug("Look for SLC root file in " + currDir);
+               if (log.isTraceEnabled())
+                       log.trace("Look for SLC root file in " + currDir);
 
                try {
                        Resource slcRootFile = currDir.createRelative(SLC_ROOT_FILE_NAME);
                        if (slcRootFile.exists()) {
+                               if (log.isDebugEnabled())
+                                       log.debug("Found SLC root file: " + slcRootFile);
                                return slcRootFile;
                        } else {
                                String currPath = currDir.getURL().getPath();