Browse Source

Improve iOS and make it's unzipping more verbose

MeFisto94 9 years ago
parent
commit
60a40e6a77

+ 10 - 5
jme3-core/src/com/jme3/gde/core/util/ZipExtensionTool.java

@@ -207,7 +207,8 @@ public class ZipExtensionTool {
                 return false;
                 return false;
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.log(Level.SEVERE, "Error when extracting {0}. Is unzip installed? Did the download fail?", extensionName);
+            logger.log(Level.SEVERE, "Exception", e);
             NotifyDescriptor.Confirmation msg = new NotifyDescriptor.Confirmation(
             NotifyDescriptor.Confirmation msg = new NotifyDescriptor.Confirmation(
                     "Error extracting " + extensionName,
                     "Error extracting " + extensionName,
                     NotifyDescriptor.DEFAULT_OPTION,
                     NotifyDescriptor.DEFAULT_OPTION,
@@ -219,14 +220,16 @@ public class ZipExtensionTool {
                 try {
                 try {
                     in.close();
                     in.close();
                 } catch (IOException ex) {
                 } catch (IOException ex) {
-                    Exceptions.printStackTrace(ex);
+                    logger.log(Level.SEVERE, "Exception when trying to close the ZIP Input Stream.");
+                    logger.log(Level.SEVERE, "Exception", ex);
                 }
                 }
             }
             }
             if (out != null) {
             if (out != null) {
                 try {
                 try {
                     out.close();
                     out.close();
                 } catch (IOException ex) {
                 } catch (IOException ex) {
-                    Exceptions.printStackTrace(ex);
+                    logger.log(Level.SEVERE, "Exception when trying to close the Output Stream.");
+                    logger.log(Level.SEVERE, "Exception", ex);
                 }
                 }
             }
             }
         }
         }
@@ -280,7 +283,8 @@ public class ZipExtensionTool {
                     NotifyDescriptor.DEFAULT_OPTION,
                     NotifyDescriptor.DEFAULT_OPTION,
                     NotifyDescriptor.ERROR_MESSAGE);
                     NotifyDescriptor.ERROR_MESSAGE);
             DialogDisplayer.getDefault().notify(msg);
             DialogDisplayer.getDefault().notify(msg);
-            Exceptions.printStackTrace(ex);
+            logger.log(Level.SEVERE, "Error when extracting {0}. Is unzip installed? Did the download fail?", extensionName);
+            logger.log(Level.SEVERE, "Exception", ex);
             return false;
             return false;
         }
         }
 
 
@@ -314,7 +318,8 @@ public class ZipExtensionTool {
                     }
                     }
                 }
                 }
             } catch (Exception e) {
             } catch (Exception e) {
-                Exceptions.printStackTrace(e);
+                logger.log(Level.SEVERE, "Exception when trying to read from STDOUT/STDERR.");
+                logger.log(Level.SEVERE, "Exception", e);
             }
             }
         }
         }
     }
     }

+ 3 - 1
jme3-ios/src/com/jme3/gde/ios/IosTool.java

@@ -74,7 +74,9 @@ public class IosTool {
         FileObject[] sdks = sdkRoot.getChildren();
         FileObject[] sdks = sdkRoot.getChildren();
         for (FileObject fileObject : sdks) {
         for (FileObject fileObject : sdks) {
             if (fileObject.isFolder()) {
             if (fileObject.isFolder()) {
-                if (fileObject.getName().startsWith(target)) {
+                if (fileObject.getName().equals(target)) {
+                    sdkList.add("default"); // instead of an empty field, we add "default"
+                } else if (fileObject.getName().startsWith(target)) {
                     sdkList.add(fileObject.getName().substring(target.length(), fileObject.getName().length()));
                     sdkList.add(fileObject.getName().substring(target.length(), fileObject.getName().length()));
                 }
                 }
             }
             }