details:   /erp/devel/pi/rev/2d8040c9cab4
changeset: 11556:2d8040c9cab4
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Apr 08 08:20:21 2011 +0200
summary:   check.module.consistency task exists with when deps are not ok

diffstat:

 src/org/openbravo/erpCommon/modules/CheckLocalConsistency.java |  41 +++++----
 1 files changed, 22 insertions(+), 19 deletions(-)

diffs (62 lines):

diff -r bddb50a59643 -r 2d8040c9cab4 
src/org/openbravo/erpCommon/modules/CheckLocalConsistency.java
--- a/src/org/openbravo/erpCommon/modules/CheckLocalConsistency.java    Fri Apr 
08 08:07:51 2011 +0200
+++ b/src/org/openbravo/erpCommon/modules/CheckLocalConsistency.java    Fri Apr 
08 08:20:21 2011 +0200
@@ -20,6 +20,7 @@
 package org.openbravo.erpCommon.modules;
 
 import org.apache.log4j.Logger;
+import org.apache.tools.ant.BuildException;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.DalInitializingTask;
 import org.openbravo.erpCommon.utility.OBError;
@@ -35,29 +36,31 @@
 
     OBError msg = new OBError();
 
+    Module[] modulesToInstall = new Module[0];
+    Module[] modulesToUpdate = new Module[0];
+    Module[] modulesToMerge = new Module[0];
+
+    VersionUtility.setPool(new DalConnectionProvider());
+
+    boolean checked;
     try {
-      Module[] modulesToInstall = new Module[0];
-      Module[] modulesToUpdate = new Module[0];
-      Module[] modulesToMerge = new Module[0];
-
-      VersionUtility.setPool(new DalConnectionProvider());
-
-      boolean checked = VersionUtility.checkLocal(vars, modulesToInstall, 
modulesToUpdate,
-          modulesToMerge, msg);
-      if (checked) {
-        System.out.println("Local Dependencies are OK");
-        System.out.println("=========================");
-
-      } else {
-        System.out.println("Local Dependencies are not satisfied");
-        System.out.println("====================================\n");
-
-        System.out.println(msg.getMessage());
-      }
+      checked = VersionUtility.checkLocal(vars, modulesToInstall, 
modulesToUpdate, modulesToMerge,
+          msg);
     } catch (Exception e) {
-      log4j.error("Error", e);
+      throw new BuildException("Error checking dependencies", e);
     }
 
+    if (checked) {
+      log4j.info("Local Dependencies are OK");
+      log4j.info("=========================");
+    } else {
+      log4j.error("Local Dependencies are not satisfied");
+      log4j.error("====================================\n");
+
+      log4j.error(msg.getMessage());
+
+      throw new BuildException("Dependencies are not satisfied");
+    }
   }
 
 }

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to