incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1383502 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core: EasyAntEngine.java ant/ProjectUtils.java
Date Tue, 11 Sep 2012 18:16:14 GMT
Author: jlboudart
Date: Tue Sep 11 18:16:14 2012
New Revision: 1383502

URL: http://svn.apache.org/viewvc?rev=1383502&view=rev
Log:
Reorganise Imports and move printMemoryDetails method to ProjectUtils

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/ProjectUtils.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java?rev=1383502&r1=1383501&r2=1383502&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
Tue Sep 11 18:16:14 2012
@@ -55,7 +55,6 @@ import org.apache.tools.ant.Main;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.ProjectHelper;
 import org.apache.tools.ant.ProjectHelper.OnMissingExtensionPoint;
-import org.apache.tools.ant.ProjectHelperRepository;
 import org.apache.tools.ant.PropertyHelper;
 import org.apache.tools.ant.Target;
 import org.apache.tools.ant.Task;
@@ -71,8 +70,6 @@ import org.apache.tools.ant.util.ProxySe
  */
 public class EasyAntEngine {
 
-    private static final long MEGABYTE = 1024 * 1024;;
-
     private final EasyAntConfiguration configuration;
 
     private PluginService pluginService = null;
@@ -648,7 +645,7 @@ public class EasyAntEngine {
             }
         }
         if (configuration.isShowMemoryDetails() || configuration.getMsgOutputLevel() >=
Project.MSG_VERBOSE) {
-            printMemoryDetails(project);
+            ProjectUtils.printMemoryDetails(project);
         }
     }
 
@@ -683,21 +680,6 @@ public class EasyAntEngine {
     }
 
     /**
-     * Print memory details
-     * 
-     * @param project
-     *            a given project
-     */
-    public static void printMemoryDetails(Project project) {
-        project.log("---- Memory Details ----");
-        project.log("  Used Memory  = "
-                + (Runtime.getRuntime().totalMemory() / MEGABYTE - Runtime.getRuntime().freeMemory()
/ MEGABYTE) + "MB");
-        project.log("  Free Memory  = " + (Runtime.getRuntime().freeMemory() / MEGABYTE)
+ "MB");
-        project.log("  Total Memory = " + (Runtime.getRuntime().totalMemory() / MEGABYTE)
+ "MB");
-        project.log("-----------------------");
-    }
-
-    /**
      * Return the configured plugin service instance
      * 
      * @return the configured plugin service instance

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/ProjectUtils.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/ProjectUtils.java?rev=1383502&r1=1383501&r2=1383502&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/ProjectUtils.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/ProjectUtils.java
Tue Sep 11 18:16:14 2012
@@ -18,12 +18,10 @@
 package org.apache.easyant.core.ant;
 
 import java.io.File;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.lang.reflect.Field;
 import java.util.Iterator;
 
-import org.apache.easyant.core.EasyAntConstants;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.BuildListener;
 import org.apache.tools.ant.BuildLogger;
@@ -37,6 +35,9 @@ import org.apache.tools.ant.Target;
  * 
  */
 public class ProjectUtils {
+    
+    private static final long MEGABYTE = 1024 * 1024;
+
 
     /**
      * emulates a top level target
@@ -119,5 +120,20 @@ public class ProjectUtils {
         project.addBuildListener(logger);
 
     }
+    
+    /**
+     * Print memory details
+     * 
+     * @param project
+     *            a given project
+     */
+    public static void printMemoryDetails(Project project) {
+        project.log("---- Memory Details ----");
+        project.log("  Used Memory  = "
+                + (Runtime.getRuntime().totalMemory() / MEGABYTE - Runtime.getRuntime().freeMemory()
/ MEGABYTE) + "MB");
+        project.log("  Free Memory  = " + (Runtime.getRuntime().freeMemory() / MEGABYTE)
+ "MB");
+        project.log("  Total Memory = " + (Runtime.getRuntime().totalMemory() / MEGABYTE)
+ "MB");
+        project.log("-----------------------");
+    }
 
 }



Mime
View raw message